linux/drivers/tty/serial
Rafael J. Wysocki 048be431e4 sh-sci / PM: Avoid deadlocking runtime PM
The runtime PM of sh-sci devices is enabled when sci_probe() returns,
so the pm_runtime_put_sync() executed by driver_probe_device()
attempts to suspend the device.  Then, in some situations, a
diagnostic message is printed to the console by one of the runtime
suspend routines handling the sh-sci device, which causes synchronous
runtime resume to be started from the device's own runtime suspend
callback.  This causes rpm_resume() to be run eventually, which sees
the RPM_SUSPENDING status set by rpm_suspend() and waits for it to
change.  However, the device's runtime PM status cannot change at
that point, because the routine that has set it waits for the
rpm_suspend() to return.  A deadlock occurs as a result.

To avoid that make sci_init_single() increment the device's
runtime PM usage counter, so that it cannot be suspended by
driver_probe_device().  That counter has to be decremented
eventually, so make sci_startup() do that before starting to
actually use the device and make sci_shutdown() increment it
again before returning to balance the incrementation carried out by
sci_startup().

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Tested-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2012-03-09 12:59:44 +09:00
..
8250 m32r: relocate drivers back out of 8250 dir 2012-02-08 15:04:32 -08:00
cpm_uart TTY: serial, fix includes in some drivers 2011-09-22 15:49:26 -07:00
jsm jsm: Fixed EEH recovery error 2012-01-24 12:55:36 -08:00
21285.c
68328serial.c TTY: irq: Remove IRQF_DISABLED 2011-09-22 16:08:57 -07:00
68328serial.h TTY: serial, remove dead code from 68328 2011-09-22 15:47:54 -07:00
Kconfig serial: Kill off Moorestown code 2012-01-26 11:19:46 -08:00
Makefile serial: Kill off Moorestown code 2012-01-26 11:19:46 -08:00
altera_jtaguart.c Merge branch 'devicetree/next' of git://git.secretlab.ca/git/linux-2.6 2011-10-27 08:35:41 +02:00
altera_uart.c Merge branch 'devicetree/next' of git://git.secretlab.ca/git/linux-2.6 2011-10-27 08:35:41 +02:00
amba-pl010.c serial: pl010: Enable module alias autogeneration for AMBA drivers 2011-11-22 10:58:32 +00:00
amba-pl011.c serial: amba-pl011: lock console writes against interrupts 2012-01-24 16:09:55 -08:00
apbuart.c apbuart: fix section mismatch warning 2011-12-27 16:33:13 -05:00
apbuart.h
ar933x_uart.c SERIAL: AR933X: Add driver for the built-in UART of the SoC 2011-12-07 22:02:46 +00:00
atmel_serial.c atmel_serial: fix spinlock lockup in RS485 code 2012-01-04 16:19:34 -08:00
bcm63xx_uart.c
bfin_sport_uart.c serial: bfin-sport-uart: Add tty ASYNC_CTS_FLOW flag to do CTS flow control. 2011-12-09 19:05:33 -08:00
bfin_sport_uart.h tty: bfin-sport-uart: Rx interrupt is not called always with irq disabled. 2011-12-09 19:05:33 -08:00
bfin_uart.c serial: bfin-uart: Remove ASYNC_CTS_FLOW flag for hardware automatic CTS. 2011-12-13 09:50:15 -08:00
clps711x.c
crisv10.c RS485: fix inconsistencies in the meaning of some variables 2011-11-15 12:13:44 -08:00
crisv10.h
dz.c TTY: serial, fix includes in some drivers 2011-09-22 15:49:26 -07:00
dz.h
icom.c TTY: irq: Remove IRQF_DISABLED 2011-09-22 16:08:57 -07:00
icom.h
ifx6x60.c TTY: Remove redundant spi driver bus initialization 2011-11-26 20:19:21 -08:00
ifx6x60.h
imx.c tty: serial: imx: move del_timer_sync() to avoid potential deadlock 2012-01-04 16:30:36 -08:00
ioc3_serial.c TTY: serial, fix includes in some drivers 2011-09-22 15:49:26 -07:00
ioc4_serial.c TTY: serial, fix includes in some drivers 2011-09-22 15:49:26 -07:00
ip22zilog.c
ip22zilog.h
kgdboc.c tty: Add module.h to drivers/tty users who just expect it there. 2011-10-31 19:31:27 -04:00
lantiq.c Merge branch 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty 2011-10-26 15:11:09 +02:00
m32r_sio.c m32r: relocate drivers back out of 8250 dir 2012-02-08 15:04:32 -08:00
m32r_sio.h m32r: relocate drivers back out of 8250 dir 2012-02-08 15:04:32 -08:00
m32r_sio_reg.h m32r: relocate drivers back out of 8250 dir 2012-02-08 15:04:32 -08:00
max3100.c TTY: Remove redundant spi driver bus initialization 2011-11-26 20:19:21 -08:00
max3107.c TTY: Remove redundant spi driver bus initialization 2011-11-26 20:19:21 -08:00
max3107.h
mcf.c TTY: irq: Remove IRQF_DISABLED 2011-09-22 16:08:57 -07:00
mfd.c Merge 3.2-rc3 into tty-next to handle merge conflict in tty_ldisc.c 2011-11-26 20:07:25 -08:00
mpc52xx_uart.c TTY: irq: Remove IRQF_DISABLED 2011-09-22 16:08:57 -07:00
mpsc.c
mrst_max3110.c TTY: Remove redundant spi driver bus initialization 2011-11-26 20:19:21 -08:00
mrst_max3110.h max3110: add sysrq support 2011-08-26 11:01:15 -07:00
msm_serial.c Merge branch 'next/dt' of git://git.linaro.org/people/arnd/arm-soc 2011-11-01 21:02:35 -07:00
msm_serial.h
msm_serial_hs.c msm_serial_hs: Fix spinlock recursion in handling CTS 2011-12-09 19:10:04 -08:00
msm_smd_tty.c
mux.c TTY: serial, fix includes in some drivers 2011-09-22 15:49:26 -07:00
mxs-auart.c clock management changes for i.MX 2012-01-09 14:44:15 -08:00
netx-serial.c
nwpserial.c tty: Add export.h for EXPORT_SYMBOL/THIS_MODULE to exporters 2011-10-31 19:31:28 -04:00
of_serial.c drivercore: Add helper macro for platform_driver boilerplate 2011-10-25 00:35:47 +02:00
omap-serial.c tty: serial: omap-serial: wakeup latency constraint is in microseconds, not milliseconds 2012-02-09 10:48:36 -08:00
pch_uart.c Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma 2012-01-17 18:40:24 -08:00
pmac_zilog.c tty/serial/pmac_zilog: Fix suspend & resume 2011-12-16 11:10:01 +11:00
pmac_zilog.h tty/serial/pmac_zilog: Fix suspend & resume 2011-12-16 11:10:01 +11:00
pnx8xxx_uart.c
pxa.c serial: pxa: work around for errata #20 2011-09-22 15:47:53 -07:00
sa1100.c
samsung.c serial: samsung: Add support for EXYNOS5250 2012-02-02 16:11:24 -08:00
samsung.h serial: samsung: merge probe() function from all SoC specific extensions 2011-12-23 10:07:00 +09:00
sb1250-duart.c TTY: serial, fix includes in some drivers 2011-09-22 15:49:26 -07:00
sc26xx.c TTY: serial: convert drivers/tty/serial/* to use module_platform_driver() 2011-11-30 20:11:46 +09:00
serial_core.c serial: Fix wakeup init logic to speed up startup 2012-01-24 16:29:40 -08:00
serial_ks8695.c TTY: irq: Remove IRQF_DISABLED 2011-09-22 16:08:57 -07:00
serial_txx9.c TTY: serial, fix includes in some drivers 2011-09-22 15:49:26 -07:00
sh-sci.c sh-sci / PM: Avoid deadlocking runtime PM 2012-03-09 12:59:44 +09:00
sh-sci.h ARM: mach-shmobile: R-Mobile A1 support. 2011-11-11 16:55:31 +09:00
sirfsoc_uart.c UART: add CSR SiRFprimaII SoC on-chip uart drivers 2011-11-17 11:46:04 -08:00
sirfsoc_uart.h UART: add CSR SiRFprimaII SoC on-chip uart drivers 2011-11-17 11:46:04 -08:00
sn_console.c TTY: irq: Remove IRQF_DISABLED 2011-09-22 16:08:57 -07:00
suncore.c
suncore.h
sunhv.c
sunsab.c
sunsab.h
sunsu.c
sunzilog.c
sunzilog.h
timbuart.c TTY: serial: convert drivers/tty/serial/* to use module_platform_driver() 2011-11-30 20:11:46 +09:00
timbuart.h
uartlite.c Merge branch 'devicetree/next' of git://git.secretlab.ca/git/linux-2.6 2011-10-27 08:35:41 +02:00
ucc_uart.c drivers/serial/ucc_uart.c: Add missing call to init UCC UART port timeout 2011-11-24 02:23:45 -06:00
vr41xx_siu.c TTY: serial: convert drivers/tty/serial/* to use module_platform_driver() 2011-11-30 20:11:46 +09:00
vt8500_serial.c
xilinx_uartps.c tty: Add module.h to drivers/tty users who just expect it there. 2011-10-31 19:31:27 -04:00
zs.c TTY: serial, fix includes in some drivers 2011-09-22 15:49:26 -07:00
zs.h