serial: 8250_omap: Fix idling for unloaded serdev drivers
authorTony Lindgren <tony@atomide.com>
Tue, 23 Jul 2019 11:54:00 +0000 (04:54 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Sep 2019 10:43:43 +0000 (12:43 +0200)
commit627a545c6bb0c7de09208e6546f5111290477261
tree18584e18e73b1850599df8dd5ed5c648de0b966b
parent43a9e710cbed16e1e811713b5ccae5293471287e
serial: 8250_omap: Fix idling for unloaded serdev drivers

For many years omap variants have been setting the runtime PM
autosuspend delay to -1 to prevent unsafe policy with lossy first
character on wake-up. The user must specifically enable the timeout
for UARTs if desired.

We must not enable the workaround for serdev devices though. It leads
into UARTs not idling if no serdev devices are loaded and there is no
sysfs entry to configure the UART in that case. And this means that
my PM may not work unless the serdev modules are loaded.

We can detect a serdev device being configured based on a dts child
node, and we can simply skip the workround in that case. And the
serdev driver can idle the port during runtime when suitable if an
out-of-band wake-up GPIO line exists for example.

Let's also add some comments to the workaround while at it.

Cc: Johan Hovold <johan@kernel.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20190723115400.46432-1-tony@atomide.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_omap.c