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
-