Re: [PATCH] And yet more PCI fixes for 2.5.70

From: Jeff Garzik (jgarzik@pobox.com)
Date: Wed Jun 11 2003 - 12:46:29 EST


On Wed, Jun 11, 2003 at 06:19:49PM +0100, Alan Cox wrote:
> On Mer, 2003-06-11 at 17:38, Greg KH wrote:
> > So that leaves only this file. Jeff Garzik and I talked about removing
> > pci_present() as it's not needed, and I think for this one case we can
> > live without it. Do you want me to make the pci_present() macro earlier
> > in this file, so it's readable again? I don't want to put it back into
> > pci.h.
>
> I still think it belongs in pci.h. Its an API and the API makes sense. The

Its an API that doesn't make sense.

99% of the uses can simply be eliminated (in 2.4, too).
They are entirely redundant.

The remaining two cases are really arch-specific checks that were
being done wrong anyway. Note the history: the definition morphed
in 2.4 from being "PCI BIOS seems to be present, so we'll assume a
PCI bus is present" to "PCI devices are present." Neither definition
is correct for the question the remaining two cases want answered:
"Is a PCI bus present?" Further, the IDE code calculating system
bus speed it should really be calling a PCI callback, not asking "Do
I have a PCI bus?" and making a guess... a guess which seems wrong
in several cases, including my Dual Athlon box w/ 100% 66 Mhz PCI bus.

So, I conclude that pci_present() is wrong for all cases except one --
and that case is sparc64-specific and can be handled with arch-specific
code, I bet.

        Jeff

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



This archive was generated by hypermail 2b29 : Sun Jun 15 2003 - 22:00:28 EST