[PATCH v10 10/12] PCI/CXL: Expose CXL Reset as a PCI reset method
Srirangan Madhavan <[email protected]> Tue, 4 Aug 2026 19:29:56 +0000
| Newsgroups | org.kernel.vger.linux-tegra,org.kernel.vger.linux-cxl,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pci |
|---|---|
| Message-ID | <[email protected]> |
Add the CXL Reset helper to the PCI reset-method table so userspace can select it through the existing reset_method ABI. Advertise the method for Type 2 CXL devices that report CXL Reset support in the CXL Device DVSEC and pass the function-scope check. Reset execution requires cached HDM decoder state for the target so affected ranges can be validated and HDM programming can be restored. If that state is unavailable at reset time, return -ENOTTY so PCI can try the next reset method. Signed-off-by: Srirangan Madhavan <[email protected]> --- drivers/pci/pci.c | 2 ++ include/linux/pci.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 77b17b13ee61..ef25ba5f7fe9 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -34,6 +34,7 @@ #include <linux/aer.h> #include <linux/bitfield.h> #include <linux/suspend.h> +#include <cxl/cxl.h> #include "pci.h" DEFINE_MUTEX(pci_slot_mutex); @@ -5092,6 +5093,7 @@ const struct pci_reset_fn_method pci_reset_fn_methods[] = { { }, { pci_dev_specific_reset, .name = "device_specific" }, { pci_dev_acpi_reset, .name = "acpi" }, + { cxl_reset_function, .name = "cxl_reset" }, { pcie_reset_flr, .name = "flr" }, { pci_af_flr, .name = "af_flr" }, { pci_pm_reset, .name = "pm" }, diff --git a/include/linux/pci.h b/include/linux/pci.h index a8e5cec96bae..9319182b5692 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -52,7 +52,7 @@ PCI_STATUS_PARITY) /* Number of reset methods used in pci_reset_fn_methods array in pci.c */ -#define PCI_NUM_RESET_METHODS 8 +#define PCI_NUM_RESET_METHODS 9 #define PCI_RESET_PROBE true #define PCI_RESET_DO_RESET false -- 2.43.0