Re: [PATCH] Sort generic PCI fixups after specific ones

From: Ivan Kokshaysky
Date: Thu Sep 23 2004 - 17:51:54 EST


On Thu, Sep 23, 2004 at 06:31:51PM +0100, Matthew Wilcox wrote:
> Not really. There's two types of fixup (well, four if you multiply by
> the header vs later possibility). There's the incredibly specific ("this
> device from this manufacturer forgets to set something properly") and
> the incredibly general ("if this is a cardbus / IDE device, then ...").
> This patch simply distinguishes between the two. Obviously the general
> ones run after the specific ones -- there's specific devices that forget
> to set their class code, for example.

This is way not obvious. Example: some architecture requires to put
_all_ PCI IDE devices in native mode (obviously with a general fixup),
but what if some specific chips need additional "native mode only"
workarounds? Your logic won't work then.

I believe we do need third level of fixups, specifically for devices like
IDE which can change the PCI header contents (class code, BAR layout etc.)
depending on some magic bits in their registers.
Such "early" or "pre-header" fixups should be called right after the device
discovery, before probing the BARs. Apparently pci_setup_device()
is a proper place for that.

Ivan.
-
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/