Linux PCI subsystem development
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Add CXL Reset Support for CXL Devices
@ 2025-02-21  4:39 Srirangan Madhavan
  2025-02-21  4:39 ` [PATCH v2 1/2] cxl: de-duplicate cxl DVSEC reg defines Srirangan Madhavan
  2025-02-21  4:39 ` [PATCH v2 2/2] cxl: add support for cxl reset Srirangan Madhavan
  0 siblings, 2 replies; 10+ messages in thread
From: Srirangan Madhavan @ 2025-02-21  4:39 UTC (permalink / raw)
  To: Srirangan Madhavan, Davidlohr Bueso, Jonathan Cameron, Dave Jiang,
	Alison Schofield, Vishal Verma, Ira Weiny, Dan Williams
  Cc: Zhi Wang, Vishal Aslot, Shanker Donthineni, linux-cxl,
	Bjorn Helgaas, linux-pci

This patch series introduces support for the CXL Reset method
for CXL devices, implementing the reset procedure outlined in
CXL Spec [1] v3.2, Sections 9.6 and 9.7.

v2 changes:
- de-duplicate CXL DVSEC register defines under include/cxl/pci.h
- fix style related issues.

v1 changes:
- Added cover letter and dropped the RFC.

The RFC patche can be found here [2]

Motivation:
-----------
This change is broadly useful for reasons including but not limited to the
following:
- As support for Type 2 devices [3] is being introduced, more devices will
  require finer-grained reset mechanisms beyond bus-wide reset methods.
- FLR does not affect CXL.cache or CXL.mem protocols, making CXL Reset
  the preferred method in some cases.
- The CXL spec (Sections 7.2.3 Binding and Unbinding, 9.5 FLR) highlights use
  cases like function rebinding and error recovery, where CXL Reset is
  explicitly mentioned.

Change Description:
-------------------
The patch implements the required steps for CXL reset and introduces a new reset
method in the pci_reset_fn_methods. It also defines the necessary CXL DVSEC
register macros. The actual steps for rest are broadly: disable cache lines and
asserts WB+I, wait for cache and memory clear signals, initial reset, wait for
complete and return status.

Command line to test the CXL reset on a capable device:
    echo cxl_reset > /sys/bus/pci/devices/<pci_device>/reset_method
    echo 1 > /sys/bus/pci/devices/<pci_device>/reset

[1] https://computeexpresslink.org/cxl-specification/
[2] https://lore.kernel.org/all/20241213074143.374-1-smadhavan@nvidia.com/
[3] https://lore.kernel.org/linux-cxl/20241216161042.42108-1-alejandro.lucero-palau@amd.com/

Srirangan Madhavan (2):
  cxl: de-duplicate cxl DVSEC reg defines
  cxl: add support for cxl reset

 drivers/cxl/core/pci.c        |   1 +
 drivers/cxl/core/regs.c       |   1 +
 drivers/cxl/cxlpci.h          |  53 -----------
 drivers/cxl/pci.c             |   1 +
 drivers/pci/pci.c             | 163 ++++++++++++++++++++++++++++++++--
 include/cxl/pci.h             |  76 ++++++++++++++++
 include/linux/pci.h           |   2 +-
 include/uapi/linux/pci_regs.h |   5 --
 8 files changed, 235 insertions(+), 67 deletions(-)
 create mode 100644 include/cxl/pci.h

-- 
2.25.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-08-22 15:33 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-21  4:39 [PATCH v2 0/2] Add CXL Reset Support for CXL Devices Srirangan Madhavan
2025-02-21  4:39 ` [PATCH v2 1/2] cxl: de-duplicate cxl DVSEC reg defines Srirangan Madhavan
2025-02-21  4:39 ` [PATCH v2 2/2] cxl: add support for cxl reset Srirangan Madhavan
2025-02-21 10:45   ` Lukas Wunner
2025-02-22  0:13     ` Bjorn Helgaas
2025-04-07 23:45       ` Srirangan Madhavan
2025-08-22 15:33         ` Alejandro Lucero Palau
2025-02-21 12:43   ` Alejandro Lucero Palau
2025-02-22  5:45   ` kernel test robot
2025-02-22  7:08   ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox