public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Zhu Lingshan <lingshan.zhu@amd.com>
Cc: bhelgaas@google.com, linux-pci@vger.kernel.org
Subject: Re: [PATCH] PCI: Skip devices with RRS Vendor ID(0x0001) on root bus
Date: Thu, 2 Apr 2026 17:45:40 -0500	[thread overview]
Message-ID: <20260402224540.GA303659@bhelgaas> (raw)
In-Reply-To: <20260327073659.6160-1-lingshan.zhu@amd.com>

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
> 

      parent reply	other threads:[~2026-04-02 22:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

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=20260402224540.GA303659@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=lingshan.zhu@amd.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