RE: [RFC PATCH] PCI: remove access to pci_[enable|disable]_msi() for drivers

Nguyen, Tom L
2005-06-07T22:25:34Z

Monday, June 06, 2005 10:16 PM Greg KH wrote:
> On Mon, Jun 06, 2005 at 06:09:11PM -0700, Andrew Vasquez wrote:
> > * What if the driver writer does not want MSI enabled for their
> > hardware (even though there is an MSI capabilities entry)?
Reasons
> > include: overhead involved in initiating the MSI; no support in
some
> > versions of firmware (QLogic hardware).

> Yes, a very good point. I guess I should keep the pci_enable_msi()
and
> pci_disable_msi() functions exported for this reason.

That is one of the reason we like to have a driver to call explicitly
either pci_enable_msi() or pci_enable_msix() since its device may
support either or both MSI capability structure and MSI-X capability
structure. Once either MSI or MSI-X is enabled, the existing code does
not allow a driver to switch back and forth between MSI and MSI-X.

In addition, if you plan to enable MSI by default, then new function
pci_in_msi_mode is redundant because pci_enable_msi() always returns
zero if MSI was already enabled on a device. In this case, a driver must
use MSI, not MSI-X. As a result, I still prefer to have a driver to
explicitly call pci_enable_msi().

Thanks,
Long