linux-stable/drivers/tty/serial/8250
Guenter Roeck beeeac43b6 Revert "serial: 8250_dw: Fix runtime PM handling"
This reverts commit d76c74387e.

While commit d76c74387e ("serial: 8250_dw: Fix runtime PM handling")
fixes runtime PM handling when using kgdb, it introduces a traceback for
everyone else.

BUG: sleeping function called from invalid context at
	/mnt/host/source/src/third_party/kernel/next/drivers/base/power/runtime.c:1034
in_atomic(): 1, irqs_disabled(): 1, pid: 1, name: swapper/0
7 locks held by swapper/0/1:
 #0: 000000005ec5bc72 (&dev->mutex){....}, at: __driver_attach+0xb5/0x12b
 #1: 000000005d5fa9e5 (&dev->mutex){....}, at: __device_attach+0x3e/0x15b
 #2: 0000000047e93286 (serial_mutex){+.+.}, at: serial8250_register_8250_port+0x51/0x8bb
 #3: 000000003b328f07 (port_mutex){+.+.}, at: uart_add_one_port+0xab/0x8b0
 #4: 00000000fa313d4d (&port->mutex){+.+.}, at: uart_add_one_port+0xcc/0x8b0
 #5: 00000000090983ca (console_lock){+.+.}, at: vprintk_emit+0xdb/0x217
 #6: 00000000c743e583 (console_owner){-...}, at: console_unlock+0x211/0x60f
irq event stamp: 735222
__down_trylock_console_sem+0x4a/0x84
console_unlock+0x338/0x60f
__do_softirq+0x4a4/0x50d
irq_exit+0x64/0xe2
CPU: 2 PID: 1 Comm: swapper/0 Not tainted 4.19.0-rc5 #6
Hardware name: Google Caroline/Caroline, BIOS Google_Caroline.7820.286.0 03/15/2017
Call Trace:
 dump_stack+0x7d/0xbd
 ___might_sleep+0x238/0x259
 __pm_runtime_resume+0x4e/0xa4
 ? serial8250_rpm_get+0x2e/0x44
 serial8250_console_write+0x44/0x301
 ? lock_acquire+0x1b8/0x1fa
 console_unlock+0x577/0x60f
 vprintk_emit+0x1f0/0x217
 printk+0x52/0x6e
 register_console+0x43b/0x524
 uart_add_one_port+0x672/0x8b0
 ? set_io_from_upio+0x150/0x162
 serial8250_register_8250_port+0x825/0x8bb
 dw8250_probe+0x80c/0x8b0
 ? dw8250_serial_inq+0x8e/0x8e
 ? dw8250_check_lcr+0x108/0x108
 ? dw8250_runtime_resume+0x5b/0x5b
 ? dw8250_serial_outq+0xa1/0xa1
 ? dw8250_remove+0x115/0x115
 platform_drv_probe+0x76/0xc5
 really_probe+0x1f1/0x3ee
 ? driver_allows_async_probing+0x5d/0x5d
 driver_probe_device+0xd6/0x112
 ? driver_allows_async_probing+0x5d/0x5d
 bus_for_each_drv+0xbe/0xe5
 __device_attach+0xdd/0x15b
 bus_probe_device+0x5a/0x10b
 device_add+0x501/0x894
 ? _raw_write_unlock+0x27/0x3a
 platform_device_add+0x224/0x2b7
 mfd_add_device+0x718/0x75b
 ? __kmalloc+0x144/0x16a
 ? mfd_add_devices+0x38/0xdb
 mfd_add_devices+0x9b/0xdb
 intel_lpss_probe+0x7d4/0x8ee
 intel_lpss_pci_probe+0xac/0xd4
 pci_device_probe+0x101/0x18e
...

Revert the offending patch until a more comprehensive solution
is available.

Cc: Tony Lindgren <tony@atomide.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Phil Edworthy <phil.edworthy@renesas.com>
Fixes: d76c74387e ("serial: 8250_dw: Fix runtime PM handling")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-02 14:35:10 -07:00
..
8250.h tty: serial: Remove redundant license text 2017-11-08 13:08:12 +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/aspeed-vuart: fix a couple mod_timer() calls 2018-05-14 13:51:11 +02:00
8250_bcm2835aux.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_boca.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_core.c serial: 8250: Use cached port name directly in messages 2018-07-25 12:51:23 +02:00
8250_dma.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_dw.c Revert "serial: 8250_dw: Fix runtime PM handling" 2018-10-02 14:35:10 -07:00
8250_early.c serial: 8250_early: Setup divider when uartclk is passed 2018-04-25 14:56:12 +02:00
8250_em.c headers: separate linux/mod_devicetable.h from linux/platform_device.h 2018-07-07 17:52:26 +02:00
8250_exar.c serial: 8250_exar: Read INT0 from slave device, too 2018-08-02 10:11:35 +02:00
8250_exar_st16c554.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_fintek.c serial: 8250_fintek: Fix crash with baud rate B0 2017-11-08 13:09:35 +01:00
8250_fourport.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_fsl.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_gsc.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +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_ingenic: Parse earlycon options 2018-01-09 16:49:14 +01:00
8250_lpc18xx.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_lpss.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_men_mcb.c 8250-men-mcb: add support for 16z025 and 16z057 2018-03-15 18:12:55 +01:00
8250_mid.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_moxa.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_mtk.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_of.c serial: 8250: of: Defer probe on missing IRQ 2018-07-16 11:56:22 +02:00
8250_omap.c serial: 8250_omap: Add support for AM654 UART controller 2018-06-28 21:23:44 +09:00
8250_pci.c serial: 8250_pci: Remove stalled entries in blacklist 2018-06-28 21:34:39 +09:00
8250_pnp.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_port.c tty: serial: 8250: Revert NXP SC16C2552 workaround 2018-08-12 18:53:30 +02:00
8250_pxa.c tty: serial: Remove redundant license text 2017-11-08 13:08:12 +01:00
8250_uniphier.c serial: 8250_uniphier: fix error return code in uniphier_uart_probe() 2018-01-09 16:45:17 +01:00
Kconfig 8250-men-mcb: add support for 16z025 and 16z057 2018-03-15 18:12:55 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
serial_cs.c drivers/tty: add error handling for pcmcia_loop_config 2018-06-28 21:23:44 +09:00