Linux CXL
 help / color / mirror / Atom feed
* [PATCH v1 0/1] Add CXL Reset Support for CXL Devices
@ 2025-02-07  9:03 Srirangan Madhavan
  2025-02-07  9:03 ` [PATCH v1 1/1] cxl: add support for cxl reset Srirangan Madhavan
  0 siblings, 1 reply; 8+ messages in thread
From: Srirangan Madhavan @ 2025-02-07  9:03 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

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

RFC -> v1:
- 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/wp-content/uploads/2024/02/CXL-3.1-Specification.pdf
[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 (1):
  cxl: add support for cxl reset

 drivers/pci/pci.c             | 183 ++++++++++++++++++++++++++++++++++
 include/linux/pci.h           |   2 +-
 include/uapi/linux/pci_regs.h |  25 +++++
 3 files changed, 209 insertions(+), 1 deletion(-)

-- 
2.25.1


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

end of thread, other threads:[~2025-02-21  5:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-07  9:03 [PATCH v1 0/1] Add CXL Reset Support for CXL Devices Srirangan Madhavan
2025-02-07  9:03 ` [PATCH v1 1/1] cxl: add support for cxl reset Srirangan Madhavan
2025-02-07 15:19   ` Dave Jiang
2025-02-07 17:15   ` Ira Weiny
2025-02-13  7:35     ` Srirangan Madhavan
2025-02-08 11:48   ` kernel test robot
2025-02-14 16:57   ` Jonathan Cameron
2025-02-21  5:15     ` Srirangan Madhavan

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