Re: [PATCH 0/4] PCI legacy I/O port free driver (take4)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Russell King wrote:
It's not really "I/O port resource allocation" though - the resources
have already been allocated and potentially programmed into the BARs
well before the driver gets anywhere near the device.
[...]
Are you implying that somehow resources are allocated at pci_enable_device
time?  If so, shouldn't we be thinking of moving completely to that model
rather than having yet-another-pci-setup-model.

Actually, that's has been the rule ever since the cardbus days: resources -- bars and irqs -- should not be considered allocated until after pci_enable_device().

Documentation/pci.txt reflects this reality as well:

3. Enabling and disabling devices
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Before you do anything with the device you've found, you need to enable
it by calling pci_enable_device() which enables I/O and memory regions of
the device, allocates an IRQ if necessary, assigns missing resources if
needed and wakes up the device if it was in suspended state. Please note
that this function can fail.

Any PCI driver that presumes -anything- about resources before calling pci_enable_device() is buggy, and that's been the case for many years. Some platform-specific PCI drivers violate this with special knowledge, but overall that's the rule.

Regards,

	Jeff


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux