diff options
author | Dave Jiang <dave.jiang@intel.com> | 2021-08-03 15:32:06 -0700 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2021-08-06 19:23:05 +0530 |
commit | 81c2f79c2104c5b48f01da674bc2f7d4bc600db4 (patch) | |
tree | 10bb62f8701a38e333e751dea6ed96625b053996 /drivers/dma/idxd | |
parent | 4153a7f6440f46261a3004009eaa914914f08055 (diff) |
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 <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>
Diffstat (limited to 'drivers/dma/idxd')
-rw-r--r-- | drivers/dma/idxd/sysfs.c | 3 |
1 files changed, 3 insertions, 0 deletions
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; |