Skip to contentSkip to conversation

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

PATCH Superseded Fenghua Yu 2 participants 3 messages Jul 12, 2023

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Fenghua Yu

author
#0 lore raw

PATCH v2 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 the confusion, reset PRS disable flag when the device is disabled.

---
v2:
- Fix Tony's email typo

 drivers/dma/idxd/device.c | 1 +
 1 file changed, 1 insertion(+)
drivers/dma/idxd/device.c +1 -0
index 5abbcc61c528..71dfb2c13066 100644
@@ -387,6 +387,7 @@ static void idxd_wq_disable_cleanup(struct idxd_wq *wq)
 	clear_bit(WQ_FLAG_DEDICATED, &wq->flags);
 	clear_bit(WQ_FLAG_BLOCK_ON_FAULT, &wq->flags);
 	clear_bit(WQ_FLAG_ATS_DISABLE, &wq->flags);
+	clear_bit(WQ_FLAG_PRS_DISABLE, &wq->flags);
 	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
#1 lore raw
Quoted 11 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 the confusion, reset PRS disable flag when the device is disabled.

Should there be a Fixes tag?

Quoted 12 lines

---
v2:
- Fix Tony's email typo

  drivers/dma/idxd/device.c | 1 +
  1 file changed, 1 insertion(+)
drivers/dma/idxd/device.c +0 -0
index 5abbcc61c528..71dfb2c13066 100644

drivers/dma/idxd/device.c static void idxd_wq_disable_cleanup(struct idxd_wq *wq) · line 390

Quoted 4 lines
drivers/dma/idxd/device.c +1 -0
@@ -387,6 +387,7 @@ static void idxd_wq_disable_cleanup(struct idxd_wq *wq)
  	clear_bit(WQ_FLAG_DEDICATED, &wq->flags);
  	clear_bit(WQ_FLAG_BLOCK_ON_FAULT, &wq->flags);
  	clear_bit(WQ_FLAG_ATS_DISABLE, &wq->flags);
+	clear_bit(WQ_FLAG_PRS_DISABLE, &wq->flags);

I wonder if it's better if we just do wq->flags = 0? I don't see any bits we need to preserve. Do you?

Quoted 3 lines
drivers/dma/idxd/device.c +0 -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);
author
#2 lore raw

Hi, Dave,

Quoted 9 lines · Dave Jiang
Quoted 6 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.

Quoted 7 lines
Quoted 5 lines

To eliminate the confusion, reset PRS disable flag when the device is disabled.

Should there be a Fixes tag?

Will add a Fixes tag.

Quoted 7 lines
Quoted 7 lines

---
v2:
- Fix Tony's email typo

  drivers/dma/idxd/device.c | 1 +

  1 file changed, 1 insertion(+)
Quoted 12 lines

drivers/dma/idxd/device.c static void idxd_wq_disable_cleanup(struct idxd_wq · line 391

Quoted 10 lines
drivers/dma/idxd/device.c +1 -0
index 5abbcc61c528..71dfb2c13066 100644
@@ -387,6 +387,7 @@ static void idxd_wq_disable_cleanup(struct idxd_wq 
 *wq)
       clear_bit(WQ_FLAG_DEDICATED, &wq->flags);
       clear_bit(WQ_FLAG_BLOCK_ON_FAULT, &wq->flags);
       clear_bit(WQ_FLAG_ATS_DISABLE, &wq->flags);
+    clear_bit(WQ_FLAG_PRS_DISABLE, &wq->flags);

I wonder if it's better if we just do wq->flags = 0? I don't see any bits we need to preserve. Do you?

wq->flags = 0 is better.

Thanks.

-Fenghua