Lockdep violation in the serial driver

From: Alan Stern
Date: Fri Jul 27 2007 - 17:33:31 EST


I want to make some changes to the Power Management core, and one of
the side effects will be to make it illegal for a driver to acquire a
mutex within its suspend() or resume() method if that mutex was locked
while the device was registered.

Unfortunately the serial core does exactly that. In
drivers/serial/serial_core.c the uart_add_one_port() routine holds
state->mutex while calling tty_register_device(), and the same mutex is
acquired by uart_suspend_port() and uart_resume_port().

Can anybody suggest a way around this? Does the mutex really need to
be locked at all these times? Can it be released before calling
tty_register_device()? Or could two separate mutexes be used?

Thanks,

Alan Stern

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/