u_serial.c - Force destroy tty_port in gserial_free_port
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi,
Quoted 4 lines · Andre Wolokita
Issuing a modprobe -r
g_serialcommand to the target over the gadget serial communications line causes modprobe to enter uninterruptable sleep, leaving the system in an unstable state.
does anybody know if this is a valid usecase ? I'd expect us to return -EBUSY in such a case, no ? In any case, using g_serial to rmmod g_serial is, from what I can tell, not supported.
Let's wait to hear from Alan Cox or somebody else.
Quoted 28 lines
The associated tty_port.count won't drop to 0 because the command is issued over the very line being removed.
Destroying the
tty_portwill ensure that resources are freed and modprobe will not hang.Signed-off-by Andre Wolokita <[email protected]>--- drivers/usb/gadget/function/u_serial.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/usb/gadget/function/u_serial.c +1
-1@@ -1074,10 +1074,10 @@ static int gs_closed(struct gs_port *port)static void gserial_free_port (struct gs_port *port) {tasklet_kill (&port->push); +tty_port_destroy (&port->port);/* wait for old opens to finish */ wait_event (port->port.close_wait,gs_closed (port));WARN_ON (port->port_usb !=NULL ); -tty_port_destroy (&port->port);kfree (port); }
Signature · 1 line
balbi