Re: [PATCH 3/3] serial: 8250_dw: Fix clk-notifier/port suspend deadlock
From: Jonathan Liu <hidden>
Date: 2020-10-18 00:32:24
Also in:
linux-serial, lkml
On Wed, 23 Sep 2020 at 16:19, Serge Semin [off-list ref] wrote:
It has been discovered that there is a potential deadlock between
the clock-change-notifier thread and the UART port suspending one:
CPU0 (suspend CPU/UART) CPU1 (update clock)
---- ----
lock(&port->mutex);
lock((work_completion)(&data->clk_work));
lock(&port->mutex);
lock((work_completion)(&data->clk_work));
*** DEADLOCK ***
The best way to fix this is to eliminate the CPU0
port->mutex/work-completion scenario. So we suggest to register and
unregister the clock-notifier during the DW APB UART port probe/remove
procedures, instead of doing that at the points of the port
startup/shutdown.
Link: https://lore.kernel.org/linux-serial/f1cd5c75-9cda-6896-a4e2-42c5bfc3f5c3@redhat.com (local)
Fixes: cc816969d7b5 ("serial: 8250_dw: Fix common clocks usage race condition")
Reported-by: Hans de Goede <redacted>
Signed-off-by: Serge Semin <redacted>Tested-by: Jonathan Liu <redacted> Fixes hang while closing the serial port on RK3399 that I was experiencing often with Linux 5.9. After applying this patch, it no longer hangs while closing the serial port. No problems while rebooting either. Thanks. Regards, Jonathan _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel