Linux USB
 help / color / mirror / Atom feed
* [PATCH] USB: serial: digi_acceleport: add port lock nesting annotation
@ 2026-08-01 12:58 Johan Hovold
  0 siblings, 0 replies; only message in thread
From: Johan Hovold @ 2026-08-01 12:58 UTC (permalink / raw)
  To: Johan Hovold
  Cc: Greg Kroah-Hartman, linux-usb, linux-kernel,
	syzbot+2051460e19471eeb42c3

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>
---
 drivers/usb/serial/digi_acceleport.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c
index dea039163661..911d74f20f0e 100644
--- a/drivers/usb/serial/digi_acceleport.c
+++ b/drivers/usb/serial/digi_acceleport.c
@@ -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;
 }
 
-- 
2.54.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-01 12:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-01 12:58 [PATCH] USB: serial: digi_acceleport: add port lock nesting annotation Johan Hovold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox