From: Francesco Dolcini Date: Fri, 12 May 2023 13:14:34 +0000 (+0200) Subject: Revert "usb: gadget: udc: core: Prevent redundant calls to pullup" X-Git-Tag: baikal/aarch64/sdk6.2~180 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=b7f348e6efee9e61e77581178b737529e20b97a7;p=kernel.git Revert "usb: gadget: udc: core: Prevent redundant calls to pullup" commit 5e1617210aede9f1b91bb9819c93097b6da481f9 upstream. This reverts commit a3afbf5cc887fc3401f012fe629810998ed61859. This depends on commit 0db213ea8eed ("usb: gadget: udc: core: Invoke usb_gadget_connect only when started") that introduces a regression, revert it till the issue is fixed. Cc: stable@vger.kernel.org Reported-by: Stephan Gerhold Reported-by: Francesco Dolcini Link: https://lore.kernel.org/all/ZF4BvgsOyoKxdPFF@francesco-nb.int.toradex.com/ Signed-off-by: Francesco Dolcini Link: https://lore.kernel.org/r/20230512131435.205464-2-francesco@dolcini.it Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c index e85706812d61e..016d03e57a63d 100644 --- a/drivers/usb/gadget/udc/core.c +++ b/drivers/usb/gadget/udc/core.c @@ -676,9 +676,6 @@ static int usb_gadget_connect_locked(struct usb_gadget *gadget) goto out; } - if (gadget->connected) - goto out; - if (gadget->deactivated || !gadget->udc->started) { /* * If gadget is deactivated we only save new state.