Skip to contentSkip to conversation

MSI fix for buggy PCI/PCI-X hardware

DISCUSSION long 2 participants 2 messages Sep 9, 2003

lore
Share & tools
lore

long

author
#0 lore raw

The latest patches that enable MSI in the Linux kernel were sent out a few weeks ago on lkml. These patches will enable MSI support if users rebuild the kernel with CONFIG_PCI_MSI set to 'Y'. Option one (default option) enables MSI on specific individual PCI/PCI-X MSI-capable devices listed in the boot parameter "device_msi=". Users may choose option two, which enables MSI on all PCI/PCI-X MSI-capable devices, by setting CONFIG_PCI_MSI_ON_SPECIFIC_DEVICES to 'N'. Depending on if either option one or option two is selected, the kernel detects and enables MSI on requested PCI/PCI-X MSI-capable devices.

During testing we have found many currently shipping PCI/PCI-X MSI-capable devices have silicon bugs specific to MSI support. Most of these will cause system failures when MSI is enabled. To filter out MSI buggy hardware requires the kernel to detect and disable the MSI support on specific hardware.

The proposed solution is to provide a new API, named "int disable_msi(struct pci_dev *dev)", to allow IHV's who have shipped PCI/PCI-X hardware that does not work in MSI mode to update their software drivers to request the kernel to switch the interrupt mode from MSI mode back to IRQ pin-assertion mode. There are some reasons to justify this as below:

1) According to the PCI spec 3.0 or latest, the software driver is prohibited from directly interfacing with its device to switch MSI mode to IRQ pin-assertion mode. Consequently, a kernel interface is required since the kernel is the only entity permitted to change modes.

2) All PCI-Express endpoints require MSI support. These endpoints should have MSI enabled automatically by default. For PCI/PCI-X hardware that can't use MSI due to hardware bugs, it is the IHVs' responsibility to update their software drivers to request the kernel to disable MSI so the HW can function with MSI enabled for all other devices.

3) Some PCI/PCI-X MSI-capable hardware devices out there work with this patch without requiring any changes to their existing software drivers.

I'd appreciate any feedback you have on this proposed solution.

Thanks,
Long

#1 lore raw
Quoted 5 lines · long

The proposed solution is to provide a new API, named "int disable_msi(struct pci_dev *dev)", to allow IHV's who have shipped PCI/PCI-X hardware that does not work in MSI mode to update their software drivers to request the kernel to switch the interrupt mode from MSI mode back to IRQ pin-assertion mode.

No need for a new API. We have drivers/pci/quirk.c where we add PCI devices with known bugs. If there is commonality of the bugs across hardware, we can easily add a common "quirk" which fixes the situation.

Individual drivers shouldn't need to bother with this, really.

As an aside, if you need to blacklist certain _systems_ rather than certain PCI devices, you should either modify drivers/pci/quirks.c or arch/i386/kernel/dmi_scan.c.

Jeff