1
linux/arch/arm/mach-omap2
Paul Walmsley 0d8e2d0dad OMAP2+: PM/serial: hold console semaphore while OMAP UARTs are disabled
The console semaphore must be held while the OMAP UART devices are
disabled, lest a console write cause an ARM abort (and a kernel crash)
when the underlying console device is inaccessible.  These crashes
only occur when the console is on one of the OMAP internal serial
ports.

While this problem has been latent in the PM idle loop for some time,
the crash was not triggerable with an unmodified kernel until commit
6f251e9db1 ("OMAP: UART: omap_device
conversions, remove implicit 8520 assumptions").  After this patch, a
console write often occurs after the console UART has been disabled in
the idle loop, crashing the system.  Several users have encountered
this bug:

    http://www.mail-archive.com/linux-omap@vger.kernel.org/msg38396.html

    http://www.mail-archive.com/linux-omap@vger.kernel.org/msg36602.html

The same commit also introduced new code that disabled the UARTs
during init, in omap_serial_init_port().  The kernel will also crash
in this code when earlyconsole and extra debugging is enabled:

    http://www.mail-archive.com/linux-omap@vger.kernel.org/msg36411.html

The minimal fix for the -rc series is to hold the console semaphore
while the OMAP UARTs are disabled.  This is a somewhat overbroad fix,
since the console may not be located on an OMAP UART, as is the case
with the GPMC UART on Zoom3.  While it is technically possible to
determine which devices the console or earlyconsole is actually
running on, it is not a trivial problem to solve, and the code to do
so is not really appropriate for the -rc series.

The right long-term fix is to ensure that no code outside of the OMAP
serial driver can disable an OMAP UART.  As I understand it, code to
implement this is under development by TI.

This patch is a collaboration between Paul Walmsley <paul@pwsan.com>
and Tony Lindgren <tony@atomide.com>.  Thanks to Ming Lei
<tom.leiming@gmail.com> and Pramod <pramod.gurav@ti.com> for their
feedback on earlier versions of this patch.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Ming Lei <tom.leiming@gmail.com>
Cc: Pramod <pramod.gurav@ti.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Jean Pihet <jean.pihet@newoldbits.com>
Cc: Govindraj.R <govindraj.raja@ti.com>
2010-11-24 16:14:30 -08:00
..
include/mach ARM: 6484/1: fix compile warning in mm/init.c 2010-11-21 22:05:56 +00:00
board-2430sdp.c Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 2010-10-25 13:46:56 -07:00
board-3430sdp.c Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 2010-10-25 13:46:56 -07:00
board-3630sdp.c Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 2010-10-25 13:46:56 -07:00
board-4430sdp.c mfd: Adding twl6030 mmc card detect support for MMC1 2010-10-29 00:29:59 +02:00
board-am3517evm.c Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 2010-10-25 13:46:56 -07:00
board-apollon.c Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 2010-10-25 13:46:56 -07:00
board-cm-t35.c Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 2010-10-25 13:46:56 -07:00
board-cm-t3517.c omap: complete removal of machine_desc.io_pg_offst and .phys_io 2010-10-22 12:14:12 -07:00
board-devkit8000.c OMAP2: Devkit8000: Fix mmc regulator failure 2010-11-05 12:13:10 -07:00
board-flash.c OMAP2plus: Fix static function warnings 2010-10-08 10:02:49 -07:00
board-flash.h OMAP2plus: Fix static function warnings 2010-10-08 10:02:49 -07:00
board-generic.c Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 2010-10-25 13:46:56 -07:00
board-h4.c Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 2010-10-25 13:46:56 -07:00
board-igep0020.c Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 2010-10-25 13:46:56 -07:00
board-igep0030.c omap: complete removal of machine_desc.io_pg_offst and .phys_io 2010-10-22 12:14:12 -07:00
board-ldp.c Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 2010-10-25 13:46:56 -07:00
board-n8x0.c Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 2010-10-25 13:46:56 -07:00
board-omap3beagle.c Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 2010-10-25 13:46:56 -07:00
board-omap3evm.c Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 2010-10-25 13:46:56 -07:00
board-omap3logic.c omap: complete removal of machine_desc.io_pg_offst and .phys_io 2010-10-22 12:14:12 -07:00
board-omap3pandora.c Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 2010-10-25 13:46:56 -07:00
board-omap3stalker.c Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 2010-10-25 13:46:56 -07:00
board-omap3touchbook.c Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 2010-10-25 13:46:56 -07:00
board-omap4panda.c omap4: pandaboard: fix up mmc card detect logic 2010-10-29 00:30:32 +02:00
board-overo.c Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 2010-10-25 13:46:56 -07:00
board-rx51-peripherals.c Merge git://git.infradead.org/battery-2.6 2010-10-26 10:14:23 -07:00
board-rx51-sdram.c OMAP: mach-omap2: Fix static declaration warnings 2010-10-08 09:57:40 -07:00
board-rx51-video.c OMAP2plus: Fix static function warnings 2010-10-08 10:02:49 -07:00
board-rx51.c arm: remove machine_desc.io_pg_offst and .phys_io 2010-10-20 00:27:46 -04:00
board-zoom2.c Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 2010-10-25 13:46:56 -07:00
board-zoom3.c Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 2010-10-25 13:46:56 -07:00
board-zoom-debugboard.c OMAP2plus: Fix static function warnings 2010-10-08 10:02:49 -07:00
board-zoom-peripherals.c Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 2010-10-25 13:46:56 -07:00
clkt2xxx_apll.c
clkt2xxx_dpllcore.c
clkt2xxx_osc.c
clkt2xxx_sys.c
clkt2xxx_virt_prcm_set.c
clkt34xx_dpll3m2.c
clkt_clksel.c
clkt_dpll.c
clock2xxx.c
clock2xxx.h
clock3xxx_data.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2010-10-24 12:44:34 -07:00
clock3xxx.c
clock3xxx.h
clock34xx.c
clock34xx.h
clock36xx.c
clock36xx.h
clock44xx_data.c OMAP: control: move plat-omap/control.h to mach-omap2/control.h 2010-10-08 11:40:20 -06:00
clock44xx.h
clock2420_data.c OMAP: control: move plat-omap/control.h to mach-omap2/control.h 2010-10-08 11:40:20 -06:00
clock2430_data.c OMAP: control: move plat-omap/control.h to mach-omap2/control.h 2010-10-08 11:40:20 -06:00
clock2430.c
clock3517.c
clock3517.h
clock_common_data.c
clock.c OMAP2+: clock: reduce the amount of standard debugging while disabling unused clocks 2010-10-08 11:40:20 -06:00
clock.h
clockdomain.c OMAP clockdomain: initialize clockdomain registers when the clockdomain layer starts 2010-09-23 17:14:12 -07:00
clockdomains44xx.h
clockdomains.h
cm4xxx.c OMAP4: PM: Declare idle modules as functional too 2010-09-24 10:23:18 -06:00
cm44xx.h OMAP4: PM: Define additional registers for ES2 2010-09-27 14:02:56 -06:00
cm-regbits-24xx.h
cm-regbits-34xx.h OMAP3: PRCM: Consider UART4 for 3630 chip in prcm_setup_regs 2010-09-29 12:43:00 -07:00
cm-regbits-44xx.h OMAP4: CM & PRM: Update PRCM register bitshifts and masks for ES2 2010-09-27 14:02:55 -06:00
cm.c
cm.h
common.c OMAP: control: move plat-omap/control.h to mach-omap2/control.h 2010-10-08 11:40:20 -06:00
control.c OMAP: control: move plat-omap/control.h to mach-omap2/control.h 2010-10-08 11:40:20 -06:00
control.h OMAP: control: move plat-omap/control.h to mach-omap2/control.h 2010-10-08 11:40:20 -06:00
cpuidle34xx.c OMAP: control: move plat-omap/control.h to mach-omap2/control.h 2010-10-08 11:40:20 -06:00
devices.c Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 2010-10-25 13:46:56 -07:00
dpll3xxx.c
dsp.c omap: add dsp platform device 2010-10-05 12:05:11 -07:00
emu.c
gpmc-nand.c omap3 nand: cleanup virtual address usages 2010-08-02 15:30:38 +03:00
gpmc-onenand.c
gpmc-smc91x.c
gpmc-smsc911x.c ARM: OMAP3LOGIC: Add generic smsc911x support when connected to GPMC 2010-09-28 11:39:18 -07:00
gpmc.c omap3 nand: cleanup virtual address usages 2010-08-02 15:30:38 +03:00
hsmmc.c OMAP: control: move plat-omap/control.h to mach-omap2/control.h 2010-10-08 11:40:20 -06:00
hsmmc.h Merge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 2010-10-25 13:46:56 -07:00
i2c.c
id.c OMAP: control: move plat-omap/control.h to mach-omap2/control.h 2010-10-08 11:40:20 -06:00
io.c OMAP: plat-omap: Fix static function warnings 2010-10-08 10:12:38 -07:00
io.h OMAP: plat-omap: Fix static function warnings 2010-10-08 10:12:38 -07:00
iommu2.c
irq.c OMAP: mach-omap2: Fix miscellaneous sparse warnings 2010-10-08 10:12:37 -07:00
Kconfig OMAP2+: Kconfig: disallow builds for boards that don't use the currently-selected SoC 2010-10-08 11:40:17 -06:00
mailbox.c arm: remove cast from void* 2010-09-28 09:54:28 -07:00
Makefile Merge 'staging-next' to Linus's tree 2010-10-28 09:44:56 -07:00
Makefile.boot
mcbsp.c OMAP: McBSP: Remove null omap44xx ops comment 2010-10-08 11:40:21 -06:00
mux34xx.c OMAP: mach-omap2: Fix static declaration warnings 2010-10-08 09:57:40 -07:00
mux34xx.h
mux2420.c OMAP: mach-omap2: Fix static declaration warnings 2010-10-08 09:57:40 -07:00
mux2420.h
mux2430.c OMAP: mach-omap2: Fix static declaration warnings 2010-10-08 09:57:40 -07:00
mux2430.h
mux.c OMAP: control: move plat-omap/control.h to mach-omap2/control.h 2010-10-08 11:40:20 -06:00
mux.h omap: Fix omap_mux_init_signal not to trash muxname 2010-10-01 16:35:24 -07:00
omap4-common.c Merge branch 'l2x0-pull-rmk' of git://dev.omapzoom.org/pub/scm/santosh/kernel-omap4-base into devel-stable 2010-10-28 14:42:06 +01:00
omap44xx-smc.S
omap_hwmod_3xxx_data.c manual merge for pm-hwmod-uart due to conflicts 2010-10-01 13:24:10 -07:00
omap_hwmod_44xx_data.c manual merge for pm-hwmod-uart due to conflicts 2010-10-01 13:24:10 -07:00
omap_hwmod_2420_data.c manual merge for pm-hwmod-uart due to conflicts 2010-10-01 13:24:10 -07:00
omap_hwmod_2430_data.c manual merge for pm-hwmod-uart due to conflicts 2010-10-01 13:24:10 -07:00
omap_hwmod_common_data.c
omap_hwmod_common_data.h
omap_hwmod.c omap: hwmod: Handle modules with 16bit registers 2010-10-08 10:23:22 -07:00
omap-headsmp.S
omap-hotplug.c
omap-iommu.c
omap-smp.c omap: Fix sev instruction usage for multi-omap 2010-08-16 09:22:04 +03:00
opp2xxx.h
opp2420_data.c
opp2430_data.c
pm24xx.c OMAP2+: PM/serial: hold console semaphore while OMAP UARTs are disabled 2010-11-24 16:14:30 -08:00
pm34xx.c OMAP2+: PM/serial: hold console semaphore while OMAP UARTs are disabled 2010-11-24 16:14:30 -08:00
pm44xx.c
pm_bus.c OMAP2+: PM: initial runtime PM core support 2010-09-21 11:51:23 -07:00
pm-debug.c OMAP: mach-omap2: Fix static declaration warnings 2010-10-08 09:57:40 -07:00
pm.c OMAP4: pm: Change l3_main to l3_main_1 during bus device init 2010-09-23 17:14:16 -07:00
pm.h OMAP: PM: Fix build when CONFIG_PM_DEBUG isn't set 2010-10-01 13:50:34 -07:00
powerdomain.c OMAP2: powerdomain: Add break in switch statement 2010-08-03 10:21:07 +03:00
powerdomains24xx.h
powerdomains34xx.h omap: 3630: disable TLL SAR on 3630 ES1 2010-08-04 14:43:52 +03:00
powerdomains44xx.h OMAP4: powerdomain: Update DSS logic state for ES2 2010-09-27 14:02:56 -06:00
powerdomains.h
prcm-common.h OMAP3: PRCM: Consider UART4 for 3630 chip in prcm_setup_regs 2010-09-29 12:43:00 -07:00
prcm.c OMAP: control: move plat-omap/control.h to mach-omap2/control.h 2010-10-08 11:40:20 -06:00
prm2xxx_3xxx.c OMAP2/3: PRM: add module hard reset support 2010-09-21 15:12:40 -06:00
prm44xx.c OMAP4: PRM: add module hard reset support 2010-09-21 15:12:21 -06:00
prm44xx.h OMAP4: PM: Define additional registers for ES2 2010-09-27 14:02:56 -06:00
prm-regbits-24xx.h
prm-regbits-34xx.h OMAP3: PRCM: Consider UART4 for 3630 chip in prcm_setup_regs 2010-09-29 12:43:00 -07:00
prm-regbits-44xx.h OMAP4: CM & PRM: Update PRCM register bitshifts and masks for ES2 2010-09-27 14:02:55 -06:00
prm.h OMAP2/3: PRM: add module hard reset support 2010-09-21 15:12:40 -06:00
sdram-hynix-h8mbx00u0mer-0em.h
sdram-micron-mt46h32m32lf-6.h
sdram-numonyx-m65kxxxxam.h
sdram-qimonda-hyb18m512160af-6.h
sdrc2xxx.c
sdrc.c
sdrc.h
serial.c OMAP2+: PM/serial: hold console semaphore while OMAP UARTs are disabled 2010-11-24 16:14:30 -08:00
sleep24xx.S
sleep34xx.S OMAP: control: move plat-omap/control.h to mach-omap2/control.h 2010-10-08 11:40:20 -06:00
sram34xx.S omap3: Prevent SDRC deadlock when L3 is changing frequency 2010-09-27 14:02:59 -06:00
sram242x.S
sram243x.S
timer-gp.c OMAP2plus: Fix static function warnings 2010-10-08 10:02:49 -07:00
timer-gp.h OMAP2plus: Fix static function warnings 2010-10-08 10:02:49 -07:00
timer-mpu.c
usb-ehci.c
usb-fs.c OMAP: control: move plat-omap/control.h to mach-omap2/control.h 2010-10-08 11:40:20 -06:00
usb-musb.c USB: AM35x: Add musb support 2010-10-22 10:22:16 -07:00
usb-tusb6010.c