usb: xhci-mem: Fix scratchpad array issue
Subsystems (2)
PATCH 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.
Signed-off-by Ye Li <[email protected]>
--- drivers/usb/host/xhci-mem.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/host/xhci-mem.c +2 -0
@@ -369,6 +369,8 @@ 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 (__le64)); + 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 1/1 usb: xhci-mem: Fix scratchpad array issue
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]>--- drivers/usb/host/xhci-mem.c | 2 ++ 1 file changed, 2 insertions(+)drivers/usb/host/xhci-mem.c +0
-0
drivers/usb/host/xhci-mem.c static int xhci_scratchpad_alloc(struct xhci_ctrl *ctrl) · line 372
Quoted 4 lines
drivers/usb/host/xhci-mem.c +1
-0@@ -369,6 +369,8 @@ 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 (__le64));
Don't you want to use some sizeof(ctrl->dcbaa->dev_context_ptrs[0]) instead of sizeof(__le64) here ?
btw Bin, A-B/R-B please.
Quoted 5 lines
drivers/usb/host/xhci-mem.c +1
-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