* [U-Boot] [PATCH] usb: xhci-mem: Fix scratchpad array issue
@ 2019-01-04 9:56 Ye Li
2019-01-04 14:53 ` Marek Vasut
0 siblings, 1 reply; 2+ messages in thread
From: Ye Li @ 2019-01-04 9:56 UTC (permalink / raw)
To: u-boot
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 <ye.li@nxp.com>
---
drivers/usb/host/xhci-mem.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 04ab540..0f34522 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -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)
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [U-Boot] [PATCH] usb: xhci-mem: Fix scratchpad array issue
2019-01-04 9:56 [U-Boot] [PATCH] usb: xhci-mem: Fix scratchpad array issue Ye Li
@ 2019-01-04 14:53 ` Marek Vasut
0 siblings, 0 replies; 2+ messages in thread
From: Marek Vasut @ 2019-01-04 14:53 UTC (permalink / raw)
To: u-boot
On 1/4/19 10:56 AM, Ye Li wrote:
> 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 <ye.li@nxp.com>
> ---
> drivers/usb/host/xhci-mem.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
> index 04ab540..0f34522 100644
> --- a/drivers/usb/host/xhci-mem.c
> +++ b/drivers/usb/host/xhci-mem.c
> @@ -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.
> +
> page_size = xhci_readl(&hcor->or_pagesize) & 0xffff;
> for (i = 0; i < 16; i++) {
> if ((0x1 & page_size) != 0)
>
--
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-01-04 14:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-04 9:56 [U-Boot] [PATCH] usb: xhci-mem: Fix scratchpad array issue Ye Li
2019-01-04 14:53 ` Marek Vasut
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.