dmaengine: idxd: Allow ATS disable update only for configurable devices
[linux-2.6-microblaze.git] / drivers / dma / idxd / sysfs.c
index d16c164..66c89b0 100644 (file)
@@ -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;