OMAP2+: PM/serial: fix console semaphore acquire during suspend
authorKevin Hilman <khilman@deeprootsystems.com>
Wed, 8 Dec 2010 22:40:40 +0000 (22:40 +0000)
committerTony Lindgren <tony@atomide.com>
Fri, 10 Dec 2010 00:41:29 +0000 (16:41 -0800)
commite83df17f178360a8e7874441bca04a710c869e42
tree0ee590c033a2e204860846b30f66d1279aa9c53b
parent28dd31983f6c3a4d89369ff8f0c93de2cda868db
OMAP2+: PM/serial: fix console semaphore acquire during suspend

commit 0d8e2d0dad98a693bad88aea6876ac8b94ad95c6 (OMAP2+: PM/serial:
hold console semaphore while OMAP UARTs are disabled) added use of the
console semaphore to protect UARTs from being accessed after disabled
during idle, but this causes problems in suspend.

During suspend, the console semaphore is acquired by the console
suspend method (console_suspend()) so the try_acquire_console_sem()
will always fail and suspend will be aborted.

To fix, introduce a check so the console semaphore is only attempted
during idle, and not during suspend.  Also use the same check so that
the console semaphore is not prematurely released during resume.

Thanks to Paul Walmsley for suggesting adding the same check during
resume.

Cc: Paul Walmsley <paul@pwsan.com>
Tested-by: Jean Pihet <j-pihet@ti.com>
Tested-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/pm24xx.c
arch/arm/mach-omap2/pm34xx.c