Skip to content

Commit 0056a7f

Browse files
Fenghua Yuvinodkoul
authored andcommitted
dmaengine: idxd: Allow ATS disable update only for configurable devices
ATS disable status in a WQ is read-only if the device is not configurable. This change ensures that the ATS disable attribute can be modified via sysfs only on configurable devices. Fixes: 92de5fa ("dmaengine: idxd: add ATS disable knob for work queues") 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 84b798f commit 0056a7f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/dma/idxd/sysfs.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,12 +1088,16 @@ static ssize_t wq_ats_disable_store(struct device *dev, struct device_attribute
10881088
const char *buf, size_t count)
10891089
{
10901090
struct idxd_wq *wq = confdev_to_wq(dev);
1091+
struct idxd_device *idxd = wq->idxd;
10911092
bool ats_dis;
10921093
int rc;
10931094

10941095
if (wq->state != IDXD_WQ_DISABLED)
10951096
return -EPERM;
10961097

1098+
if (!test_bit(IDXD_FLAG_CONFIGURABLE, &idxd->flags))
1099+
return -EPERM;
1100+
10971101
rc = kstrtobool(buf, &ats_dis);
10981102
if (rc < 0)
10991103
return rc;

0 commit comments

Comments
 (0)