Re: avoiding pci_disable_device()...

From: Jeff Garzik
Date: Mon Feb 14 2005 - 17:28:56 EST


Roland Dreier wrote:
Jeff> That's an MSI bug.

Jeff> A current PCI driver -should- be using pci_request_regions().

Hmm... I'm not sure everyone would agree with that. It does make
sense that the MSI-X core wants to make sure that it owns the MSI-X
table without having someone else stomp on it.

The idea is right but the implementation is definitely incorrect, for multiple reasons:

* Every PCI driver should call pci_request_regions(), because there should only be one pci_driver associated with that set of resources.

* Therefore, any _addition_ to the PCI API that prevents a driver from using pci_request_regions() causes multiple problems, by virtue of diverging from the other 98% of the kernel's PCI drivers, which use pci_request_regions().

IOW, MSI-X's implementation incorrectly constrains PCI driver authors.

* Programmer over-protection. Who is attempting to stomp on MSI-X tables? If a driver is reading an MSI-X bar and doing something without consulting the kernel MSI-X code, that's a bug and most likely a violation of the PCI spec. Fix the driver.

In Linux we don't over-protect programmers with a zillion sanity checks for every internal API call; that leads to bloat, and papers over bugs that should be fixed.

Jeff


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