mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 12:44:03 +02:00
USB: serial: digi_acceleport: add port lock nesting annotation
The driver takes the driver port lock of both the OOB port and the port itself when setting the modem control signals, which confuses lockdep. Mark the OOB port lock as belonging to a separate subclass to suppress false positive lockdep deadlock warnings. Reported-by: syzbot+2051460e19471eeb42c3@syzkaller.appspotmail.com Link: https://lore.kernel.org/all/6a6cd832.1aa927e4.17d4bf.0007.GAE@google.com/ Signed-off-by: Johan Hovold <johan@kernel.org>
This commit is contained in:
parent
f5098b6bae
commit
177b48f840
|
|
@ -1228,6 +1228,7 @@ static int digi_startup_device(struct usb_serial *serial)
|
|||
|
||||
static int digi_port_init(struct usb_serial_port *port, unsigned port_num)
|
||||
{
|
||||
struct digi_serial *serial_priv = usb_get_serial_data(port->serial);
|
||||
struct digi_port *priv;
|
||||
|
||||
priv = kzalloc_obj(*priv);
|
||||
|
|
@ -1235,6 +1236,10 @@ static int digi_port_init(struct usb_serial_port *port, unsigned port_num)
|
|||
return -ENOMEM;
|
||||
|
||||
spin_lock_init(&priv->dp_port_lock);
|
||||
|
||||
if (port == serial_priv->ds_oob_port)
|
||||
lockdep_set_subclass(&priv->dp_port_lock, SINGLE_DEPTH_NESTING);
|
||||
|
||||
priv->dp_port_num = port_num;
|
||||
init_waitqueue_head(&priv->dp_transmit_idle_wait);
|
||||
init_waitqueue_head(&priv->dp_flush_wait);
|
||||
|
|
@ -1279,6 +1284,8 @@ static int digi_startup(struct usb_serial *serial)
|
|||
serial_priv->ds_oob_port_num = oob_port_num;
|
||||
serial_priv->ds_oob_port = serial->port[oob_port_num];
|
||||
|
||||
usb_set_serial_data(serial, serial_priv);
|
||||
|
||||
ret = digi_port_init(serial_priv->ds_oob_port,
|
||||
serial_priv->ds_oob_port_num);
|
||||
if (ret) {
|
||||
|
|
@ -1286,8 +1293,6 @@ static int digi_startup(struct usb_serial *serial)
|
|||
return ret;
|
||||
}
|
||||
|
||||
usb_set_serial_data(serial, serial_priv);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user