Skip to contentSkip to conversation

dmaengine: idxd: Clear PRS disable flag when disabling IDXD device

PATCH Applied Fenghua Yu 3 participants 3 messages Jul 12, 2023 – Aug 1, 2023

Subsystems (2)
lore
Share & tools
lore

Fenghua Yu

author
#0 lore raw

PATCH v3 1/1 dmaengine: idxd: Clear PRS disable flag when disabling IDXD device

Disabling IDXD device doesn't reset Page Request Service (PRS) disable flag to its initial value 0. This may cause user confusion because once PRS is disabled user will see PRS still remains the previous setting (i.e. disabled) via sysfs interface even after the device is disabled.

To eliminate user confusion, reset PRS disable flag to ensure that the PRS flag bit reflects correct state after the device is disabled.

Additionally, simplify the code by setting wq->flags to 0, which clears all flag bits, including any future additions.

Fixes f2dc327131b5 ("dmaengine: idxd: add per wq PRS disable")

---
v3:
- Add "Fixes" tag.
- Set wq->flags to 0.

v2:
- Fix Tony's email typo

 drivers/dma/idxd/device.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/dma/idxd/device.c +1 -3
index 5abbcc61c528..9a15f0d12c79 100644
@@ -384,9 +384,7 @@ static void idxd_wq_disable_cleanup(struct idxd_wq *wq)
 	wq->threshold = 0;
 	wq->priority = 0;
 	wq->enqcmds_retries = IDXD_ENQCMDS_RETRIES;
-	clear_bit(WQ_FLAG_DEDICATED, &wq->flags);
-	clear_bit(WQ_FLAG_BLOCK_ON_FAULT, &wq->flags);
-	clear_bit(WQ_FLAG_ATS_DISABLE, &wq->flags);
+	wq->flags = 0;
 	memset(wq->name, 0, WQ_NAME_SIZE);
 	wq->max_xfer_bytes = WQ_DEFAULT_MAX_XFER;
 	idxd_wq_set_max_batch_size(idxd->data->type, wq, WQ_DEFAULT_MAX_BATCH);
Signature · 1 line
2.37.1
reviewer Reviewed-by on v3 1/1
#1 lore raw
Quoted 9 lines · Fenghua Yu

Disabling IDXD device doesn't reset Page Request Service (PRS) disable flag to its initial value 0. This may cause user confusion because once PRS is disabled user will see PRS still remains the previous setting (i.e. disabled) via sysfs interface even after the device is disabled.

To eliminate user confusion, reset PRS disable flag to ensure that the PRS flag bit reflects correct state after the device is disabled.

Quoted 6 lines

Additionally, simplify the code by setting wq->flags to 0, which clears all flag bits, including any future additions.

Fixes f2dc327131b5 ("dmaengine: idxd: add per wq PRS disable")
Quoted 26 lines

---
v3:
- Add "Fixes" tag.
- Set wq->flags to 0.

v2:
- Fix Tony's email typo

  drivers/dma/idxd/device.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
drivers/dma/idxd/device.c +1 -3
index 5abbcc61c528..9a15f0d12c79 100644
@@ -384,9 +384,7 @@ static void idxd_wq_disable_cleanup(struct idxd_wq *wq)
  	wq->threshold = 0;
  	wq->priority = 0;
  	wq->enqcmds_retries = IDXD_ENQCMDS_RETRIES;
-	clear_bit(WQ_FLAG_DEDICATED, &wq->flags);
-	clear_bit(WQ_FLAG_BLOCK_ON_FAULT, &wq->flags);
-	clear_bit(WQ_FLAG_ATS_DISABLE, &wq->flags);
+	wq->flags = 0;
  	memset(wq->name, 0, WQ_NAME_SIZE);
  	wq->max_xfer_bytes = WQ_DEFAULT_MAX_XFER;
  	idxd_wq_set_max_batch_size(idxd->data->type, wq, WQ_DEFAULT_MAX_BATCH);
maintainer Applied
#2 lore raw
In reply to Fenghua Yu
Quoted 10 lines · Fenghua Yu

Disabling IDXD device doesn't reset Page Request Service (PRS) disable flag to its initial value 0. This may cause user confusion because once PRS is disabled user will see PRS still remains the previous setting (i.e. disabled) via sysfs interface even after the device is disabled.

To eliminate user confusion, reset PRS disable flag to ensure that the PRS flag bit reflects correct state after the device is disabled.

[...]

Applied, thanks!

[1/1] dmaengine: idxd: Clear PRS disable flag when disabling IDXD device

      commit: 830883a4bc012a118f3b74889292efa21799bc94

Best regards,

Signature · 1 line
~Vinod