Re: [RFC PATCH] PCI: remove access to pci_[enable|disable]_msi() for drivers - take 2

From: Greg KH
Date: Wed Jun 08 2005 - 12:59:44 EST


On Wed, Jun 08, 2005 at 03:31:09PM +0200, Andi Kleen wrote:
> On Tue, Jun 07, 2005 at 01:21:29PM -0700, Greg KH wrote:
> > Hm, here's an updated patch that should have fixed the errors I had in
> > my previous one where I wasn't disabling MSI for the devices that did
> > not want it enabled (note, my patch skips the hotplug and pcie driver
> > for now, those would have to be fixed if this patch goes on.)
> >
> > However, now that I've messed around with the MSI-X logic in the IB
> > driver, I'm thinking that this whole thing is just pointless, and I
> > should just drop it and we should stick with the current way of enabling
> > MSI only if the driver wants it. If you look at the logic in the mthca
> > driver you'll see what I mean.
>
> The problem is then that we have to go through all drivers and
> add the ugly logic there. Isnt it better to do it by default?

No, the logic to enable MSI in a driver today is simple, and
straight-forward. A single call to pci_enable_msi(). If instead the
driver wants to enable MSI-X, they call pci_enable_msix(). Contrast
that with the logic of:
- if MSI is enabled, disable it for some devices.
- if driver wants to enable MSI-X, do:
pci_disable_msi();
e = pci_enable_msix(); // which I think some people
// said will always fail anyway
// due to MSI being enabled
// already.
if (e)
pci_enable_msi();

So, we do that, MSI-X is now more complex and harder to enable (and
that's the future for PCI devices from what people are saying.)

Anyway, I'm just repeating myself now...

thanks,

greg k-h
-
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/