Skip to content

Commit

Permalink
usb: gadget: u_serial: clear suspended flag when disconnecting
Browse files Browse the repository at this point in the history
The commit aba3a8d ("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: aba3a8d ("usb: gadget: u_serial: add suspend resume callbacks")
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Tested-by: Linh Phung <linh.phung.jy@renesas.com>
Tested-by: Tam Nguyen <tam.nguyen.xa@renesas.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
  • Loading branch information
shimoday authored and felipebalbi committed Oct 2, 2020
1 parent 897b813 commit d98ef43
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/usb/gadget/function/u_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit d98ef43

Please sign in to comment.