All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Ingo Molnar <mingo@kernel.org>
Cc: Bjorn Helgaas <helgaas@kernel.org>,
	Yinghai Lu <yinghai@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	cmilsted@redhat.com, Rafa?? Mi??ecki <zajec5@gmail.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Matt Fleming <matt@codeblueprint.co.uk>,
	Peter Zijlstra <peterz@infradead.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Matthew Garrett <mjg59@srcf.ucam.org>,
	m@bues.ch,
	"linux-tip-commits@vger.kernel.org" 
	<linux-tip-commits@vger.kernel.org>
Subject: Re: [tip:x86/urgent] x86/quirks: Add early quirk to reset Apple AirPort card
Date: Fri, 10 Jun 2016 15:59:04 +0200	[thread overview]
Message-ID: <20160610135904.GA19958@wunner.de> (raw)
In-Reply-To: <20160610125957.GA30577@gmail.com>

On Fri, Jun 10, 2016 at 02:59:57PM +0200, Ingo Molnar wrote:
> * Lukas Wunner <lukas@wunner.de> wrote:
> > On Fri, Jun 10, 2016 at 01:58:45PM +0200, Ingo Molnar wrote:
> > > * Yinghai Lu <yinghai@kernel.org> wrote:
> > > > On 6/9/16, Lukas Wunner <lukas@wunner.de> wrote:
> > > > > 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.
> > > > 
> > > > I don't know. I would like see sth like following, and that is simple
> > > > enough.
> > > > 
> > > > --- linux-2.6.orig/arch/x86/kernel/early-quirks.c
> > > > +++ linux-2.6/arch/x86/kernel/early-quirks.c
> > > > @@ -755,10 +755,16 @@ static int __init check_dev_quirk(int nu
> > > >         return 0;
> > > >  }
> > > > 
> > > > +static unsigned char __initdata scanned[256];
> > > >  static void __init early_pci_scan_bus(int bus)
> > > >  {
> > > >         int slot, func;
> > > > 
> > > > +       if (scanned[bus])
> > > > +               return;
> > > > +
> > > > +       scanned[bus] = 1;
> > > > +
> > > >         /* Poor man's PCI discovery */
> > > >         for (slot = 0; slot < 32; slot++)
> > > >                 for (func = 0; func < 8; func++) {
> > > 
> > > Ok, I removed the fix from tip:x86/urgent from the time being - could you
> > > guys  please send a full version once a final approach is agreed upon?
> > 
> > IMHO the above patch to prevent double scanning isn't needed
> > and less code is usually better. So my suggestion would be the
> > patch as originally sent plus the delta fix I sent yesterday,
> > either squashed or applied separately.
> > 
> > Since Yinghai Lu seems to disagree I guess you as the maintainer
> > will have to make a decision. :-)
> 
> So I'd lean towards lower complexity, but since this is essentially
> PCI code I'd like to defer to Bjorn on that detail.

If I may add some additional information:

drivers/pci/probe.c contains the following comment:

	/*
	 * The bus might already exist for two reasons: Either we are
	 * rescanning the bus or the bus is reachable through more than
	 * one bridge. The second case can happen with the i450NX
	 * chipset.
	 */

So buses reachable through more than one bridge do exist, albeit they're
assumedly rare. The question is, what are the consequences?

(1) A minimal performance hit from scanning the bus multiple times.
(2) Quirks for devices on that bus are executed multiple times.
    As said quirks can set QFLAG_APPLY_ONCE to prevent that. If it turns
    out this patch regresses because quirks are executed multiple times
    but shouldn't, that's a bug in those quirks and they need to be
    amended to set QFLAG_APPLY_ONCE. If we avoid scanning the bus
    multiple times, we'd essentially be papering over those bugs.

Best regards,

Lukas

  reply	other threads:[~2016-06-10 13:55 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-28 23:35 [PATCH] x86: " Lukas Wunner
2016-05-28 23:35 ` Lukas Wunner
2016-06-02  9:48 ` Matt Fleming
2016-06-02  9:48   ` Matt Fleming
2016-06-08 14:23 ` [tip:x86/urgent] x86/quirks: " tip-bot for Lukas Wunner
2016-06-08 18:56   ` Yinghai Lu
2016-06-08 20:09     ` Lukas Wunner
2016-06-09  6:48       ` Ingo Molnar
2016-06-09 11:04         ` Lukas Wunner
2016-06-09 16:37           ` Yinghai Lu
2016-06-09 20:20             ` Lukas Wunner
2016-06-10  0:04               ` Yinghai Lu
2016-06-10 11:58                 ` Ingo Molnar
2016-06-10 12:16                   ` Lukas Wunner
2016-06-10 12:59                     ` Ingo Molnar
2016-06-10 13:59                       ` Lukas Wunner [this message]
2016-06-10 20:08                         ` Bjorn Helgaas
2016-06-12 11:13                           ` Lukas Wunner
2016-06-09 22:57 ` [PATCH] x86: " Bjorn Helgaas
2016-06-09 22:57   ` Bjorn Helgaas
2016-06-12 10:31 [PATCH v2 3/3] x86/quirks: " Lukas Wunner
2016-07-10 19:01 ` [tip:x86/urgent] " tip-bot for Lukas Wunner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160610135904.GA19958@wunner.de \
    --to=lukas@wunner.de \
    --cc=bhelgaas@google.com \
    --cc=cmilsted@redhat.com \
    --cc=helgaas@kernel.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=m@bues.ch \
    --cc=matt@codeblueprint.co.uk \
    --cc=mingo@kernel.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=yinghai@kernel.org \
    --cc=zajec5@gmail.com \
    --subject='Re: [tip:x86/urgent] x86/quirks: Add early quirk to reset Apple AirPort card' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.