[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160609202036.GA19638@wunner.de>
Date: Thu, 9 Jun 2016 22:20:36 +0200
From: Lukas Wunner <lukas@...ner.de>
To: Yinghai Lu <yinghai@...nel.org>
Cc: Ingo Molnar <mingo@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>, cmilsted@...hat.com,
Rafa?? Mi??ecki <zajec5@...il.com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
"H. Peter Anvin" <hpa@...or.com>,
Matt Fleming <matt@...eblueprint.co.uk>,
Peter Zijlstra <peterz@...radead.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Matthew Garrett <mjg59@...f.ucam.org>, m@...s.ch,
"linux-tip-commits@...r.kernel.org"
<linux-tip-commits@...r.kernel.org>
Subject: Re: [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@...ner.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
Powered by blists - more mailing lists