Re: [PATCH] usb: musb: fix gadget state on disconnect

From: Greg Kroah-Hartman
Date: Tue Jun 24 2025 - 10:24:51 EST


On Tue, Jun 24, 2025 at 10:09:30AM -0400, Drew Hamilton wrote:
> When unplugging the USB cable or disconnecting a gadget in usb peripheral mode with
> echo "" > /sys/kernel/config/usb_gadget/<your_gadget>/UDC,
> /sys/class/udc/musb-hdrc.0/state does not change from USB_STATE_CONFIGURED.
>
> Testing on dwc2/3 shows they both update the state to USB_STATE_NOTATTACHED.
>
> Add calls to usb_gadget_set_state in musb_g_disconnect and musb_gadget_stop
> to fix both cases.
>
> Tested against 82f2b0b97b36ee3fcddf0f0780a9a0825d52fec3.

Nit, git ids are written as:
82f2b0b97b36 ("Linux 6.15-rc6")
Or you could have used the tag "6.15-rc6" as we all know that, but
really, this shouldn't be needed at all.

What it does show is you missed the many thousands of changes that have
gone into the tree since -rc6, is this still an issue in 6.16-rc3?

> Co-authored-by: Yehowshua Immanuel <yehowshua.immanuel@xxxxxxxxxxxxxx>
> Signed-off-by: Yehowshua Immanuel <yehowshua.immanuel@xxxxxxxxxxxxxx>
> Signed-off-by: Drew Hamilton <drew.hamilton@xxxxxxxxxx>

What commit id does this fix?

thanks,

greg k-h