From: Tomi Valkeinen Date: Fri, 12 Dec 2008 07:48:53 +0000 (+0200) Subject: OMAP: wait for pwrdm transition after clk_enable() X-Git-Tag: v2.6.28-omap1~63 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=eda8b6ad2a27d08b84565c4c4e6bd16bdcdf5396;p=linux-2.6-omap-h63xx.git OMAP: wait for pwrdm transition after clk_enable() Enabling clock in a disabled power domain causes the power domain to be turned on. However, the power transition is not always finished when clk_enable() returns and this randomly crashes the kernel when an interrupt happens right after the clk_enable, and the kernel tries to read the irq status register for that domain. Why the irq status register is inaccessible, I don't know. Also it doesn't seem to be related to the module being not powered up, but to the transition itself. The same could perhaps happen after clk_disable also, but I have not witnessed that. The problem affects at least dss, cam and sgx clocks. This change waits for the transition to be finished before returning from omap2_clkdm_clk_enable(). Signed-off-by: Tomi Valkeinen Acked-by: Paul Walmsley Signed-off-by: Tony Lindgren --- diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c index fa62f14de2a..f713d0b9cbc 100644 --- a/arch/arm/mach-omap2/clockdomain.c +++ b/arch/arm/mach-omap2/clockdomain.c @@ -567,6 +567,8 @@ int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk) else omap2_clkdm_wakeup(clkdm); + pwrdm_wait_transition(clkdm->pwrdm.ptr); + return 0; }