dmaengine: idxd: Clear PRS disable flag when disabling IDXD device
authorFenghua Yu <fenghua.yu@intel.com>
Wed, 12 Jul 2023 19:35:05 +0000 (12:35 -0700)
committerVinod Koul <vkoul@kernel.org>
Sun, 6 Aug 2023 18:31:41 +0000 (00:01 +0530)
commit863676fe1ac1b82fc9eb56c242e80acfbfc18b76
treef184da3f3e67ea4d4786c9bd23c49a995ba341a0
parent8cda3ececf07d374774f6a13e5a94bc2dc04c26c
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")
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>
Link: https://lore.kernel.org/r/20230712193505.3440752-1-fenghua.yu@intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/idxd/device.c