All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Richard Cheng" <icheng@nvidia.com>
Cc: linux-cxl@vger.kernel.org
Subject: Re: [PATCH 2/4] PCI: Return -ETIMEOUT when reset readiness polling expires
Date: Tue, 29 Sep 2026 02:19:19 +0000	[thread overview]
Message-ID: <20260929021919.A4B8B1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260929020405.9724-3-icheng@nvidia.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] pci: breaking reset fallback leaves devices permanently wedged on timeout
--

commit 4617b1cca51c668aae8c9b4809552b80cdac13dd
Author: Richard Cheng <icheng@nvidia.com>

PCI: Return -ETIMEOUT when reset readiness polling expires

This patch modifies pci_dev_wait() to return -ETIMEDOUT instead of
-ENOTTY when a device fails to become ready. The commit message notes
this stops the reset-method fallback.

> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index 6461274bdbcf9..d59a374a350d8 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -1279,7 +1279,7 @@ static int pci_dev_wait(struct pci_dev *dev, char *reset_type, int timeout)
>  		if (delay > timeout) {
>  			pci_err(dev, "not ready %dms after %s; giving up\n",
>  				delay - 1, reset_type);
> -			return -ENOTTY;
> +			return -ETIMEDOUT;
>  		}

[Severity: High]
Will this regression leave devices permanently wedged if they hang during a
soft reset like a function level reset?

Looking at __pci_reset_function_locked() in drivers/pci/pci.c:

	for (i = 0; i < ARRAY_SIZE(pci_reset_fn_methods); i++) {
		...
		rc = method->reset_fn(dev, false);
		...
		if (rc != -ENOTTY)
			return rc;
	}

The fallback loop aborts on any error other than -ENOTTY.

Previously, if a device hung during a function level reset and
pci_dev_wait() timed out, it would return -ENOTTY. This allowed the
fallback mechanism to try a stronger reset method like a secondary bus
reset to recover the device.

By stopping this fallback, could userspace applications and virtual machine
guests using vfio permanently wedge an assigned device that has a buggy
reset implementation, instead of falling back to a secondary bus reset?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260929020405.9724-1-icheng@nvidia.com?part=2

  reply	other threads:[~2026-09-29  2:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-29  2:04 [PATCH 0/4] PCI/CXL: Guard reset recovery against inaccessible devices Richard Cheng
2026-09-29  2:04 ` [PATCH 1/4] PCI: Reject all-ones responses in pci_dev_wait() Richard Cheng
2026-09-29  2:04 ` [PATCH 2/4] PCI: Return -ETIMEOUT when reset readiness polling expires Richard Cheng
2026-09-29  2:19   ` sashiko-bot [this message]
2026-09-29  2:04 ` [PATCH 3/4] PCI: Skip state restoration when configuration is inaccessible Richard Cheng
2026-09-29  2:04 ` [PATCH 4/4] cxl/pci: Guard decoder accesses after reset Richard Cheng

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=20260929021919.A4B8B1F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=icheng@nvidia.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=sashiko-reviews@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.