From: Yoshihiro Shimoda Date: Wed, 9 Sep 2020 00:01:32 +0000 (+0900) Subject: usb: gadget: u_serial: clear suspended flag when disconnecting X-Git-Tag: v5.15~2673^2~12^2~56 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d98ef43bfb65b5201e1afe36aaf8c4f9d71b4307;p=platform%2Fkernel%2Flinux-starfive.git usb: gadget: u_serial: clear suspended flag when disconnecting The commit aba3a8d01d62 ("usb: gadget: u_serial: add suspend resume callbacks") set/cleared the suspended flag in USB bus suspend/resume only. But, when a USB cable is disconnected in the suspend, since some controllers will not detect USB bus resume, the suspended flag is not cleared. After that, user cannot send any data. To fix the issue, clears the suspended flag in the gserial_disconnect(). Fixes: aba3a8d01d62 ("usb: gadget: u_serial: add suspend resume callbacks") Signed-off-by: Yoshihiro Shimoda Tested-by: Linh Phung Tested-by: Tam Nguyen Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadget/function/u_serial.c index 127ecc2..2caccbb 100644 --- a/drivers/usb/gadget/function/u_serial.c +++ b/drivers/usb/gadget/function/u_serial.c @@ -1391,6 +1391,7 @@ void gserial_disconnect(struct gserial *gser) if (port->port.tty) tty_hangup(port->port.tty); } + port->suspended = false; spin_unlock_irqrestore(&port->port_lock, flags); /* disable endpoints, aborting down any active I/O */