WSL2-Linux-Kernel/drivers/tty/serial/8250
Serge Semin 85985a3dcd serial: 8250_dw: Fix clk-notifier/port suspend deadlock
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: cc816969d7 ("serial: 8250_dw: Fix common clocks usage race condition")
Reported-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Link: https://lore.kernel.org/r/20200923161950.6237-4-Sergey.Semin@baikalelectronics.ru
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-09-30 14:52:42 +02:00
..
8250.h serial: 8250: Generalize rs485 software emulation 2020-03-07 09:52:02 +01:00
8250_accent.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_acorn.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_aspeed_vuart.c serial: 8250: Check UPF_IRQ_SHARED in advance 2020-02-12 11:56:44 -08:00
8250_bcm2835aux.c serial: 8250: Simplify with dev_err_probe() 2020-09-04 17:14:29 +02:00
8250_boca.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_core.c serial: 8250: fix null-ptr-deref in serial8250_start_tx() 2020-07-21 21:23:18 +02:00
8250_dma.c serial: 8250: factor out serial8250_{set,clear}_THRI() helpers 2019-06-18 09:36:55 +02:00
8250_dw.c serial: 8250_dw: Fix clk-notifier/port suspend deadlock 2020-09-30 14:52:42 +02:00
8250_dwlib.c serial: 8250_dw: split Synopsys DesignWare 8250 common functions 2019-09-04 12:43:52 +02:00
8250_dwlib.h tty: serial: Use the correct style for SPDX License Identifier 2020-03-07 09:52:01 +01:00
8250_early.c serial: 8250_early: Support kgdboc_earlycon 2020-06-02 15:15:46 +01:00
8250_em.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
8250_exar.c serial: 8250_exar: Fix number of ports for Commtech PCIe cards 2020-08-18 13:27:26 +02:00
8250_exar_st16c554.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_fintek.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
8250_fourport.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_fsl.c serial: 8250_fsl: Fix TX interrupt handling condition 2020-09-30 14:31:04 +02:00
8250_gsc.c remove ioremap_nocache and devm_ioremap_nocache 2020-01-06 09:45:59 +01:00
8250_hp300.c tty: add SPDX identifiers to all remaining files in drivers/tty/ 2017-11-08 13:08:12 +01:00
8250_hub6.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_ingenic.c serial: 8250: Simplify with dev_err_probe() 2020-09-04 17:14:29 +02:00
8250_ioc3.c Fix up remaining devm_ioremap_nocache() in SGI IOC3 8250 UART driver 2020-02-08 14:19:39 -08:00
8250_lpc18xx.c tty: Remove dev_err() usage after platform_get_irq() 2019-09-04 12:43:49 +02:00
8250_lpss.c serial: 8250_lpss: Add ->setup() for Elkhart Lake ports 2020-03-06 13:31:19 +01:00
8250_men_mcb.c 8250-men-mcb: fix signed/unsigned confusion 2020-06-27 16:12:45 +02:00
8250_mid.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_mtk.c tty: serial: 8250_mtk: set regshift for mmio32 2020-09-16 13:17:17 +02:00
8250_of.c serial: 8250: Generalize rs485 software emulation 2020-03-07 09:52:02 +01:00
8250_omap.c serial: 8250_omap: Switch to use platform_get_irq() 2020-06-27 16:12:45 +02:00
8250_pci.c Merge 5.9.0-rc6 into tty-next 2020-09-21 09:23:55 +02:00
8250_pnp.c serial: 8250_pnp: Move to struct dev_pm_ops 2019-09-04 12:43:46 +02:00
8250_port.c serial: 8250: Skip uninitialized TTY port baud rate update 2020-09-30 14:52:42 +02:00
8250_pxa.c serial: 8250_pxa: Switch to use platform_get_irq() 2020-06-27 16:12:56 +02:00
8250_tegra.c serial: 8250_tegra: Create Tegra specific 8250 driver 2020-02-10 12:34:44 -08:00
8250_uniphier.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
Kconfig tty: serial: Replace HTTP links with HTTPS ones 2020-07-21 20:04:54 +02:00
Makefile serial: 8250_tegra: Create Tegra specific 8250 driver 2020-02-10 12:34:44 -08:00
serial_cs.c drivers/tty: remove redundant assignment to variable i and rename it to ret 2020-04-16 16:12:34 +02:00