Re: [PATCH v2 0/2] PCI/CXL: Guard MMIO accesses during reset recovery

From: Richard Cheng

Date: Fri Nov 06 2026 - 06:39:39 EST


On Fri, Nov 06, 2026 at 07:18:27PM +0800, Richard Cheng wrote:
> PCI reset recovery may proceed with state restoration and driver
> reset_done() callbacks even when a device has not recovered.
> Accessing device MMIO in that state can cause additional errors, including
> DPC containment.
>
> This series adds checks before two MMIO access paths: MSI-X table
> resoration and CXL HDM decoder checking.
>
> Patch 1 checks the existing PCI Command register read in
> __pci_restore_msix_state(). If the read fails or returns all ones,
> warn and return before accessing the MSI-X table.
>
> Patch 2 guards CXL decoder accesses after reset.
> The CXL reset_done() callback independently accesses HDM decoder
> MMIO to check whether decoder state was lost during reset.
>
> Changes since v1 [1]:
> - Dropped v1 patch 1, since commit e8df1d194c39
> ("PCI: Don't treat ~0 as ready in pci_dev_wait() with RRS SV")
> already addresses the issue.
> - Dropped v1 patch 2, following Benjamin Cheatham's review.
> That some devices rely on the existing fallback behavior.
> - Reworked v1 patch 3 into v2 patch 1. Instead of skipping all PCI
> state restoration, check config accessibility before MSI-X restoration.
> This reduces the impact on other restoration paths.
> - Retained v1 patch 4 as v2 patch 2.
>
>

Sorry forgot to attach the link for v1:

https://lore.kernel.org/all/20260929020405.9724-1-icheng@xxxxxxxxxx/

Best regards,
Richard Cheng.

> Richard Cheng (2):
> PCI/MSI: Skip MSI-X restoration when configuration is inaccessible
> cxl/pci: Guard decoder accesses after reset
>
> drivers/cxl/pci.c | 6 ++++++
> drivers/pci/msi/msi.c | 6 +++++-
> 2 files changed, 11 insertions(+), 1 deletion(-)
>
>
> base-commit: f66469d9905b39d2c260a15d7d6db450f4db67c1
> --
> 2.43.0
>