All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: Lukas Wunner <lukas@wunner.de>,
	linux-pci@vger.kernel.org,
	 Sourabh Jain <sourabhjain@linux.ibm.com>,
	 Oliver OHalloran <oohall@gmail.com>,
	linuxppc-dev@lists.ozlabs.org,
	 Alex Deucher <alexander.deucher@amd.com>,
	 Sathyanarayanan Kuppuswamy
	<sathyanarayanan.kuppuswamy@linux.intel.com>,
	 Keith Busch <kbusch@kernel.org>,
	 Maciej Grochowski <Maciej.Grochowski@sony.com>
Subject: Re: [PATCH 2/2] PCI/AER: Check validity of Error Source ID register
Date: Wed, 4 Nov 2026 03:06:35 +0200 (EET)	[thread overview]
Message-ID: <6cdf31f5-63ce-a232-5bdd-d45a67f0a384@linux.intel.com> (raw)
In-Reply-To: <20261104004609.GA1167435@bhelgaas>

[-- Attachment #1: Type: text/plain, Size: 2335 bytes --]

On Tue, 3 Nov 2026, Bjorn Helgaas wrote:

> On Tue, Nov 03, 2026 at 02:57:58PM +0200, Ilpo Järvinen wrote:
> > On Tue, 3 Nov 2026, Lukas Wunner wrote:
> > 
> > > Certain Intel and AMD Root Ports are known to populate the Error Source ID
> > > register with an invalid value.  The AER driver seeks to recognize such
> > > buggy silicon by assuming invalidity if the bus number is zero.  It then
> > > searches for the error-signaling device in the hierarchy below the Root
> > > Port.  This was introduced by commit 28eb27cf0839 ("PCI AER: support
> > > invalid error source IDs").
> > > 
> > > Alex has provided dmesg output which shows an invalid Error Source ID with
> > > a non-zero bus number.  The AER driver's heuristic fails to recognize its
> > > invalidity:
> > > 
> > >   pcieport 0000:00:07.1: AER: Correctable Error message received from 0000:01:00.0 (no details found)
> > > 
> > > The Root Port at 0000:00:07.1 has subordinate bus 04, so an error source
> 
> I always think "subordinate" is just slightly ambiguous because it's
> used for both "anything below this bridge" and the more specific
> "Subordinate Bus Number" (the highest numbered bus below the bridge).
> 
> It's perfectly accurate as-is especially because in this case it looks
> like Secondary Bus Number and Subordinate Bus Number are *both* 04 for
> 00:07.1.  But "secondary bus 04" seems less ambiguous to me.
> 
> > > on bus 01 is obviously invalid.  The range of subordinate buses is cached
> > > and checking against it is cheap.
> > ...
> 
> > > +	return root->subordinate->busn_res.start <= PCI_BUS_NUM(id) &&
> > > +	       root->subordinate->busn_res.end   >= PCI_BUS_NUM(id);
> > 
> > I kind of hate the order of this logic. I understand you're probably 
> > doing it for the alignment which has some value but...
> > 
> > ...For me, the more logical order would be to keep these in increasing 
> > order even if doing it results in losing the alignment:
> > 
> >    start <= val &&
> >    val <= end
> > 
> > Maybe that's just me and it's not an end of the world either way.
> 
> I agree, I think "start <= val && val <= end" is more readable, though
> not quite as pretty.

I suppose a local var could be used to shorten the derefs and it would 
even fit to a single line then.

-- 
 i.

  reply	other threads:[~2026-11-04  1:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-03  9:45 [PATCH 0/2] PCI/AER: Improve Error Source handling Lukas Wunner
2026-11-03  9:45 ` [PATCH 1/2] PCI/AER: Avoid NULL pointer deref on search for Error Source Lukas Wunner
2026-11-03  9:56   ` sashiko-bot
2026-11-03 12:39   ` Ilpo Järvinen
2026-11-03 16:08   ` Kuppuswamy Sathyanarayanan
2026-11-03  9:45 ` [PATCH 2/2] PCI/AER: Check validity of Error Source ID register Lukas Wunner
2026-11-03 10:11   ` sashiko-bot
2026-11-03 17:29     ` Lukas Wunner
2026-11-03 12:57   ` Ilpo Järvinen
2026-11-04  0:46     ` Bjorn Helgaas
2026-11-04  1:06       ` Ilpo Järvinen [this message]
2026-11-03 16:15   ` Kuppuswamy Sathyanarayanan

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=6cdf31f5-63ce-a232-5bdd-d45a67f0a384@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=Maciej.Grochowski@sony.com \
    --cc=alexander.deucher@amd.com \
    --cc=helgaas@kernel.org \
    --cc=kbusch@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=lukas@wunner.de \
    --cc=oohall@gmail.com \
    --cc=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=sourabhjain@linux.ibm.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.