* [PATCH 1/2] dmaengine: idxd: Allow ATS disable update only for configurable devices
@ 2023-08-11 1:26 Fenghua Yu
2023-08-11 1:26 ` [PATCH 2/2] dmaengine: idxd: Fix issues with PRS disable sysfs knob Fenghua Yu
2023-08-21 13:52 ` [PATCH 1/2] dmaengine: idxd: Allow ATS disable update only for configurable devices Vinod Koul
0 siblings, 2 replies; 3+ messages in thread
From: Fenghua Yu @ 2023-08-11 1:26 UTC (permalink / raw)
To: Vinod Koul, Dave Jiang; +Cc: dmaengine, linux-kernel, Fenghua Yu
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: 92de5fa2dc39 ("dmaengine: idxd: add ATS disable knob for work queues")
Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
---
Applied cleanly to
https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine next
drivers/dma/idxd/sysfs.c | 4 ++++
1 file changed, 4 insertions(+)
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;
--
2.37.1
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH 2/2] dmaengine: idxd: Fix issues with PRS disable sysfs knob
2023-08-11 1:26 [PATCH 1/2] dmaengine: idxd: Allow ATS disable update only for configurable devices Fenghua Yu
@ 2023-08-11 1:26 ` Fenghua Yu
2023-08-21 13:52 ` [PATCH 1/2] dmaengine: idxd: Allow ATS disable update only for configurable devices Vinod Koul
1 sibling, 0 replies; 3+ messages in thread
From: Fenghua Yu @ 2023-08-11 1:26 UTC (permalink / raw)
To: Vinod Koul, Dave Jiang; +Cc: dmaengine, linux-kernel, Fenghua Yu
There are two issues in the current PRS disable sysfs store function
wq_prs_disable_store():
1. Since PRS disable knob is invisible if PRS disable is not supported
in WQ, it's redundant to check PRS support again in the store function
again. Remove the redundant PRS support check.
2. Since PRS disable is read-only when the device is not configurable,
PRS disable cannot be changed on the device. Add device configurable
check in the store function.
Fixes: f2dc327131b5 ("dmaengine: idxd: add per wq PRS disable")
Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
---
Applied cleanly to
https://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine next
drivers/dma/idxd/sysfs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/dma/idxd/sysfs.c b/drivers/dma/idxd/sysfs.c
index 66c89b07b3f7..a5c3eb434832 100644
--- a/drivers/dma/idxd/sysfs.c
+++ b/drivers/dma/idxd/sysfs.c
@@ -1131,8 +1131,8 @@ static ssize_t wq_prs_disable_store(struct device *dev, struct device_attribute
if (wq->state != IDXD_WQ_DISABLED)
return -EPERM;
- if (!idxd->hw.wq_cap.wq_prs_support)
- return -EOPNOTSUPP;
+ if (!test_bit(IDXD_FLAG_CONFIGURABLE, &idxd->flags))
+ return -EPERM;
rc = kstrtobool(buf, &prs_dis);
if (rc < 0)
--
2.37.1
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH 1/2] dmaengine: idxd: Allow ATS disable update only for configurable devices
2023-08-11 1:26 [PATCH 1/2] dmaengine: idxd: Allow ATS disable update only for configurable devices Fenghua Yu
2023-08-11 1:26 ` [PATCH 2/2] dmaengine: idxd: Fix issues with PRS disable sysfs knob Fenghua Yu
@ 2023-08-21 13:52 ` Vinod Koul
1 sibling, 0 replies; 3+ messages in thread
From: Vinod Koul @ 2023-08-21 13:52 UTC (permalink / raw)
To: Dave Jiang, Fenghua Yu; +Cc: dmaengine, linux-kernel
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,
--
~Vinod
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-08-21 13:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-11 1:26 [PATCH 1/2] dmaengine: idxd: Allow ATS disable update only for configurable devices Fenghua Yu
2023-08-11 1:26 ` [PATCH 2/2] dmaengine: idxd: Fix issues with PRS disable sysfs knob Fenghua Yu
2023-08-21 13:52 ` [PATCH 1/2] dmaengine: idxd: Allow ATS disable update only for configurable devices Vinod Koul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®