提交 81c2f79c 编写于 作者: D Dave Jiang 提交者: Vinod Koul

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: NDave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/162802992615.3084999.12539468940404102898.stgit@djiang5-desk3.ch.intel.comSigned-off-by: NVinod Koul <vkoul@kernel.org>
上级 4153a7f6
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册