usb: xhci-mem: Fix scratchpad array issue
Subsystems (2)
PATCH v2 1/1 usb: xhci-mem: Fix scratchpad array issue
After updating the value of dev_context_ptrs[0], we should flush this from cache to memory. Otherwise the xhci controller won't use it.
---
Changes for v2:
- Change to use sizeof(ctrl->dcbaa->dev_context_ptrs[0])
drivers/usb/host/xhci-mem.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/usb/host/xhci-mem.c +3 -0
@@ -369,6 +369,9 @@ static int xhci_scratchpad_alloc(struct xhci_ctrl *ctrl) ctrl->dcbaa->dev_context_ptrs[0 ] =cpu_to_le64 ((uintptr_t )scratchpad->sp_array); +xhci_flush_cache ((uintptr_t )&ctrl->dcbaa->dev_context_ptrs[0 ], +sizeof (ctrl->dcbaa->dev_context_ptrs[0 ])); + page_size =xhci_readl (&hcor->or_pagesize) &0xffff ;for (i =0 ; i <16 ; i++) {if ((0x1 & page_size) !=0 )
Signature · 1 line
2.7.4
PATCH v2 1/1 usb: xhci-mem: Fix scratchpad array issue
Quoted 5 lines · Ye Li
After updating the value of dev_context_ptrs[0], we should flush this from cache to memory. Otherwise the xhci controller won't use it.
Signed-off-by Ye Li <[email protected]>Reviewed-by Marek Vasut <[email protected]>
Looks good to me, waiting for A-B/R-B from Bin.
Quoted 22 lines
---
Changes for v2:
- Change to usesizeof(ctrl->dcbaa->dev_context_ptrs[0])drivers/usb/host/xhci-mem.c | 3 +++ 1 file changed, 3 insertions(+)drivers/usb/host/xhci-mem.c +3
-0@@ -369,6 +369,9 @@ static int xhci_scratchpad_alloc(struct xhci_ctrl *ctrl) ctrl->dcbaa->dev_context_ptrs[0 ] =cpu_to_le64 ((uintptr_t )scratchpad->sp_array); +xhci_flush_cache ((uintptr_t )&ctrl->dcbaa->dev_context_ptrs[0 ], +sizeof (ctrl->dcbaa->dev_context_ptrs[0 ])); + page_size =xhci_readl (&hcor->or_pagesize) &0xffff ;for (i =0 ; i <16 ; i++) {if ((0x1 & page_size) !=0 )
Signature · 2 lines
Best regards, Marek Vasut
PATCH v2 1/1 usb: xhci-mem: Fix scratchpad array issue
In reply to Ye LiQuoted 4 lines · Ye Li
After updating the value of dev_context_ptrs[0], we should flush this from cache to memory. Otherwise the xhci controller won't use it.
Quoted 9 lines
Signed-off-by Ye Li <[email protected]>Reviewed-by Marek Vasut <[email protected]>---
Changes for v2:
- Change to usesizeof(ctrl->dcbaa->dev_context_ptrs[0])drivers/usb/host/xhci-mem.c | 3 +++ 1 file changed, 3 insertions(+)
But you need do the same in xhci_scratchpad_free() too. Please fix it in v3.
Regards,
Bin
PATCH v2 1/1 usb: xhci-mem: Fix scratchpad array issue
Quoted 15 lines · Bin Meng
Quoted 4 lines · Ye Li
After updating the value of dev_context_ptrs[0], we should flush this from cache to memory. Otherwise the xhci controller won't use it.
Quoted 9 lines
Signed-off-by Ye Li <[email protected]>Reviewed-by Marek Vasut <[email protected]>---
Changes for v2:
- Change to usesizeof(ctrl->dcbaa->dev_context_ptrs[0])drivers/usb/host/xhci-mem.c | 3 +++ 1 file changed, 3 insertions(+)
Quoted 7 lines
Reviewed-by Bin Meng <[email protected]>But you need do the same in
xhci_scratchpad_free()too. Please fix it in v3.Regards,
Bin
The xhci controller has been stopped before calling xhci_scratchpad_free, is it necessary to add flush in this function? And I don't see other buffers are flushed when freeing.
Best regards,
Ye Li
PATCH v2 1/1 usb: xhci-mem: Fix scratchpad array issue
Quoted 17 lines · Ye Li
Quoted 15 lines · Bin Meng
Quoted 13 lines · Ye Li
After updating the value of dev_context_ptrs[0], we should flush this from cache to memory. Otherwise the xhci controller won't use it.
Signed-off-by Ye Li <[email protected]>Reviewed-by Marek Vasut <[email protected]>---
Changes for v2:
- Change to usesizeof(ctrl->dcbaa->dev_context_ptrs[0])drivers/usb/host/xhci-mem.c | 3 +++ 1 file changed, 3 insertions(+)
Quoted 7 lines
Quoted 4 lines
Reviewed-by Bin Meng <[email protected]>But you need do the same in
xhci_scratchpad_free()too. Please fix it in v3.The xhci controller has been stopped before calling
xhci_scratchpad_free, is it necessary to add flush in this function? And I don't see other buffers are flushed when freeing.
Ah, yes. It's called after HCD reset, so that's not needed.
Regards,
Bin
PATCH v2 1/1 usb: xhci-mem: Fix scratchpad array issue
Quoted 20 lines · Bin Meng
Quoted 19 lines · Ye Li
Quoted 17 lines · Bin Meng
Quoted 4 lines · Ye Li
After updating the value of dev_context_ptrs[0], we should flush this from cache to memory. Otherwise the xhci controller won't use it.
Quoted 9 lines
Signed-off-by Ye Li <[email protected]>Reviewed-by Marek Vasut <[email protected]>---
Changes for v2:
- Change to usesizeof(ctrl->dcbaa->dev_context_ptrs[0])drivers/usb/host/xhci-mem.c | 3 +++ 1 file changed, 3 insertions(+)Reviewed-by Bin Meng <[email protected]>
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
But you need do the same in
xhci_scratchpad_free()too. Please fix it in v3.The xhci controller has been stopped before calling
xhci_scratchpad_free, is it necessary to add flush in this function? And I don't see other buffers are flushed when freeing.Ah, yes. It's called after HCD reset, so that's not needed.
Shall I pick this for this release then, Bin ?
Signature · 2 lines
Best regards, Marek Vasut
PATCH v2 1/1 usb: xhci-mem: Fix scratchpad array issue
Quoted 24 lines · Marek Vasut
Quoted 22 lines · Bin Meng
Quoted 21 lines · Ye Li
Quoted 19 lines · Bin Meng
Quoted 4 lines · Ye Li
After updating the value of dev_context_ptrs[0], we should flush this from cache to memory. Otherwise the xhci controller won't use it.
Quoted 9 lines
Signed-off-by Ye Li <[email protected]>Reviewed-by Marek Vasut <[email protected]>---
Changes for v2:
- Change to usesizeof(ctrl->dcbaa->dev_context_ptrs[0])drivers/usb/host/xhci-mem.c | 3 +++ 1 file changed, 3 insertions(+)Reviewed-by Bin Meng <[email protected]>But you need do the same in
xhci_scratchpad_free()too. Please fix it in v3.
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
The xhci controller has been stopped before calling
xhci_scratchpad_free, is it necessary to add flush in this function? And I don't see other buffers are flushed when freeing.Ah, yes. It's called after HCD reset, so that's not needed.
Shall I pick this for this release then, Bin ?
Yes, I think so.
Regards,
Bin
Marek Vasut
AppliedPATCH v2 1/1 usb: xhci-mem: Fix scratchpad array issue
Quoted 29 lines · Bin Meng
Quoted 28 lines · Marek Vasut
Quoted 26 lines · Bin Meng
Quoted 24 lines · Ye Li
Quoted 11 lines · Bin Meng
Quoted 10 lines · Ye Li
After updating the value of dev_context_ptrs[0], we should flush this from cache to memory. Otherwise the xhci controller won't use it.
Signed-off-by Ye Li <[email protected]>Reviewed-by Marek Vasut <[email protected]>---
Changes for v2:
- Change to usesizeof(ctrl->dcbaa->dev_context_ptrs[0])Quoted 8 lines
Quoted 3 lines
drivers/usb/host/xhci-mem.c | 3 +++ 1 file changed, 3 insertions(+)Reviewed-by Bin Meng <[email protected]>But you need do the same in
xhci_scratchpad_free()too. Please fix it in v3.The xhci controller has been stopped before calling
xhci_scratchpad_free, is it necessary to add flush in this function? And I don't see other buffers are flushed when freeing.
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Ah, yes. It's called after HCD reset, so that's not needed.
Shall I pick this for this release then, Bin ?
Yes, I think so.
Applied, thanks.
Signature · 2 lines
Best regards, Marek Vasut