lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Sun, 18 Oct 2020 11:32:06 +1100
From:   Jonathan Liu <net147@...il.com>
To:     Serge Semin <Sergey.Semin@...kalelectronics.ru>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Jiri Slaby <jirislaby@...nel.org>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Maxime Ripard <mripard@...nel.org>,
        linux-kernel <linux-kernel@...r.kernel.org>,
        Russell King <linux@...linux.org.uk>,
        Serge Semin <fancer.lancer@...il.com>,
        Alexey Malahov <Alexey.Malahov@...kalelectronics.ru>,
        Hans de Goede <hdegoede@...hat.com>,
        Andy Shevchenko <andy.shevchenko@...il.com>,
        Pavel Parkhomenko <Pavel.Parkhomenko@...kalelectronics.ru>,
        linux-serial@...r.kernel.org, Will Deacon <will@...nel.org>,
        linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH 3/3] serial: 8250_dw: Fix clk-notifier/port suspend deadlock

On Wed, 23 Sep 2020 at 16:19, Serge Semin
<Sergey.Semin@...kalelectronics.ru> 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
>
> Fixes: cc816969d7b5 ("serial: 8250_dw: Fix common clocks usage race condition")
> Reported-by: Hans de Goede <hdegoede@...hat.com>
> Signed-off-by: Serge Semin <Sergey.Semin@...kalelectronics.ru>

Tested-by: Jonathan Liu <net147@...il.com>

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

Powered by blists - more mailing lists