diff mbox series

[ndctl,3/3] Documentation: add man page documentation for inject-poison

Message ID 20230220013714.22277-3-junhyeok.im@samsung.com
State New, archived
Headers show
Series [ndctl,1/3] libcxl: add memdev inject poison support | expand

Commit Message

Junhyeok Im Feb. 20, 2023, 1:37 a.m. UTC
From: Junhyeok Im <junhyeok.im@samsung.com>

Add man page documentation for inject-poison command in cxl,
also add the content of cxl_memdev_inject_poison in libcxl.

Signed-off-by: Junhyeok Im <junhyeok.im@samsung.com>
---
 Documentation/cxl/cxl-inject-poison.txt | 42 +++++++++++++++++++++++++
 Documentation/cxl/lib/libcxl.txt        |  4 +++
 Documentation/cxl/meson.build           |  1 +
 3 files changed, 47 insertions(+)
 create mode 100644 Documentation/cxl/cxl-inject-poison.txt
diff mbox series

Patch

diff --git a/Documentation/cxl/cxl-inject-poison.txt b/Documentation/cxl/cxl-inject-poison.txt
new file mode 100644
index 0000000..d438d33
--- /dev/null
+++ b/Documentation/cxl/cxl-inject-poison.txt
@@ -0,0 +1,42 @@ 
+// SPDX-License-Identifier: GPL-2.0
+
+cxl-inject-poison(1)
+====================
+
+NAME
+----
+cxl-inject-poison - send inject poison command to specified CXL memdev
+                    targeting given DPA.
+
+SYNOPSIS
+--------
+[verse]
+'cxl inject-poison <memdev> -a <dpa> [<options>]'
+
+DESCRIPTION
+-----------
+Add the <dpa> to the <memdev> poison list and the error source shall be set
+to an injected error. In addition, the device shall add an appropriate poison
+creation event to its internal Informational Event Log, update the Event Status
+register, and if configured, interrupt the host.
+
+OPTIONS
+-------
+<memory device>::
+        A 'memX' device name, or a memdev id number. Restrict the operation to
+        the specified memdev.
+
+-a::
+--address=::
+        Physical address of a CXL memdev to inject poison into.
+
+-S::
+--serial=::
+        Specify CXL memory device serial number(s) to filter the listing
+
+include::verbose-option.txt[]
+
+
+SEE ALSO
+--------
+CXL-2.0 8.2.9.5.4.2
diff --git a/Documentation/cxl/lib/libcxl.txt b/Documentation/cxl/lib/libcxl.txt
index f9af376..95f5662 100644
--- a/Documentation/cxl/lib/libcxl.txt
+++ b/Documentation/cxl/lib/libcxl.txt
@@ -132,6 +132,7 @@  int cxl_memdev_read_label(struct cxl_memdev *memdev, void *buf, size_t length,
 			  size_t offset);
 int cxl_memdev_write_label(struct cxl_memdev *memdev, void *buf, size_t length,
 			   size_t offset);
+int cxl_memdev_inject_poison(struct cxl_memdev *memdev, const char *address);
 struct cxl_cmd *cxl_cmd_new_get_partition(struct cxl_memdev *memdev);
 struct cxl_cmd *cxl_cmd_new_set_partition(struct cxl_memdev *memdev,
 					  unsigned long long volatile_size);
@@ -172,6 +173,9 @@  cxl_memdev{read,write,zero}_label() are helpers for marshaling multiple
 label access commands over an arbitrary extent of the device's label
 area.
 
+cxl_memdev_inject_poison supports injecting poison into a physical address
+on a specified CXL memory device.
+
 cxl_cmd_partition_set_mode() supports selecting NEXTBOOT or IMMEDIATE
 mode. When CXL_SETPART_IMMEDIATE mode is set, it is the caller’s
 responsibility to avoid immediate changes to partitioning when the
diff --git a/Documentation/cxl/meson.build b/Documentation/cxl/meson.build
index a6d77ab..a972467 100644
--- a/Documentation/cxl/meson.build
+++ b/Documentation/cxl/meson.build
@@ -46,6 +46,7 @@  cxl_manpages = [
   'cxl-enable-region.txt',
   'cxl-destroy-region.txt',
   'cxl-monitor.txt',
+  'cxl-inject-poison.txt',
 ]
 
 foreach man : cxl_manpages