linux/drivers/usb/serial
Dmitry Smirnov 5ae6a64f18 USB: serial: mos7840: fix crash on resume
commit c15a688e49 upstream.

Since commit c49cfa9170 ("USB: serial: use generic method if no
alternative is provided in usb serial layer"), USB serial core calls the
generic resume implementation when the driver has not provided one.

This can trigger a crash on resume with mos7840 since support for
multiple read URBs was added back in 2011. Specifically, both port read
URBs are now submitted on resume for open ports, but the context pointer
of the second URB is left set to the core rather than mos7840 port
structure.

Fix this by implementing dedicated suspend and resume functions for
mos7840.

Tested with Delock 87414 USB 2.0 to 4x serial adapter.

Signed-off-by: Dmitry Smirnov <d.smirnov@inbox.lv>
[ johan: analyse crash and rewrite commit message; set busy flag on
         resume; drop bulk-in check; drop unnecessary usb_kill_urb() ]
Fixes: d83b405383 ("USB: serial: add support for multiple read urbs")
Cc: stable@vger.kernel.org	# 3.3
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-07-18 13:21:18 +02:00
..
aircable.c
ark3116.c USB: serial: return errors from break handling 2023-06-07 17:00:23 +02:00
belkin_sa.c USB: serial: return errors from break handling 2023-06-07 17:00:23 +02:00
belkin_sa.h
bus.c USB: mark all struct bus_type as const 2023-03-23 13:22:00 +01:00
ch341.c USB: serial: return errors from break handling 2023-06-07 17:00:23 +02:00
console.c tty: Cleanup tty_port_set_initialized() bool parameter 2023-01-19 16:04:34 +01:00
cp210x.c USB: serial: cp210x: add pid/vid for TDK NC0110013M and MM0110113M 2024-04-03 15:28:24 +02:00
cyberjack.c
cypress_m8.c usb: serial: Make ->set_termios() old ktermios const 2022-08-30 14:22:35 +02:00
cypress_m8.h
digi_acceleport.c USB: serial: return errors from break handling 2023-06-07 17:00:23 +02:00
empeg.c
ezusb_convert.pl
f81232.c USB: serial: return errors from break handling 2023-06-07 17:00:23 +02:00
f81534.c USB: serial: return errors from break handling 2023-06-07 17:00:23 +02:00
ftdi_sio_ids.h USB: serial: ftdi_sio: add support for GMC Z216C Adapter IR-USB 2024-04-03 15:28:24 +02:00
ftdi_sio.c USB: serial: ftdi_sio: add support for GMC Z216C Adapter IR-USB 2024-04-03 15:28:24 +02:00
ftdi_sio.h USB: serial: ftdi_sio: rename channel index 2022-09-15 08:05:53 +02:00
garmin_gps.c treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
generic.c
io_16654.h
io_edgeport.c USB: serial: return errors from break handling 2023-06-07 17:00:23 +02:00
io_edgeport.h
io_ionsp.h
io_ti.c USB: serial: return errors from break handling 2023-06-07 17:00:23 +02:00
io_ti.h
io_usbvend.h USB: serial: io_ti: add Agilent E5805A support 2022-06-09 14:13:28 +02:00
ipaq.c USB: serial: replace symbolic permissions by octal permissions 2021-08-26 09:38:27 +02:00
ipw.c
ir-usb.c usb: serial: Make ->set_termios() old ktermios const 2022-08-30 14:22:35 +02:00
iuu_phoenix.c usb: serial: Make ->set_termios() old ktermios const 2022-08-30 14:22:35 +02:00
iuu_phoenix.h
Kconfig USB: serial: simple: add Nokia phone driver 2022-03-03 09:27:36 +01:00
keyspan_pda.c USB: serial: return errors from break handling 2023-06-07 17:00:23 +02:00
keyspan_usa26msg.h
keyspan_usa28msg.h
keyspan_usa49msg.h
keyspan_usa67msg.h
keyspan_usa90msg.h
keyspan.c USB: serial: return errors from break handling 2023-06-07 17:00:23 +02:00
kl5kusb105.c usb: serial: Make ->set_termios() old ktermios const 2022-08-30 14:22:35 +02:00
kl5kusb105.h
kobil_sct.c usb: serial: Make ->set_termios() old ktermios const 2022-08-30 14:22:35 +02:00
kobil_sct.h
Makefile
Makefile-keyspan_pda_fw
mct_u232.c USB: serial: return errors from break handling 2023-06-07 17:00:23 +02:00
mct_u232.h
metro-usb.c
mos7720.c USB: serial: return errors from break handling 2023-06-07 17:00:23 +02:00
mos7840.c USB: serial: mos7840: fix crash on resume 2024-07-18 13:21:18 +02:00
mxuport.c USB: serial: return errors from break handling 2023-06-07 17:00:23 +02:00
navman.c
omninet.c
opticon.c USB: serial: use kmemdup instead of kmalloc + memcpy 2022-06-22 08:56:52 +02:00
option.c USB: serial: option: add Rolling RW350-GL variants 2024-07-18 13:21:18 +02:00
oti6858.c usb: serial: Make ->set_termios() old ktermios const 2022-08-30 14:22:35 +02:00
oti6858.h
pl2303.c USB: serial: return errors from break handling 2023-06-07 17:00:23 +02:00
pl2303.h USB: serial: pl2303: add device id for HP LM930 Display 2022-05-05 13:31:03 +02:00
qcaux.c
qcserial.c USB: serial: qcserial: add new usb-id for Dell Wireless DW5826e 2024-02-16 19:10:54 +01:00
quatech2.c USB: serial: return errors from break handling 2023-06-07 17:00:23 +02:00
safe_serial.c
sierra.c USB: serial: fix tty-port initialized comments 2022-07-25 11:01:40 +02:00
spcp8x5.c usb: serial: Make ->set_termios() old ktermios const 2022-08-30 14:22:35 +02:00
ssu100.c usb: serial: Make ->set_termios() old ktermios const 2022-08-30 14:22:35 +02:00
symbolserial.c
ti_usb_3410_5052.c USB: serial: return errors from break handling 2023-06-07 17:00:23 +02:00
upd78f0730.c USB: serial: return errors from break handling 2023-06-07 17:00:23 +02:00
usb_debug.c USB: serial: return errors from break handling 2023-06-07 17:00:23 +02:00
usb_wwan.c USB-serial updates for 5.20-rc1 2022-07-25 11:28:52 +02:00
usb-serial-simple.c USB: serial: simple: sort driver entries 2023-07-20 15:59:25 +02:00
usb-serial.c tty: make tty_operations::write()'s count size_t 2023-08-11 21:12:46 +02:00
usb-wwan.h
visor.c
visor.h
whiteheat.c USB: serial: return errors from break handling 2023-06-07 17:00:23 +02:00
whiteheat.h
wishbone-serial.c
xr_serial.c USB: serial: xr: add TIOCGRS485 and TIOCSRS485 ioctls 2023-07-20 15:37:03 +02:00
xsens_mt.c