lkml.org 
[lkml]   [2002]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 2.5.31] transparent PCI-to-PCI bridges
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/

\
 
 \ /
  Last update: 2005-03-22 13:28    [W:0.106 / U:0.684 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site