aboutsummaryrefslogtreecommitdiff
path: root/drivers/misc/cxl/sysfs.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2018-07-05 11:05:54 +0100
committerMark Brown <broonie@kernel.org>2018-07-05 11:05:54 +0100
commit0ea97d66df2a8b85698823b4d55d798a7870d7b5 (patch)
treee4f36af1342ebcbcb5878e66b1e72661b6f2ca1d /drivers/misc/cxl/sysfs.c
parenteed41b9f413f40183095d27ffc94fb942fe18bb6 (diff)
parent6183a1afdd2fb1c994e95af9d6db45f157241a04 (diff)
Merge branch 'linux-linaro-lsk-v4.14' into linux-linaro-lsk-v4.14-rtlsk-v4.14-18.07-rt
Diffstat (limited to 'drivers/misc/cxl/sysfs.c')
-rw-r--r--drivers/misc/cxl/sysfs.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/misc/cxl/sysfs.c b/drivers/misc/cxl/sysfs.c
index a8b6d6a635e9..393a80bdb846 100644
--- a/drivers/misc/cxl/sysfs.c
+++ b/drivers/misc/cxl/sysfs.c
@@ -331,12 +331,20 @@ static ssize_t prefault_mode_store(struct device *device,
struct cxl_afu *afu = to_cxl_afu(device);
enum prefault_modes mode = -1;
- if (!strncmp(buf, "work_element_descriptor", 23))
- mode = CXL_PREFAULT_WED;
- if (!strncmp(buf, "all", 3))
- mode = CXL_PREFAULT_ALL;
if (!strncmp(buf, "none", 4))
mode = CXL_PREFAULT_NONE;
+ else {
+ if (!radix_enabled()) {
+
+ /* only allowed when not in radix mode */
+ if (!strncmp(buf, "work_element_descriptor", 23))
+ mode = CXL_PREFAULT_WED;
+ if (!strncmp(buf, "all", 3))
+ mode = CXL_PREFAULT_ALL;
+ } else {
+ dev_err(device, "Cannot prefault with radix enabled\n");
+ }
+ }
if (mode == -1)
return -EINVAL;