Message ID | 20230811012635.535413-1-fenghua.yu@intel.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 0056a7f07b0a63e6cee815a789eabba6f3a710f0 |
Headers | show |
Series | [1/2] dmaengine: idxd: Allow ATS disable update only for configurable devices | expand |
On Thu, 10 Aug 2023 18:26:34 -0700, Fenghua Yu wrote: > 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. > > Applied, thanks! [1/2] dmaengine: idxd: Allow ATS disable update only for configurable devices commit: 0056a7f07b0a63e6cee815a789eabba6f3a710f0 [2/2] dmaengine: idxd: Fix issues with PRS disable sysfs knob commit: 8cae66574398326134a41513b419e00ad4e380ca Best regards,
diff --git a/drivers/dma/idxd/sysfs.c b/drivers/dma/idxd/sysfs.c index d16c16445c4f..66c89b07b3f7 100644 --- a/drivers/dma/idxd/sysfs.c +++ b/drivers/dma/idxd/sysfs.c @@ -1088,12 +1088,16 @@ static ssize_t wq_ats_disable_store(struct device *dev, struct device_attribute const char *buf, size_t count) { struct idxd_wq *wq = confdev_to_wq(dev); + struct idxd_device *idxd = wq->idxd; bool ats_dis; int rc; if (wq->state != IDXD_WQ_DISABLED) return -EPERM; + if (!test_bit(IDXD_FLAG_CONFIGURABLE, &idxd->flags)) + return -EPERM; + rc = kstrtobool(buf, &ats_dis); if (rc < 0) return rc;