public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
From: Zhu Lingshan <lingshan.zhu@amd.com>
To: <bhelgaas@google.com>
Cc: <linux-pci@vger.kernel.org>, Zhu Lingshan <lingshan.zhu@amd.com>
Subject: [PATCH] PCI: Skip devices with RRS Vendor ID(0x0001) on root bus
Date: Fri, 27 Mar 2026 15:36:59 +0800	[thread overview]
Message-ID: <20260327073659.6160-1-lingshan.zhu@amd.com> (raw)

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


             reply	other threads:[~2026-03-27  7:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-27  7:36 Zhu Lingshan [this message]
2026-04-02 11:08 ` [PATCH] PCI: Skip devices with RRS Vendor ID(0x0001) on root bus lingshan.zhu
2026-04-02 22:45 ` Bjorn Helgaas

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=20260327073659.6160-1-lingshan.zhu@amd.com \
    --to=lingshan.zhu@amd.com \
    --cc=bhelgaas@google.com \
    --cc=linux-pci@vger.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