summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorqianfan Zhao <qianfanguijin@163.com>2021-11-16 08:30:12 +0800
committerTom Rini <trini@konsulko.com>2022-01-17 14:45:24 -0500
commitea9733ac4c268cc862ec1e414f066f192348ef5a (patch)
tree24da768e89fd2c59c10a8421282159bd9fb92599 /drivers/usb
parent429866e84559f7019f176c6c084392ec8dfd128c (diff)
downloadu-boot-ea9733ac4c268cc862ec1e414f066f192348ef5a.tar.gz
u-boot-ea9733ac4c268cc862ec1e414f066f192348ef5a.tar.bz2
u-boot-ea9733ac4c268cc862ec1e414f066f192348ef5a.zip
drivers: musb_gadget: Save endpoint desc to usb_ep->desc
Fix fastboot flash bug. If the downloading file size is equal to the partition size, "fastboot flash" can't work, at least in sunxi platform, because used an uninitalized point: ep->desc. This patch also fixed 'data abort' bug in am335x platform. Reproduce: fastboot flash loader1 spl/sunxi-spl.bin. Signed-off-by: qianfan Zhao <qianfanguijin@163.com> Reviewed-by: Sean Anderson <seanga2@gmail.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/musb-new/musb_gadget.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/usb/musb-new/musb_gadget.c b/drivers/usb/musb-new/musb_gadget.c
index 1fef00b292..7cca92b970 100644
--- a/drivers/usb/musb-new/musb_gadget.c
+++ b/drivers/usb/musb-new/musb_gadget.c
@@ -1188,6 +1188,7 @@ static int musb_gadget_enable(struct usb_ep *ep,
} else
musb_ep->dma = NULL;
+ musb_ep->end_point.desc = desc;
musb_ep->desc = desc;
musb_ep->busy = 0;
musb_ep->wedged = 0;
@@ -1245,9 +1246,7 @@ static int musb_gadget_disable(struct usb_ep *ep)
}
musb_ep->desc = NULL;
-#ifndef __UBOOT__
musb_ep->end_point.desc = NULL;
-#endif
/* abort all pending DMA and requests */
nuke(musb_ep, -ESHUTDOWN);