* [PATCH] dmaengine: idxd: add capability check for 'block on fault' attribute
@ 2021-08-03 22:32 Dave Jiang
2021-08-06 13:53 ` Vinod Koul
0 siblings, 1 reply; 2+ messages in thread
From: Dave Jiang @ 2021-08-03 22:32 UTC (permalink / raw)
To: vkoul; +Cc: dmaengine
The device general capability has a bit that indicate whether 'block on
fault' is supported. Add check to wq sysfs knob to check if cap exists
before allowing user to toggle.
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
---
drivers/dma/idxd/sysfs.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/dma/idxd/sysfs.c b/drivers/dma/idxd/sysfs.c
index 4c01587c9d4a..a88886d0f27b 100644
--- a/drivers/dma/idxd/sysfs.c
+++ b/drivers/dma/idxd/sysfs.c
@@ -642,6 +642,9 @@ static ssize_t wq_block_on_fault_store(struct device *dev,
bool bof;
int rc;
+ if (!idxd->hw.gen_cap.block_on_fault)
+ return -EOPNOTSUPP;
+
if (!test_bit(IDXD_FLAG_CONFIGURABLE, &idxd->flags))
return -EPERM;
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-08-06 13:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-03 22:32 [PATCH] dmaengine: idxd: add capability check for 'block on fault' attribute Dave Jiang
2021-08-06 13:53 ` Vinod Koul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox