Skip to content

Commit 8cae665

Browse files
Fenghua Yuvinodkoul
authored andcommitted
dmaengine: idxd: Fix issues with PRS disable sysfs knob
There are two issues in the current PRS disable sysfs store function wq_prs_disable_store(): 1. Since PRS disable knob is invisible if PRS disable is not supported in WQ, it's redundant to check PRS support again in the store function again. Remove the redundant PRS support check. 2. Since PRS disable is read-only when the device is not configurable, PRS disable cannot be changed on the device. Add device configurable check in the store function. Fixes: f2dc327 ("dmaengine: idxd: add per wq PRS disable") Signed-off-by: Fenghua Yu <[email protected]> Reviewed-by: Dave Jiang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 0056a7f commit 8cae665

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/dma/idxd/sysfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,8 +1131,8 @@ static ssize_t wq_prs_disable_store(struct device *dev, struct device_attribute
11311131
if (wq->state != IDXD_WQ_DISABLED)
11321132
return -EPERM;
11331133

1134-
if (!idxd->hw.wq_cap.wq_prs_support)
1135-
return -EOPNOTSUPP;
1134+
if (!test_bit(IDXD_FLAG_CONFIGURABLE, &idxd->flags))
1135+
return -EPERM;
11361136

11371137
rc = kstrtobool(buf, &prs_dis);
11381138
if (rc < 0)

0 commit comments

Comments
 (0)