From: Lukas Wunner <lukas@wunner.de>
To: Alexander Gruhlke <gruhlke@mailbox.org>
Cc: bhelgaas@google.com, rafael@kernel.org, alex@shazbot.org,
hui.wang@canonical.com, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org, regressions@lists.linux.dev
Subject: Re: [PATCH 1/2] PCI: Don't treat ~0 as ready in pci_dev_wait() with RRS SV
Date: Sun, 11 Oct 2026 17:14:49 +0200 [thread overview]
Message-ID: <asun6Yq3cGBY3SXE@wunner.de> (raw)
In-Reply-To: <20261011082408.17274-1-gruhlke@mailbox.org>
On Sun, Oct 11, 2026 at 10:24:08AM +0200, Alexander Gruhlke wrote:
> On Sat, Oct 10, 2026 at 08:36:38PM +0200, Lukas Wunner wrote:
> > I think it's sufficient if you just change the if-condition like this:
> >
> > - if (!pci_bus_rrs_vendor_id(id))
> > + if (!pci_bus_rrs_vendor_id(id) &&
> > + !PCI_POSSIBLE_ERROR(id)) {
> >
> > I don't see the need for the extra read of the Command register
> > you're performing.
>
> The Vendor ID of a VF always reads ~0, so with that condition, an FLR
> of a VF below a Root Port with RRS SV would poll until the 60 s timeout
> and fail. That's why the branch without RRS SV reads the Command
> register, too (see the comment above the loop). I'll mention it in the
> commit message.
Ah okay, thanks for the clarification. So how about:
- if (!pci_bus_rrs_vendor_id(id))
+ if (!pci_bus_rrs_vendor_id(id) &&
+ (!PCI_POSSIBLE_ERROR(id) || dev->is_virtfn))
Per PCIe r7.1 sec 9.4.3.3.1, VFs may respond with RRS Completions
under certain circumstance, so the Vendor ID does not *always* read
as 0xffff, despite sec 7.5.1.1.1 saying so. The above should handle
that correctly (unless I've botched it again).
Thanks,
Lukas
next prev parent reply other threads:[~2026-10-11 15:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-10 16:05 [PATCH 0/2] PCI: Wait after FLR for devices that don't honor Immediate Readiness Alexander Gruhlke
2026-10-10 16:05 ` [PATCH 1/2] PCI: Don't treat ~0 as ready in pci_dev_wait() with RRS SV Alexander Gruhlke
2026-10-10 18:36 ` Lukas Wunner
2026-10-11 8:24 ` Alexander Gruhlke
2026-10-11 15:14 ` Lukas Wunner [this message]
2026-10-10 16:05 ` [PATCH 2/2] PCI: Wait for readiness after FLR even with Immediate Readiness Alexander Gruhlke
2026-10-10 17:51 ` Lukas Wunner
2026-10-11 8:25 ` Alexander Gruhlke
2026-10-11 16:38 ` [PATCH 0/2] PCI: Wait after FLR for devices that don't honor " Alexander Gruhlke
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=asun6Yq3cGBY3SXE@wunner.de \
--to=lukas@wunner.de \
--cc=alex@shazbot.org \
--cc=bhelgaas@google.com \
--cc=gruhlke@mailbox.org \
--cc=hui.wang@canonical.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=regressions@lists.linux.dev \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®