MA-15300-4 flush fastboot usb request buf cache before data movement
authorfaqiang.zhu <faqiang.zhu@nxp.com>
Mon, 13 Jan 2020 10:36:58 +0000 (18:36 +0800)
committerYe Li <ye.li@nxp.com>
Thu, 29 Apr 2021 07:56:36 +0000 (00:56 -0700)
when boot from A72, use fastboot to download images, the first usb
request buf to save image data may have problem with the cache, which
cause the last 64bytes of this packet to be wrong.

flush this cache before data movement to avoid this issue.

Change-Id: Ic0927f1ec90ec9fb4cecdf4055bc7f536ef5471a
Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
(cherry picked from commit 45119132756b951c6f52e27625c06f94e4f0db59)
(cherry picked from commit 467f1d9f0c133438500d1c151c52276152bf36bf)

drivers/usb/cdns3/gadget.c

index 839decd..0648957 100644 (file)
@@ -816,6 +816,7 @@ static int cdns_check_ep_interrupt_proceed(struct usb_ss_endpoint *usb_ss_ep)
                /* get just completed request */
                request = next_request(&usb_ss_ep->request_list);
                ep_dir = usb_ss_ep->endpoint.desc->bEndpointAddress;
+               cdns_flush_cache((uintptr_t)request->dma, request->length);
                usb_gadget_unmap_request(&usb_ss->gadget, request,
                                         ep_dir & ENDPOINT_DIR_MASK);