From: Lukas Wunner <lukas@wunner.de>
To: Alexander Gruhlke <gruhlke@mailbox.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
"Rafael J . Wysocki" <rafael@kernel.org>,
Alex Williamson <alex@shazbot.org>,
Hui Wang <hui.wang@canonical.com>, Linux-Fan <info@masysma.net>,
sashiko-bot@kernel.org, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org, regressions@lists.linux.dev
Subject: Re: [PATCH v2 2/2] PCI: Don't treat ~0 as ready in pci_dev_wait() with RRS SV
Date: Sun, 11 Oct 2026 20:13:43 +0200 [thread overview]
Message-ID: <asvR10NRftif8A8C@wunner.de> (raw)
In-Reply-To: <20261011164955.24425-1-gruhlke@mailbox.org>
On Sun, Oct 11, 2026 at 06:49:55PM +0200, Alexander Gruhlke wrote:
> On Sun, Oct 11, 2026 at 04:41:42PM +0000, sashiko-bot@kernel.org wrote:
> > Does this cause pci_dev_wait() to exit prematurely for Virtual Functions
> > (VFs) that return ~0 under Configuration RRS Software Visibility?
>
> Yes, but that's the current behavior for all devices; the patch only
> changes it for non-VFs.
>
> VFs could be covered by reading the Command register when the Vendor ID
> reads ~0 and waiting while that is ~0, too. Devices that are ready would
> still need only one read.
>
> Lukas, Bjorn: should I do that in v3, or keep the current form?
For a patch which is going to be backported to stable (due to the
Fixes tag), changing behavior is not a good idea, so I guess you
were right to read the Command Register on VFs if the return value
is 0xffff. I apologize for my earlier misleading comments.
You could probably constrain the Command Register read operation
to VFs as those are the only ones that would need it, right?
I've started to wonder if VFs can actually be inaccessible and
thus cause a 0xffff response. So I looked up where the spec
language in PCIe r7.1 sec 7.5.1.1.1 originates from:
It was introduced in PCIe r5.0 sec 9.3.4.1.2 and then r6.0 moved
spec language to sec 7.5.1.1.1. As rationale, PCIe r5.0 only says:
"This field in all VFs returns FFFFh when read. VI software should
return the VF Device ID (see Section 9.3.3.11) value from the
associated PF as the Device ID for the VF.
IMPLEMENTATION NOTE: Legacy PCI Probing Software
Returning FFFFh for Device ID and Vendor ID values allows some
legacy software to ignore VFs. See Section 7.5.1.1.1."
So it's a little unclear to me whether inaccessibility of VFs can
actually occur, but again, for a patch with a Fixes tag, it's better
to play it safe.
Thanks,
Lukas
next prev parent reply other threads:[~2026-10-11 18:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <sashiko-outbox-167316@kernel.org>
2026-10-11 16:49 ` Alexander Gruhlke
2026-10-11 18:13 ` Lukas Wunner [this message]
2026-10-11 16:32 [PATCH v2 0/2] PCI: Wait after FLR for devices that don't honor Immediate Readiness Alexander Gruhlke
2026-10-11 16:32 ` [PATCH v2 2/2] PCI: Don't treat ~0 as ready in pci_dev_wait() with RRS SV 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=asvR10NRftif8A8C@wunner.de \
--to=lukas@wunner.de \
--cc=alex@shazbot.org \
--cc=bhelgaas@google.com \
--cc=gruhlke@mailbox.org \
--cc=hui.wang@canonical.com \
--cc=info@masysma.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=regressions@lists.linux.dev \
--cc=sashiko-bot@kernel.org \
/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®