From: "Cheatham, Benjamin" <benjamin.cheatham@amd.com>
To: Richard Cheng <icheng@nvidia.com>, <jic23@kernel.org>,
<dave@stgolabs.net>, <dave.jiang@intel.com>,
<alison.schofield@intel.com>, <vishal.l.verma@intel.com>,
<iweiny@kernel.org>
Cc: <ming.li@zohomail.com>, <kaihengf@nvidia.com>, <kobak@nvidia.com>,
<newtonl@nvidia.com>, <kristinc@nvidia.com>, <mochs@nvidia.com>,
<linux-cxl@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/4] PCI: Skip state restoration when configuration is inaccessible
Date: Fri, 30 Oct 2026 16:04:22 -0500 [thread overview]
Message-ID: <8a19d63c-db9a-40ab-a811-5d761252638f@amd.com> (raw)
In-Reply-To: <20260929020405.9724-4-icheng@nvidia.com>
On 9/28/2026 9:04 PM, Richard Cheng wrote:
> pci_dev_restore() restores state even when the device is inaccessible.
> MSI-X restoration can then issue MMIO accesses that trigger DPC.
>
> Check configuration accessibility before restoring state. Keep driver
> reset callbacks and reset return values unchanged.
>
> Signed-off-by: Richard Cheng <icheng@nvidia.com>
> ---
> drivers/pci/pci.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index d59a374a350d..9a343f8b5429 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -5127,7 +5127,9 @@ static void pci_dev_restore(struct pci_dev *dev)
> const struct pci_error_handlers *err_handler =
> dev->driver ? dev->driver->err_handler : NULL;
>
> - pci_restore_state(dev);
> + /* MSI-X restoration may access device MMIO. */
> + if (pci_dev_config_accessible(dev, "restore state"))
> + pci_restore_state(dev);
Again, far from an expert, but this one seems a bit more cut and dry. I looked at the CXL reset_done handler
since I know that code, and it seems like it expects this state to be restored. There's a good amount of
drivers that implement this handler, so messing with this seems a bit cavalier. Seeing the next patch kind
of confirms that as well. If this is going to change you'll probably need to check and/or modify the other
handlers as well, or mention why they're left unmodified in the commit description.
If MSI-X restoration is the thing causing the issue, then maybe the right move is to leave MSI-X unrestored
in pci_restore_state()? It still has the same issue as not restoring everything, but the surface area is
a lot smaller.
I think the best thing to do would be to come at this from the device's driver that you're seeing this issue
with though.
Thanks,
Ben
>
> /*
> * dev->driver->err_handler->reset_done() is protected against
next prev parent reply other threads:[~2026-10-30 21:04 UTC|newest]
Thread overview: 10+ 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-10-30 21:04 ` Cheatham, Benjamin
2026-09-29 2:04 ` [PATCH 3/4] PCI: Skip state restoration when configuration is inaccessible Richard Cheng
2026-10-30 21:04 ` Cheatham, Benjamin [this message]
2026-09-29 2:04 ` [PATCH 4/4] cxl/pci: Guard decoder accesses after reset Richard Cheng
2026-10-30 17:34 ` Dave Jiang
2026-10-30 9:54 ` [PATCH 0/4] PCI/CXL: Guard reset recovery against inaccessible devices Richard Cheng
2026-10-30 21:04 ` Cheatham, Benjamin
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=8a19d63c-db9a-40ab-a811-5d761252638f@amd.com \
--to=benjamin.cheatham@amd.com \
--cc=alison.schofield@intel.com \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=icheng@nvidia.com \
--cc=iweiny@kernel.org \
--cc=jic23@kernel.org \
--cc=kaihengf@nvidia.com \
--cc=kobak@nvidia.com \
--cc=kristinc@nvidia.com \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.li@zohomail.com \
--cc=mochs@nvidia.com \
--cc=newtonl@nvidia.com \
--cc=vishal.l.verma@intel.com \
/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®