]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
cxl/memdev: Replace ENXIO with EBUSY for inject poison limit reached
authorAlison Schofield <alison.schofield@intel.com>
Sun, 7 Jul 2024 01:53:43 +0000 (18:53 -0700)
committerDave Jiang <dave.jiang@intel.com>
Thu, 11 Jul 2024 00:12:42 +0000 (17:12 -0700)
The CXL driver provides a debugfs interface offering users the
ability to inject and clear poison to a memdev. Once a user has
injected up to the devices limit further injection requests fail
with ENXIO until a clear poison is issued.

Users may not have device specs in hand or may want to intentionally
hit the limit and then clear. Replace the usual ENXIO return status
with EBUSY so users can recognize this failure.

Signed-off-by: Alison Schofield <alison.schofield@intel.com>
Tested-by: Xingtao Yao <yaoxt.fnst@fujitsu.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Davidlohr Bueso <dave@stgolabs.net>
Link: https://patch.msgid.link/825bd4c67fb55a4373c4182d999ad49d4e6b4fe7.1720316188.git.alison.schofield@intel.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Documentation/ABI/testing/debugfs-cxl
drivers/cxl/cxlmem.h

index c61f9b8139730cbe79466cfec81b82021ca26775..12488c14be64a089f2b8d9477fe8308e09da338b 100644 (file)
@@ -14,9 +14,10 @@ Description:
                event to its internal Informational Event log, updates the
                Event Status register, and if configured, interrupts the host.
                It is not an error to inject poison into an address that
-               already has poison present and no error is returned. The
-               inject_poison attribute is only visible for devices supporting
-               the capability.
+               already has poison present and no error is returned. If the
+               device returns 'Inject Poison Limit Reached' an -EBUSY error
+               is returned to the user. The inject_poison attribute is only
+               visible for devices supporting the capability.
 
 
 What:          /sys/kernel/debug/memX/clear_poison
index f55141c6d64ef74578909d0b47986094f3b47d95..40a465c37e0310afd77de8ff19c11cec0f9adaad 100644 (file)
@@ -161,7 +161,7 @@ struct cxl_mbox_cmd {
        C(FWRESET, -ENXIO, "FW failed to activate, needs cold reset"),          \
        C(HANDLE, -ENXIO, "one or more Event Record Handles were invalid"),     \
        C(PADDR, -EFAULT, "physical address specified is invalid"),             \
-       C(POISONLMT, -ENXIO, "poison injection limit has been reached"),        \
+       C(POISONLMT, -EBUSY, "poison injection limit has been reached"),        \
        C(MEDIAFAILURE, -ENXIO, "permanent issue with the media"),              \
        C(ABORT, -ENXIO, "background cmd was aborted by device"),               \
        C(SECURITY, -ENXIO, "not valid in the current security state"),         \