dmaengine: idxd: add capability check for 'block on fault' attribute
commit 81c2f79c21
upstream.
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>
Link: https://lore.kernel.org/r/162802992615.3084999.12539468940404102898.stgit@djiang5-desk3.ch.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Chen Zhuo <sagazchen@tencent.com>
Signed-off-by: Xinghui Li <korantli@tencent.com>
This commit is contained in:
parent
bcb3e9a99a
commit
b0e8fb0d9f
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue