Re: [patch 2.5.31] transparent PCI-to-PCI bridges

From: Ivan Kokshaysky (ink@jurassic.park.msu.ru)
Date: Tue Aug 27 2002 - 19:58:02 EST


On Mon, Aug 26, 2002 at 10:42:34AM -0700, Linus Torvalds wrote:
> Please don't do it like this: I hate code that changes standard PCI data
> structure meaning (in this case the "class" thing) behind peoples back..

Fairly speaking, I wasn't happy about that either - that's why
I tried to change only a single bit in the first patch.
Note that this stuff was intended for 2.4 in the first place :-)

> So instead, I would suggest that you add a single-bit "transparent" field
> to the PCI structure, and initialize it to "(class & 0xff) == 1" when
> initializing the device data. Then, any fixup can just set the transparent
> bit to 1.
>
> That would make the code more robust, and more readable in my opionion.
>
> Ok?

Agreed.
I would even go further and add a "quirks" field to the struct
pci_dev (probably 16 bits would be enough). Thus we can define
specific bits for common PCI bugs - not only QUIRK_TRANSPARENT_BRIDGE
but also things like QUIRK_BROKEN_MWI or even
QUIRK_SOME_COMMON_PCI_IDE_BUG and so on. This would allow generic code
to check a single bit instead of looking through several
vendor/device ID lists.

Thoughts?

Ivan.
-
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 : Sat Aug 31 2002 - 22:00:21 EST