From: Dave Jiang <dave.jiang@intel.com>
To: Richard Cheng <icheng@nvidia.com>,
jic23@kernel.org, dave@stgolabs.net, 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 4/4] cxl/pci: Guard decoder accesses after reset
Date: Fri, 30 Oct 2026 10:34:34 -0700 [thread overview]
Message-ID: <462e07c4-ca77-4111-a4b7-c45bf8a71e3e@intel.com> (raw)
In-Reply-To: <20260929020405.9724-5-icheng@nvidia.com>
On 9/28/26 7:04 PM, Richard Cheng wrote:
> cxl_reset_done() runs even when PCI state restoration is skipped.
> Reading HDM decoder registers while the device is inaccessible can
> trigger another error.
>
> Skip decoder checks if the PCI Command read fails, returns all ones, or
> Memory Space Enable is clear.
>
> Signed-off-by: Richard Cheng <icheng@nvidia.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
> ---
> drivers/cxl/pci.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c
> index c7c91e8dc51d..2294f7761e50 100644
> --- a/drivers/cxl/pci.c
> +++ b/drivers/cxl/pci.c
> @@ -976,6 +976,12 @@ static void cxl_reset_done(struct pci_dev *pdev)
> struct cxl_dev_state *cxlds = pci_get_drvdata(pdev);
> struct cxl_memdev *cxlmd = cxlds->cxlmd;
> struct device *dev = &pdev->dev;
> + u32 command;
> +
> + /* PCI state restoration may have been skipped after a failed reset. */
> + if (pci_read_config_dword(pdev, PCI_COMMAND, &command) ||
> + PCI_POSSIBLE_ERROR(command) || !(command & PCI_COMMAND_MEMORY))
> + return;
>
> /*
> * FLR does not expect to touch the HDM decoders and related
next prev parent reply other threads:[~2026-10-30 17:34 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
2026-09-29 2:04 ` [PATCH 4/4] cxl/pci: Guard decoder accesses after reset Richard Cheng
2026-10-30 17:34 ` Dave Jiang [this message]
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=462e07c4-ca77-4111-a4b7-c45bf8a71e3e@intel.com \
--to=dave.jiang@intel.com \
--cc=alison.schofield@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®