This is a note to let you know that I've just added the patch titled usb: gadget: udc: core: Prevent redundant calls to pullup to the 6.3-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: usb-gadget-udc-core-prevent-redundant-calls-to-pullup.patch and it can be found in the queue-6.3 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From a3afbf5cc887fc3401f012fe629810998ed61859 Mon Sep 17 00:00:00 2001 From: Badhri Jagan Sridharan <badhri@xxxxxxxxxx> Date: Fri, 7 Apr 2023 03:07:41 +0000 Subject: usb: gadget: udc: core: Prevent redundant calls to pullup From: Badhri Jagan Sridharan <badhri@xxxxxxxxxx> commit a3afbf5cc887fc3401f012fe629810998ed61859 upstream. usb_gadget_connect calls gadget->ops->pullup without checking whether gadget->connected was previously set. Make this symmetric to usb_gadget_disconnect by returning early if gadget->connected is already set. Fixes: 5a1da544e572 ("usb: gadget: core: do not try to disconnect gadget if it is not connected") Cc: stable@xxxxxxxxxxxxxxx Signed-off-by: Badhri Jagan Sridharan <badhri@xxxxxxxxxx> Link: https://lore.kernel.org/r/20230407030741.3163220-2-badhri@xxxxxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/usb/gadget/udc/core.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/usb/gadget/udc/core.c +++ b/drivers/usb/gadget/udc/core.c @@ -676,6 +676,9 @@ static int usb_gadget_connect_locked(str goto out; } + if (gadget->connected) + goto out; + if (gadget->deactivated || !gadget->udc->started) { /* * If gadget is deactivated we only save new state. Patches currently in stable-queue which might be from badhri@xxxxxxxxxx are queue-6.3/usb-gadget-udc-core-invoke-usb_gadget_connect-only-when-started.patch queue-6.3/usb-gadget-udc-core-prevent-redundant-calls-to-pullup.patch