Skip to content

Commit 62b41b6

Browse files
Fenghua Yuvinodkoul
authored andcommitted
dmaengine: idxd: Expose ATS disable knob only when WQ ATS is supported
WQ Advanced Translation Service (ATS) can be controlled only when WQ ATS is supported. The sysfs ATS disable knob should be visible only when the features is supported. Signed-off-by: Fenghua Yu <fenghua.yu@intel.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/20230712174436.3435088-2-fenghua.yu@intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent 97b1185 commit 62b41b6

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

drivers/dma/idxd/sysfs.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,16 +1088,12 @@ 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;
10921091
bool ats_dis;
10931092
int rc;
10941093

10951094
if (wq->state != IDXD_WQ_DISABLED)
10961095
return -EPERM;
10971096

1098-
if (!idxd->hw.wq_cap.wq_ats_support)
1099-
return -EOPNOTSUPP;
1100-
11011097
rc = kstrtobool(buf, &ats_dis);
11021098
if (rc < 0)
11031099
return rc;
@@ -1316,6 +1312,9 @@ static umode_t idxd_wq_attr_visible(struct kobject *kobj,
13161312
if (idxd_wq_attr_invisible(prs_disable, wq_prs_support, attr, idxd))
13171313
return 0;
13181314

1315+
if (idxd_wq_attr_invisible(ats_disable, wq_ats_support, attr, idxd))
1316+
return 0;
1317+
13191318
return attr->mode;
13201319
}
13211320

0 commit comments

Comments
 (0)