Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Fenghua Yu and committed by
Vinod Koul
62b41b65 97b1185f

+3 -4
+3 -4
drivers/dma/idxd/sysfs.c
··· 1088 1088 const char *buf, size_t count) 1089 1089 { 1090 1090 struct idxd_wq *wq = confdev_to_wq(dev); 1091 - struct idxd_device *idxd = wq->idxd; 1092 1091 bool ats_dis; 1093 1092 int rc; 1094 1093 1095 1094 if (wq->state != IDXD_WQ_DISABLED) 1096 1095 return -EPERM; 1097 - 1098 - if (!idxd->hw.wq_cap.wq_ats_support) 1099 - return -EOPNOTSUPP; 1100 1096 1101 1097 rc = kstrtobool(buf, &ats_dis); 1102 1098 if (rc < 0) ··· 1310 1314 return 0; 1311 1315 1312 1316 if (idxd_wq_attr_invisible(prs_disable, wq_prs_support, attr, idxd)) 1317 + return 0; 1318 + 1319 + if (idxd_wq_attr_invisible(ats_disable, wq_ats_support, attr, idxd)) 1313 1320 return 0; 1314 1321 1315 1322 return attr->mode;