From 54d3977b8b12a312b6259574bbb0fda50bed81a0 Mon Sep 17 00:00:00 2001 From: Gary Bisson Date: Thu, 6 Jan 2022 16:02:08 +0100 Subject: [PATCH] usb: gadget: dwc2_udc_otg: set ep's desc during enable/disable Fastboot support has been broken on platforms using dwc2 controller since the gadget gets its max packet size from it. This patch is the equivalent of 76d10b73415 which fixed the same issue but for the chipidea controller. Fixes: cc6e77f5791 ("usb: gadget: fastboot: use correct max packet size") Signed-off-by: Gary Bisson Reviewed-by: Neil Armstrong Tested-by: Mattijs Korpershoek --- drivers/usb/gadget/dwc2_udc_otg.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/gadget/dwc2_udc_otg.c b/drivers/usb/gadget/dwc2_udc_otg.c index 2f31814442..fb10884755 100644 --- a/drivers/usb/gadget/dwc2_udc_otg.c +++ b/drivers/usb/gadget/dwc2_udc_otg.c @@ -655,6 +655,7 @@ static int dwc2_ep_enable(struct usb_ep *_ep, return -ESHUTDOWN; } + _ep->desc = desc; ep->stopped = 0; ep->desc = desc; ep->pio_irqs = 0; @@ -695,6 +696,7 @@ static int dwc2_ep_disable(struct usb_ep *_ep) /* Nuke all pending requests */ nuke(ep, -ESHUTDOWN); + _ep->desc = NULL; ep->desc = 0; ep->stopped = 1; -- 2.39.5