Hi Adam-san, > From: Adam Ford, Sent: Monday, January 31, 2022 10:01 AM > > On Sun, Jan 30, 2022 at 6:23 PM Yoshihiro Shimoda > <yoshihiro.shimoda.uh@xxxxxxxxxxx> wrote: <snip> > > > diff --git a/drivers/usb/gadget/udc/renesas_usb3.c b/drivers/usb/gadget/udc/renesas_usb3.c > > > index 57d417a7c3e0..601829a6b4ba 100644 > > > --- a/drivers/usb/gadget/udc/renesas_usb3.c > > > +++ b/drivers/usb/gadget/udc/renesas_usb3.c > > > @@ -2378,6 +2378,8 @@ static void handle_ext_role_switch_states(struct device *dev, > > > switch (role) { > > > case USB_ROLE_NONE: > > > usb3->connection_state = USB_ROLE_NONE; > > > + if (cur_role == USB_ROLE_HOST) > > > + device_release_driver(host); > > > > The handle_ext_role_switch_states() with role = USB_ROLE_NONE seems > > to be called multiple times. So, we have to avoid multiple calling of > > device_release_driver() somehow. > > From what I can tell, it appears that device_release_driver ultimately > calls __device_release_driver which checks for a NULL, and during the > release sets it to NULL, so subsequent releases should just get > ignored. Maybe I am missing something. Thank you for your comment. You're correct. I'm sorry, I didn't check the __device_release_driver() behavior. This patch looks good to me. So, Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@xxxxxxxxxxx> Best regards, Yoshihiro Shimoda