Skip to content

Commit 591209c

Browse files
AlisonSchofielddavejiang
authored andcommitted
cxl/memdev: Replace ENXIO with EBUSY for inject poison limit reached
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>
1 parent bebfbba commit 591209c

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Documentation/ABI/testing/debugfs-cxl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ Description:
1414
event to its internal Informational Event log, updates the
1515
Event Status register, and if configured, interrupts the host.
1616
It is not an error to inject poison into an address that
17-
already has poison present and no error is returned. The
18-
inject_poison attribute is only visible for devices supporting
19-
the capability.
17+
already has poison present and no error is returned. If the
18+
device returns 'Inject Poison Limit Reached' an -EBUSY error
19+
is returned to the user. The inject_poison attribute is only
20+
visible for devices supporting the capability.
2021

2122

2223
What: /sys/kernel/debug/memX/clear_poison

drivers/cxl/cxlmem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ struct cxl_mbox_cmd {
161161
C(FWRESET, -ENXIO, "FW failed to activate, needs cold reset"), \
162162
C(HANDLE, -ENXIO, "one or more Event Record Handles were invalid"), \
163163
C(PADDR, -EFAULT, "physical address specified is invalid"), \
164-
C(POISONLMT, -ENXIO, "poison injection limit has been reached"), \
164+
C(POISONLMT, -EBUSY, "poison injection limit has been reached"), \
165165
C(MEDIAFAILURE, -ENXIO, "permanent issue with the media"), \
166166
C(ABORT, -ENXIO, "background cmd was aborted by device"), \
167167
C(SECURITY, -ENXIO, "not valid in the current security state"), \

0 commit comments

Comments
 (0)