DMA Engine development
 help / color / mirror / Atom feed
* [PATCH v5 0/2] Some fixes for idxd driver
@ 2023-12-11  5:37 'Guanjun'
  2023-12-11  5:37 ` [PATCH v5 1/2] dmaengine: idxd: Protect int_handle field in hw descriptor 'Guanjun'
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: 'Guanjun' @ 2023-12-11  5:37 UTC (permalink / raw)
  To: dave.jiang, dmaengine, linux-kernel, vkoul, tony.luck, fenghua.yu
  Cc: jing.lin, ashok.raj, sanjay.k.kumar, megha.dey, jacob.jun.pan,
	yi.l.liu, tglx, guanjun

From: Guanjun <guanjun@linux.alibaba.com>

Hi Dave, Fenghua,
As we talked in v1 and v2, I add fixes tag in patch 0 and change some
descriptions in patch 1.

Hi Lijun,
According to your comments, I change the fix tag to commit
eb0cf33a91b4(dmaengine: idxd: move interrupt handle assignment)

Thanks,
Guanjun

Guanjun (2):
  dmaengine: idxd: Protect int_handle field in hw descriptor
  dmaengine: idxd: Fix incorrect descriptions for GRPCFG register

 drivers/dma/idxd/registers.h | 12 +++++++-----
 drivers/dma/idxd/submit.c    | 14 +++++++-------
 2 files changed, 14 insertions(+), 12 deletions(-)

-- 
2.39.3


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

* [PATCH v5 1/2] dmaengine: idxd: Protect int_handle field in hw descriptor
  2023-12-11  5:37 [PATCH v5 0/2] Some fixes for idxd driver 'Guanjun'
@ 2023-12-11  5:37 ` 'Guanjun'
  2023-12-11  5:37 ` [PATCH v5 2/2] dmaengine: idxd: Fix incorrect descriptions for GRPCFG register 'Guanjun'
  2023-12-11 15:03 ` [PATCH v5 0/2] Some fixes for idxd driver Vinod Koul
  2 siblings, 0 replies; 4+ messages in thread
From: 'Guanjun' @ 2023-12-11  5:37 UTC (permalink / raw)
  To: dave.jiang, dmaengine, linux-kernel, vkoul, tony.luck, fenghua.yu
  Cc: jing.lin, ashok.raj, sanjay.k.kumar, megha.dey, jacob.jun.pan,
	yi.l.liu, tglx, guanjun

From: Guanjun <guanjun@linux.alibaba.com>

The int_handle field in hw descriptor should also be protected
by wmb() before possibly triggering a DMA read.

Fixes: eb0cf33a91b4 (dmaengine: idxd: move interrupt handle assignment)
Signed-off-by: Guanjun <guanjun@linux.alibaba.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Fenghua Yu <fenghua.yu@intel.com>
Reviewed-by: Lijun Pan <lijun.pan@intel.com>
---
 drivers/dma/idxd/submit.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/dma/idxd/submit.c b/drivers/dma/idxd/submit.c
index c01db23e3333..3f922518e3a5 100644
--- a/drivers/dma/idxd/submit.c
+++ b/drivers/dma/idxd/submit.c
@@ -182,13 +182,6 @@ int idxd_submit_desc(struct idxd_wq *wq, struct idxd_desc *desc)
 
 	portal = idxd_wq_portal_addr(wq);
 
