Some fixes for idxd driver
Subsystems (2)
cover Some fixes for idxd driver
From: Guanjun <[email protected]>
This two patches fix the some issues for idxd driver. Please help to review.
Thanks,
Guanjun
Guanjun (2):
dmaengine: idxd: Protect int_handle field in hw descriptor
dmaengine: idxd: Fix the incorrect descriptions
drivers/dma/idxd/registers.h | 13 ++++++++----- drivers/dma/idxd/submit.c | 14 +++++++------- 2 files changed, 15 insertions(+), 12 deletions(-)
Signature · 1 line
2.39.3
PATCH 1/2 dmaengine: idxd: Protect int_handle field in hw descriptor
From: Guanjun <[email protected]>
The int_handle field in hw descriptor should also be protected by wmb() before possibly triggering a DMA read.
--- drivers/dma/idxd/submit.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/dma/idxd/submit.c +7 -7
@@ -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 {
Signature · 1 line
2.39.3
Re: [PATCH v1 1/2] dmaengine: idxd: Protect int_handle field in hw descriptor
Quoted 6 lines · Guanjun
From: Guanjun <[email protected]>
The
int_handlefield in hw descriptor should also be protected bywmb()before possibly triggering a DMA read.Signed-off-by Guanjun <[email protected]>
Can you please provide a Fix tag? Otherwise
Quoted 36 lines
--- drivers/dma/idxd/submit.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)drivers/dma/idxd/submit.c +7
-7@@ -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 {
Re: [PATCH v1 1/2] dmaengine: idxd: Protect int_handle field in hw descriptor
In reply to 'Guanjun'Quoted 6 lines · Guanjun
From: Guanjun <[email protected]>
The
int_handlefield in hw descriptor should also be protected bywmb()before possibly triggering a DMA read.Signed-off-by Guanjun <[email protected]>
As Dave said, need to add fixes tag.
Thanks.
-Fenghua Yu
PATCH 2/2 dmaengine: idxd: Fix the incorrect descriptions
In reply to 'Guanjun'From: Guanjun <[email protected]>
Fix the incorrect descriptions for the GRPCFG register. No functional changes
--- drivers/dma/idxd/registers.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/dma/idxd/registers.h +8 -5
@@ -440,12 +440,15 @@ 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 different types, that +* includes GRPWQCFG, GRPENGCFG and GRPFLGCFG. The n index in each group +* allows us to move to the register group that's for that particular wq, +* engine or group flag. +* Each register is 64bits. And the ofs in GRPWQCFG gives us the number +* of register to access. */ #define GRPWQCFG_OFFSET (idxd_dev, n, ofs) ((idxd_dev)->grpcfg_offset +\ (n) * GRPCFG_SIZE + sizeof(u64) * (ofs))
Signature · 1 line
2.39.3
Re: [PATCH v1 2/2] dmaengine: idxd: Fix the incorrect descriptions
Quoted 6 lines · Guanjun
From: Guanjun <[email protected]>
Fix the incorrect descriptions for the GRPCFG register. No functional changes
Signed-off-by Guanjun <[email protected]>
Thanks!
Quoted 29 lines
--- drivers/dma/idxd/registers.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)drivers/dma/idxd/registers.h +8
-5@@ -440,12 +440,15 @@ 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 different types, that +* includes GRPWQCFG, GRPENGCFG and GRPFLGCFG. The n index in each group +* allows us to move to the register group that's for that particular wq, +* engine or group flag. +* Each register is 64bits. And the ofs in GRPWQCFG gives us the number +* of register to access. */ #define GRPWQCFG_OFFSET (idxd_dev, n, ofs) ((idxd_dev)->grpcfg_offset +\ (n) * GRPCFG_SIZE + sizeof(u64) * (ofs))
Re: [PATCH v1 2/2] dmaengine: idxd: Fix the incorrect descriptions
In reply to 'Guanjun'Hi, Guanjun,
Quoted 2 lines · Guanjun
From: Guanjun <[email protected]>
The subject may be changed to:
dmaengine: idxd: Fix incorrect descriptions for GRPWQCFG_OFFSET
Quoted 15 lines
Fix the incorrect descriptions for the GRPCFG register. No functional changes
Signed-off-by Guanjun <[email protected]>--- drivers/dma/idxd/registers.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)drivers/dma/idxd/registers.h +0
-0@@ -440,12 +440,15 @@ union wqcfg {/* * This macro calculates the offset into the GRPCFG register
drivers/dma/idxd/registers.h union wqcfg { · line 446
Quoted 10 lines
drivers/dma/idxd/registers.h +3
-5* 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 different types, that
s/different types/sub-registers/
drivers/dma/idxd/registers.h union wqcfg { · line 447
Quoted 1 line
drivers/dma/idxd/registers.h +1
-0+* includes GRPWQCFG, GRPENGCFG and GRPFLGCFG. The n index in each group
s/that includes/which are/
drivers/dma/idxd/registers.h union wqcfg { · line 449
Quoted 2 lines
drivers/dma/idxd/registers.h +2
-0+* allows us to move to the register group that's for that particular wq, +* engine or group flag.
s/that particular wq, engine or group flag./that contains the three sub-registers/
drivers/dma/idxd/registers.h union wqcfg { · line 451
Quoted 2 lines
drivers/dma/idxd/registers.h +2
-0+* Each register is 64bits. And the ofs in GRPWQCFG gives us the number +* of register to access.
s/the number of register to access/the offset within the GRPCFG register to access/
drivers/dma/idxd/registers.h union wqcfg { · line 454
Quoted 3 lines
drivers/dma/idxd/registers.h +0
-0*/ #define GRPWQCFG_OFFSET (idxd_dev, n, ofs) ((idxd_dev)->grpcfg_offset +\ (n) * GRPCFG_SIZE + sizeof(u64) * (ofs))
Thanks.
-Fenghua