lkml.org 
[lkml]   [2016]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [tip:x86/urgent] x86/quirks: Add early quirk to reset Apple AirPort card
On Thu, Jun 09, 2016 at 09:37:53AM -0700, Yinghai Lu wrote:
> On Thu, Jun 9, 2016 at 4:04 AM, Lukas Wunner <lukas@wunner.de> wrote:
> > --- a/arch/x86/kernel/early-quirks.c
> > +++ b/arch/x86/kernel/early-quirks.c
> > @@ -747,7 +747,8 @@ static int __init check_dev_quirk(int num, int slot, int func)
> >
> > if ((type & 0x7f) == PCI_HEADER_TYPE_BRIDGE) {
> > sec = read_pci_config_byte(num, slot, func, PCI_SECONDARY_BUS);
> > - early_pci_scan_bus(sec);
> > + if (sec > num)
> > + early_pci_scan_bus(sec);
> > }
> >
> > if (!(type & 0x80))
>
> If two bridges have sec, then early_pci_scan_bus still could be called
> two times.
>
> Maybe we can add one static array to recorded scanned bus.
> static unsigned char scanned_bus[256];
> and in early_pci_scan_bus check and set that before scanning.

Well, the PCI core would also scan such a bus twice AFAICS.
And the performance penalty of scanning it twice seems negligible.
Early quirks can prevent double execution by setting QFLAG_APPLY_ONCE.
(Three quirks have set that flag already.)

So I think this shouldn't be a concern.

Thanks,

Lukas

\
 
 \ /
  Last update: 2016-06-09 23:01    [W:0.159 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site