clocksource: Fix up a registration/IRQ race in the sh drivers.
authorPaul Mundt <lethal@linux-sh.org>
Thu, 25 Feb 2010 07:37:46 +0000 (16:37 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Thu, 25 Feb 2010 07:37:46 +0000 (16:37 +0900)
commitda64c2a8dee66ca03f4f3e15d84be7bedf73db3d
tree8de9d4de358447a80f731a49a689c84bca42abf5
parent29463c28a553e1959ec45cc8ad9d2eb434663cdf
clocksource: Fix up a registration/IRQ race in the sh drivers.

All of the SH clocksource drivers follow the scheme that the IRQ is setup
prior to registering the clockevent. The interrupt handler in the
clockevent cases looks to the event handler function pointer being filled
in by the registration code, permitting us to get in to situations where
asserted IRQs step in to the handler before registration has had a chance
to complete and hitting a NULL pointer deref.

In practice this is not an issue for most platforms, but some of them
with fairly special loaders (or that are chain-loading from another
kernel) may enter in to this situation. This fixes up the oops reported
by Rafael on hp6xx.

Reported-and-tested-by: Rafael Ignacio Zurita <rafaelignacio.zurita@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
drivers/clocksource/sh_cmt.c
drivers/clocksource/sh_mtu2.c
drivers/clocksource/sh_tmu.c