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
board-3430sdp.c
board-3630sdp.c
board-4430sdp.c
board-am3517evm.c
board-apollon.c
board-cm-t35.c
board-cm-t3517.c
board-devkit8000.c
board-flash.c
board-flash.h
board-generic.c
board-h4.c
board-igep0020.c
board-igep0030.c
board-ldp.c
board-n8x0.c
board-omap3beagle.c
board-omap3evm.c
board-omap3logic.c
board-omap3pandora.c
board-omap3stalker.c
board-omap3touchbook.c
board-omap4panda.c
board-overo.c
board-rx51-peripherals.c
board-rx51-sdram.c
board-rx51-video.c
board-rx51.c
board-zoom2.c
board-zoom3.c
board-zoom-debugboard.c
board-zoom-peripherals.c
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
clock3xxx.c
clock3xxx.h
clock34xx.c
clock34xx.h
clock36xx.c
clock36xx.h
clock44xx_data.c
clock44xx.h
clock2420_data.c
clock2430_data.c
clock2430.c
clock3517.c
clock3517.h
clock_common_data.c
clock.c
clock.h
clockdomain.c
clockdomains44xx.h
clockdomains.h
cm4xxx.c
cm44xx.h
cm-regbits-24xx.h
cm-regbits-34xx.h
cm-regbits-44xx.h
cm.c
cm.h
common.c
control.c
control.h
cpuidle34xx.c
devices.c
dpll3xxx.c
dsp.c
emu.c
gpmc-nand.c
gpmc-onenand.c
gpmc-smc91x.c
gpmc-smsc911x.c
gpmc.c
hsmmc.c
hsmmc.h
i2c.c
id.c
io.c
io.h
iommu2.c
irq.c
Kconfig
mailbox.c
Makefile
Makefile.boot
mcbsp.c
mux34xx.c
mux34xx.h
mux2420.c
mux2420.h
mux2430.c
mux2430.h
mux.c
mux.h
omap4-common.c
omap44xx-smc.S
omap_hwmod_3xxx_data.c
omap_hwmod_44xx_data.c
omap_hwmod_2420_data.c
omap_hwmod_2430_data.c
omap_hwmod_common_data.c
omap_hwmod_common_data.h
omap_hwmod.c
omap-headsmp.S
omap-hotplug.c
omap-iommu.c
omap-smp.c
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
pm-debug.c
pm.c
pm.h
powerdomain.c
powerdomains24xx.h
powerdomains34xx.h
powerdomains44xx.h
powerdomains.h
prcm-common.h
prcm.c
prm2xxx_3xxx.c
prm44xx.c
prm44xx.h
prm-regbits-24xx.h
prm-regbits-34xx.h
prm-regbits-44xx.h
prm.h
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
sram34xx.S
sram242x.S
sram243x.S
timer-gp.c
timer-gp.h
timer-mpu.c
usb-ehci.c
usb-fs.c
usb-musb.c
usb-tusb6010.c