Skip to content

Commit 81c2f79

Browse files
davejiangvinodkoul
authored andcommitted
dmaengine: idxd: add capability check for 'block on fault' attribute
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 <[email protected]> Link: https://lore.kernel.org/r/162802992615.3084999.12539468940404102898.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul <[email protected]>
1 parent 4153a7f commit 81c2f79

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/dma/idxd/sysfs.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,9 @@ static ssize_t wq_block_on_fault_store(struct device *dev,
642642
bool bof;
643643
int rc;
644644

645+
if (!idxd->hw.gen_cap.block_on_fault)
646+
return -EOPNOTSUPP;
647+
645648
if (!test_bit(IDXD_FLAG_CONFIGURABLE, &idxd->flags))
646649
return -EPERM;
647650

0 commit comments

Comments
 (0)