In serial8250_register_ports(), mutex_lock(&hash_mutex) is acquired while holding spinlock_t serial_port_lock during IRQ chain registration: spin_lock_irqsave(&serial_port_lock, flags); mutex_lock(&hash_mutex); Acquiring a sleeping mutex while holding a spinlock causes a sleeping-while-atomic bug and potential deadlock. Replace mutex_lock(&hash_mutex) with spin_lock_irqsave() in serial8250_register_ports(). Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Reviewed-by: Ilpo Järvinen Assisted-by: LLM Signed-off-by: Hui Peng --- drivers/tty/serial/8250/8250_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c index 9e4f5a2a2eaa..f64a1b0a2eaa 100644 --- a/drivers/tty/serial/8250/8250_core.c +++ b/drivers/tty/serial/8250/8250_core.c @@ -102,9 +102,9 @@ static void serial8250_register_ports(struct uart_driver *drv, struct uart_8250_port *up; for (i = 0; i < nr; i++) { - up = &serial8250_ports[i]; + up = &serial8250_ports[i]; up->port.dev = dev; } }