linux-kernel-test/arch/arm
Paul Walmsley b7c39a3f59 ARM: OMAP2+: omap_device: call all suspend, resume callbacks when OMAP_DEVICE_NO_IDLE_ON_SUSPEND is set
During system suspend, when OMAP_DEVICE_NO_IDLE_ON_SUSPEND is set on
an omap_device, call the corresponding driver's ->suspend() and
->suspend_noirq() callbacks (if present).  Similarly, during resume,
the driver's ->resume() and ->resume_noirq() callbacks must both be
called, if present.  (The previous code only called ->suspend_noirq()
and ->resume_noirq().)

If all of these callbacks aren't called, some important driver
suspend/resume code may not get executed.

In current mainline, the bug fixed by this patch is only a problem
under the following conditions:

- the kernel is running on an OMAP4

- an OMAP UART is used as a console

- the kernel command line parameter 'no_console_suspend' is specified

- and the system enters suspend ("echo mem > /sys/power/state").

Under this combined circumstance, the system cannot be awakened via
the serial port after commit be4b0281956c5cae4f63f31f11d07625a6988766c
("tty: serial: OMAP: block idle while the UART is transferring data in
PIO mode").  This is because the OMAP UART driver's ->suspend()
callback is never called.  The ->suspend() callback would have called
uart_suspend_port() which in turn would call enable_irq_wake().  Since
enable_irq_wake() isn't called for the UART's IRQ, check_wakeup_irqs()
would mask off the UART IRQ in the GIC.

On v3.3 kernels prior to the above commit, serial resume from suspend
presumably occurred via the PRCM interrupt.  The UART was in
smart-idle mode, so it was able to send a PRCM wakeup which in turn
would be converted into a PRCM interrupt to the GIC, waking up the
kernel.  But after the above commit, when the system is suspended in
the middle of a UART transmit, the UART IP block would be in no-idle
mode.  In no-idle mode, the UART won't generate wakeups to the PRCM
when incoming characters are received; only GIC interrupts.  But since
the UART driver's ->suspend() callback is never called,
uart_suspend_port() and enable_irq_wake() is never called; so the UART
interrupt is masked by check_wakeup_irqs() and the UART can't wake up
the MPU.

The remaining mechanism that could have awakened the system would have
been I/O chain wakeups.  These wouldn't be active because the console
UART's clocks are never disabled when no_console_suspend is used,
preventing the full chip from idling.  Also, current mainline doesn't
yet support full chip idle states for OMAP4, so I/O chain wakeups are
not enabled.

This patch is the result of a collaboration.  John Stultz
<johnstul@us.ibm.com> and Andy Green <andy.green@linaro.org> reported
the serial wakeup problem that led to the discovery of this problem.
Kevin Hilman <khilman@ti.com> narrowed the problem down to the use of
no_console_suspend.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: John Stultz <johnstul@us.ibm.com>
Cc: Andy Green <andy.green@linaro.org>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
2012-03-05 15:38:02 -08:00
..
boot Merge branch 'v3.3-samsung-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into fixes 2012-02-13 05:50:26 +00:00
common ARM: 7293/1: logical_cpu_map: decouple CPU mapping from SMP 2012-01-23 10:20:05 +00:00
configs Consolidate i.MX 5 platforms to be under the new shared i.MX 3/5/6 tree. 2012-01-23 14:50:30 -08:00
include/asm Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
kernel Merge remote-tracking branch 'omap/hsmmc' into for_3.4/cleanup/pm-base 2012-03-05 15:37:04 -08:00
lib ARM: 7301/1: Rename the T() macro to TUSER() to avoid namespace conflicts 2012-01-25 11:07:40 +00:00
mach-at91 Merge remote-tracking branch 'omap/hsmmc' into for_3.4/cleanup/pm-base 2012-03-05 15:37:04 -08:00
mach-bcmring Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-clps711x Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-cns3xxx Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-davinci Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-dove Merge remote-tracking branch 'omap/hsmmc' into for_3.4/cleanup/pm-base 2012-03-05 15:37:04 -08:00
mach-ebsa110 Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-ep93xx Merge remote-tracking branch 'omap/hsmmc' into for_3.4/cleanup/pm-base 2012-03-05 15:37:04 -08:00
mach-exynos Merge remote-tracking branch 'omap/hsmmc' into for_3.4/cleanup/pm-base 2012-03-05 15:37:04 -08:00
mach-footbridge Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-gemini Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-h720x Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-highbank Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-imx Linux 3.3-rc2 2012-02-07 15:05:20 -08:00
mach-integrator Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-iop13xx Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-iop32x Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-iop33x Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-ixp4xx Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-ixp23xx Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-ixp2000 Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-kirkwood Merge remote-tracking branch 'omap/hsmmc' into for_3.4/cleanup/pm-base 2012-03-05 15:37:04 -08:00
mach-ks8695 Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-l7200/include/mach
mach-lpc32xx Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-mmp Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-msm Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-mv78xx0 Merge remote-tracking branch 'omap/hsmmc' into for_3.4/cleanup/pm-base 2012-03-05 15:37:04 -08:00
mach-mxs Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-netx Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-nomadik Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-omap1 Merge branch 'iomap' into cleanup 2012-02-28 14:27:01 -08:00
mach-omap2 ARM: OMAP2+: PM debug: fix the use of debugfs_create_* API 2012-03-05 15:38:02 -08:00
mach-orion5x Merge remote-tracking branch 'omap/hsmmc' into for_3.4/cleanup/pm-base 2012-03-05 15:37:04 -08:00
mach-picoxcell Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-pnx4008 Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-prima2 Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-pxa Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-realview Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-rpc Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-s3c64xx Merge remote-tracking branch 'omap/hsmmc' into for_3.4/cleanup/pm-base 2012-03-05 15:37:04 -08:00
mach-s3c2410 Merge remote-tracking branch 'omap/hsmmc' into for_3.4/cleanup/pm-base 2012-03-05 15:37:04 -08:00
mach-s3c2412 Merge remote-tracking branch 'omap/hsmmc' into for_3.4/cleanup/pm-base 2012-03-05 15:37:04 -08:00
mach-s3c2416 Merge remote-tracking branch 'omap/hsmmc' into for_3.4/cleanup/pm-base 2012-03-05 15:37:04 -08:00
mach-s3c2440 ARM: SAMSUNG: Fix missing api-change from subsys_interface change 2012-01-27 15:35:47 +09:00
mach-s3c2443 ARM: SAMSUNG: Fix missing api-change from subsys_interface change 2012-01-27 15:35:47 +09:00
mach-s5p64x0 Merge remote-tracking branch 'omap/hsmmc' into for_3.4/cleanup/pm-base 2012-03-05 15:37:04 -08:00
mach-s5pc100 Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-s5pv210 Merge remote-tracking branch 'omap/hsmmc' into for_3.4/cleanup/pm-base 2012-03-05 15:37:04 -08:00
mach-sa1100 Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-shark Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-shmobile Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-spear3xx Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-spear6xx Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-tegra Merge remote-tracking branch 'omap/hsmmc' into for_3.4/cleanup/pm-base 2012-03-05 15:37:04 -08:00
mach-u300 Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-ux500 Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-versatile Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-vexpress Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-vt8500 Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-w90x900 Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mach-zynq Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
mm ARM: 7321/1: cache-v7: Disable preemption when reading CCSIDR 2012-02-09 16:25:37 +00:00
nwfpe
oprofile oprofile, arm/sh: Fix oprofile_arch_exit() linkage issue 2011-12-23 11:58:34 +01:00
plat-iop Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci 2012-01-11 18:50:26 -08:00
plat-mxc Merge branch 'entry-macro-cleanup' of git://sources.calxeda.com/kernel/linux into for-armsoc 2012-02-22 22:04:41 +00:00
plat-nomadik Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma 2012-01-17 18:40:24 -08:00
plat-omap ARM: OMAP2+: omap_device: call all suspend, resume callbacks when OMAP_DEVICE_NO_IDLE_ON_SUSPEND is set 2012-03-05 15:38:02 -08:00
plat-orion ARM: orion: Fix USB phy for orion5x. 2012-02-09 16:16:35 -08:00
plat-pxa
plat-s3c24xx ARM: s3c24xx: move special idle code to out of line 2012-01-20 18:55:13 -05:00
plat-s5p Merge branch 'driver-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core 2012-01-07 12:03:30 -08:00
plat-samsung ARM: SAMSUNG: Fix platform data setup for I2C adapter 0 2012-01-27 14:51:21 +09:00
plat-spear ARM: big removal of now unused arch_idle() 2012-01-20 19:25:58 -05:00
plat-versatile ARM: 7293/1: logical_cpu_map: decouple CPU mapping from SMP 2012-01-23 10:20:05 +00:00
tools ARM: Update mach-types 2011-12-23 22:58:10 +00:00
vfp
Kconfig ARM: make arch_ret_to_user macro optional 2012-02-21 17:04:10 -06:00
Kconfig-nommu
Kconfig.debug ARM: debug: arrange Kconfig options more logically 2012-01-20 10:50:46 +00:00
Makefile Consolidate i.MX 5 platforms to be under the new shared i.MX 3/5/6 tree. 2012-01-23 14:50:30 -08:00