-	/*
-	 * The wmb() flushes writes to coherent DMA data before
-	 * possibly triggering a DMA read. The wmb() is necessary
-	 * even on UP because the recipient is a device.
-	 */
-	wmb();
-
 	/*
 	 * Pending the descriptor to the lockless list for the irq_entry
 	 * that we designated the descriptor to.
@@ -199,6 +192,13 @@ int idxd_submit_desc(struct idxd_wq *wq, struct idxd_desc *desc)
 		llist_add(&desc->llnode, &ie->pending_llist);
 	}
 
+	/*
+	 * The wmb() flushes writes to coherent DMA data before
+	 * possibly triggering a DMA read. The wmb() is necessary
+	 * even on UP because the recipient is a device.
+	 */
+	wmb();
+
 	if (wq_dedicated(wq)) {
 		iosubmit_cmds512(portal, desc->hw, 1);
 	} else {
-- 
2.39.3


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

* [PATCH v5 2/2] dmaengine: idxd: Fix incorrect descriptions for GRPCFG register
  2023-12-11  5:37 [PATCH v5 0/2] Some fixes for idxd driver 'Guanjun'
  2023-12-11  5:37 ` [PATCH v5 1/2] dmaengine: idxd: Protect int_handle field in hw descriptor 'Guanjun'
@ 2023-12-11  5:37 ` 'Guanjun'
  2023-12-11 15:03 ` [PATCH v5 0/2] Some fixes for idxd driver Vinod Koul
  2 siblings, 0 replies; 4+ messages in thread
From: 'Guanjun' @ 2023-12-11  5:37 UTC (permalink / raw)
  To: dave.jiang, dmaengine, linux-kernel, vkoul, tony.luck, fenghua.yu
  Cc: jing.lin, ashok.raj, sanjay.k.kumar, megha.dey, jacob.jun.pan,
	yi.l.liu, tglx, guanjun

From: Guanjun <guanjun@linux.alibaba.com>

Fix incorrect descriptions for the GRPCFG register which has three
sub-registers (GRPWQCFG, GRPENGCFG and GRPFLGCFG).
No functional changes

Signed-off-by: Guanjun <guanjun@linux.alibaba.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Fenghua Yu <fenghua.yu@intel.com>
Acked-by: Lijun Pan <lijun.pan@intel.com>
---
 drivers/dma/idxd/registers.h | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/dma/idxd/registers.h b/drivers/dma/idxd/registers.h
index 7b54a3939ea1..315c004f58e4 100644
--- a/drivers/dma/idxd/registers.h
+++ b/drivers/dma/idxd/registers.h
@@ -440,12 +440,14 @@ union wqcfg {
 /*
  * This macro calculates the offset into the GRPCFG register
  * idxd - struct idxd *
- * n - wq id
- * ofs - the index of the 32b dword for the config register
+ * n - group id
+ * ofs - the index of the 64b qword for the config register
  *
- * The WQCFG register block is divided into groups per each wq. The n index
- * allows us to move to the register group that's for that particular wq.
- * Each register is 32bits. The ofs gives us the number of register to access.
+ * The GRPCFG register block is divided into three sub-registers, which
+ * are GRPWQCFG, GRPENGCFG and GRPFLGCFG. The n index allows us to move
+ * to the register block that contains the three sub-registers.
+ * Each register block is 64bits. And the ofs gives us the offset
+ * within the GRPWQCFG register to access.
  */
 #define GRPWQCFG_OFFSET(idxd_dev, n, ofs) ((idxd_dev)->grpcfg_offset +\
 					   (n) * GRPCFG_SIZE + sizeof(u64) * (ofs))
-- 
2.39.3


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

* Re: [PATCH v5 0/2] Some fixes for idxd driver
  2023-12-11  5:37 [PATCH v5 0/2] Some fixes for idxd driver 'Guanjun'
  2023-12-11  5:37 ` [PATCH v5 1/2] dmaengine: idxd: Protect int_handle field in hw descriptor 'Guanjun'
  2023-12-11  5:37 ` [PATCH v5 2/2] dmaengine: idxd: Fix incorrect descriptions for GRPCFG register 'Guanjun'
@ 2023-12-11 15:03 ` Vinod Koul
  2 siblings, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2023-12-11 15:03 UTC (permalink / raw)
  To: dave.jiang, dmaengine, linux-kernel, tony.luck, fenghua.yu,
	'Guanjun'
  Cc: jing.lin, ashok.raj, sanjay.k.kumar, megha.dey, jacob.jun.pan,
	yi.l.liu, tglx


On Mon, 11 Dec 2023 13:37:02 +0800, 'Guanjun' wrote:
> As we talked in v1 and v2, I add fixes tag in patch 0 and change some
> descriptions in patch 1.
> 
> Hi Lijun,
> According to your comments, I change the fix tag to commit
> eb0cf33a91b4(dmaengine: idxd: move interrupt handle assignment)
> 
> [...]

Applied, thanks!

[1/2] dmaengine: idxd: Protect int_handle field in hw descriptor
      commit: 778dfacc903d4b1ef5b7a9726e3a36bc15913d29
[2/2] dmaengine: idxd: Fix incorrect descriptions for GRPCFG register
      commit: 0c154698a0fc32957d00c6009d5389e086dc8acf

Best regards,
-- 
~Vinod



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

end of thread, other threads:[~2023-12-11 15:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-11  5:37 [PATCH v5 0/2] Some fixes for idxd driver 'Guanjun'
2023-12-11  5:37 ` [PATCH v5 1/2] dmaengine: idxd: Protect int_handle field in hw descriptor 'Guanjun'
2023-12-11  5:37 ` [PATCH v5 2/2] dmaengine: idxd: Fix incorrect descriptions for GRPCFG register 'Guanjun'
2023-12-11 15:03 ` [PATCH v5 0/2] Some fixes for idxd driver Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox