* [PATCH] PCI: Skip devices with RRS Vendor ID(0x0001) on root bus
@ 2026-03-27 7:36 Zhu Lingshan
2026-04-02 11:08 ` lingshan.zhu
2026-04-02 22:45 ` Bjorn Helgaas
0 siblings, 2 replies; 3+ messages in thread
From: Zhu Lingshan @ 2026-03-27 7:36 UTC (permalink / raw)
To: bhelgaas; +Cc: linux-pci, Zhu Lingshan
PCIe Request Retry Status (RRS) is a link-layer mechanism where a
downstream device responds with RRS to indicate it is not ready.
With RRS Software Visibility enabled, the Root Port translates
RRS into Vendor ID 0x0001 (reserved by PCI SIG) for the driver.
Devices on the root bus, for example the root port itself,
have no upstream PCIe link and can never legitimately return RRS.
This patch skips any devices with RRS Vendor ID 0x0001
on the root bus instead of entering the RRS retry loop.
Signed-off-by: Zhu Lingshan <lingshan.zhu@amd.com>
---
drivers/pci/probe.c | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index bccc7a4bdd79..2fad89ca594c 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -2578,8 +2578,27 @@ bool pci_bus_generic_read_dev_vendor_id(struct pci_bus *bus, int devfn, u32 *l,
*l == 0x0000ffff || *l == 0xffff0000)
return false;
- if (pci_bus_rrs_vendor_id(*l))
+ if (pci_bus_rrs_vendor_id(*l)) {
+ /*
+ * RRS (Request Retry Status) is a PCIe link-layer mechanism
+ * where a downstream device sends a RRS completion status, and the
+ * Root Port (with RRS Software Visibility enabled) translates
+ * it to Vendor ID 0x0001 for the driver, indicating the
+ * device is not ready.
+ *
+ * Therefore, RRS is a root port feature, and devices on the root bus,
+ * for example the root port itself have no upstream PCIe link,
+ * so they can never legitimately return RRS.
+ */
+ if (pci_is_root_bus(bus)) {
+ pr_err("pci %04x:%02x:%02x.%d: invalid Vendor ID %04x (RRS, reserved by PCI SIG) on root bus, buggy device\n",
+ pci_domain_nr(bus), bus->number,
+ PCI_SLOT(devfn), PCI_FUNC(devfn),
+ *l & 0xffff);
+ return false;
+ }
return pci_bus_wait_rrs(bus, devfn, l, timeout);
+ }
return true;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] PCI: Skip devices with RRS Vendor ID(0x0001) on root bus
2026-03-27 7:36 [PATCH] PCI: Skip devices with RRS Vendor ID(0x0001) on root bus Zhu Lingshan
@ 2026-04-02 11:08 ` lingshan.zhu
2026-04-02 22:45 ` Bjorn Helgaas
1 sibling, 0 replies; 3+ messages in thread
From: lingshan.zhu @ 2026-04-02 11:08 UTC (permalink / raw)
To: Zhu Lingshan, bhelgaas, linux-pci
Gentle Ping
Thanks
Zhu Lingshan
On 3/27/26 3:36 PM, Zhu Lingshan <lingshan.zhu@amd.com> wrote:
> PCIe Request Retry Status (RRS) is a link-layer mechanism where a
> downstream device responds with RRS to indicate it is not ready.
>
> With RRS Software Visibility enabled, the Root Port translates
> RRS into Vendor ID 0x0001 (reserved by PCI SIG) for the driver.
>
> Devices on the root bus, for example the root port itself,
> have no upstream PCIe link and can never legitimately return RRS.
>
> This patch skips any devices with RRS Vendor ID 0x0001
> on the root bus instead of entering the RRS retry loop.
>
> Signed-off-by: Zhu Lingshan <lingshan.zhu@amd.com>
> ---
> drivers/pci/probe.c | 21 ++++++++++++++++++++-
> 1 file changed, 20 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> index bccc7a4bdd79..2fad89ca594c 100644
> --- a/drivers/pci/probe.c
> +++ b/drivers/pci/probe.c
> @@ -2578,8 +2578,27 @@ bool pci_bus_generic_read_dev_vendor_id(struct pci_bus *bus, int devfn, u32 *l,
> *l == 0x0000ffff || *l == 0xffff0000)
> return false;
>
> - if (pci_bus_rrs_vendor_id(*l))
> + if (pci_bus_rrs_vendor_id(*l)) {
> + /*
> + * RRS (Request Retry Status) is a PCIe link-layer mechanism
> + * where a downstream device sends a RRS completion status, and the
> + * Root Port (with RRS Software Visibility enabled) translates
> + * it to Vendor ID 0x0001 for the driver, indicating the
> + * device is not ready.
> + *
> + * Therefore, RRS is a root port feature, and devices on the root bus,
> + * for example the root port itself have no upstream PCIe link,
> + * so they can never legitimately return RRS.
> + */
> + if (pci_is_root_bus(bus)) {
> + pr_err("pci %04x:%02x:%02x.%d: invalid Vendor ID %04x (RRS, reserved by PCI SIG) on root bus, buggy device\n",
> + pci_domain_nr(bus), bus->number,
> + PCI_SLOT(devfn), PCI_FUNC(devfn),
> + *l & 0xffff);
> + return false;
> + }
> return pci_bus_wait_rrs(bus, devfn, l, timeout);
> + }
>
> return true;
> }
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] PCI: Skip devices with RRS Vendor ID(0x0001) on root bus
2026-03-27 7:36 [PATCH] PCI: Skip devices with RRS Vendor ID(0x0001) on root bus Zhu Lingshan
2026-04-02 11:08 ` lingshan.zhu
@ 2026-04-02 22:45 ` Bjorn Helgaas
1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Helgaas @ 2026-04-02 22:45 UTC (permalink / raw)
To: Zhu Lingshan; +Cc: bhelgaas, linux-pci
On Fri, Mar 27, 2026 at 03:36:59PM +0800, Zhu Lingshan wrote:
> PCIe Request Retry Status (RRS) is a link-layer mechanism where a
> downstream device responds with RRS to indicate it is not ready.
>
> With RRS Software Visibility enabled, the Root Port translates
> RRS into Vendor ID 0x0001 (reserved by PCI SIG) for the driver.
>
> Devices on the root bus, for example the root port itself,
> have no upstream PCIe link and can never legitimately return RRS.
>
> This patch skips any devices with RRS Vendor ID 0x0001
> on the root bus instead of entering the RRS retry loop.
What problem does this solve? Did you see a device that claimed a
0x0001 Vendor ID?
How does this work for devices on s390 and virtualized guest
topologies where a device may be on the root bus seen by the guest
kernel, but still have an upstream link to a Root Port not visible to
that kernel?
The device may respond with RRS completions, but I don't know how that
would be handled.
> @@ -2578,8 +2578,27 @@ bool pci_bus_generic_read_dev_vendor_id(struct pci_bus *bus, int devfn, u32 *l,
> *l == 0x0000ffff || *l == 0xffff0000)
> return false;
>
> - if (pci_bus_rrs_vendor_id(*l))
> + if (pci_bus_rrs_vendor_id(*l)) {
> + /*
> + * RRS (Request Retry Status) is a PCIe link-layer mechanism
> + * where a downstream device sends a RRS completion status, and the
> + * Root Port (with RRS Software Visibility enabled) translates
> + * it to Vendor ID 0x0001 for the driver, indicating the
> + * device is not ready.
> + *
> + * Therefore, RRS is a root port feature, and devices on the root bus,
> + * for example the root port itself have no upstream PCIe link,
> + * so they can never legitimately return RRS.
Please wrap comments to fit in 80 columns like the rest of the file.
> + */
> + if (pci_is_root_bus(bus)) {
> + pr_err("pci %04x:%02x:%02x.%d: invalid Vendor ID %04x (RRS, reserved by PCI SIG) on root bus, buggy device\n",
> + pci_domain_nr(bus), bus->number,
> + PCI_SLOT(devfn), PCI_FUNC(devfn),
> + *l & 0xffff);
> + return false;
> + }
> return pci_bus_wait_rrs(bus, devfn, l, timeout);
> + }
>
> return true;
> }
> --
> 2.53.0
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-04-02 22:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-27 7:36 [PATCH] PCI: Skip devices with RRS Vendor ID(0x0001) on root bus Zhu Lingshan
2026-04-02 11:08 ` lingshan.zhu
2026-04-02 22:45 ` Bjorn Helgaas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox