dmaengine.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] dmaengine: idxd: Clear PRS disable flag when disabling IDXD device
@ 2023-07-12 19:35 Fenghua Yu
  2023-07-12 20:11 ` Dave Jiang
  2023-08-01 18:44 ` Vinod Koul
  0 siblings, 2 replies; 3+ messages in thread
From: Fenghua Yu @ 2023-07-12 19:35 UTC (permalink / raw)
  To: Vinod Koul, Dave Jiang; +Cc: dmaengine, linux-kernel, Fenghua Yu, Tony Zhu

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")
Tested-by: Tony Zhu <tony.zhu@intel.com>
Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
---
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(-)

diff --git a/drivers/dma/idxd/device.c b/drivers/dma/idxd/device.c
index 5abbcc61c528..9a15f0d12c79 100644
--- a/drivers/dma/idxd/device.c
+++ b/drivers/dma/idxd/device.c
@@ -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);
-- 
2.37.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] dmaengine: idxd: Clear PRS disable flag when disabling IDXD device
  2023-07-12 19:35 [PATCH v3] dmaengine: idxd: Clear PRS disable flag when disabling IDXD device Fenghua Yu
@ 2023-07-12 20:11 ` Dave Jiang
  2023-08-01 18:44 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Dave Jiang @ 2023-07-12 20:11 UTC (permalink / raw)
  To: Fenghua Yu, Vinod Koul; +Cc: dmaengine, linux-kernel, Tony Zhu



On 7/12/23 12:35, Fenghua Yu wrote:
> 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")
> Tested-by: Tony Zhu <tony.zhu@intel.com>
> Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>

Reviewed-by: Dave Jiang <dave.jiang@intel.com>
> ---
> 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(-)
> 
> diff --git a/drivers/dma/idxd/device.c b/drivers/dma/idxd/device.c
> index 5abbcc61c528..9a15f0d12c79 100644
> --- a/drivers/dma/idxd/device.c
> +++ b/drivers/dma/idxd/device.c
> @@ -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);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v3] dmaengine: idxd: Clear PRS disable flag when disabling IDXD device
  2023-07-12 19:35 [PATCH v3] dmaengine: idxd: Clear PRS disable flag when disabling IDXD device Fenghua Yu
  2023-07-12 20:11 ` Dave Jiang
@ 2023-08-01 18:44 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Vinod Koul @ 2023-08-01 18:44 UTC (permalink / raw)
  To: Dave Jiang, Fenghua Yu; +Cc: dmaengine, linux-kernel, Tony Zhu


On Wed, 12 Jul 2023 12:35:05 -0700, Fenghua Yu wrote:
> 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,
-- 
~Vinod



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-01 18:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-12 19:35 [PATCH v3] dmaengine: idxd: Clear PRS disable flag when disabling IDXD device Fenghua Yu
2023-07-12 20:11 ` Dave Jiang
2023-08-01 18:44 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).