]> Pileus Git - ~andy/linux/commitdiff
OMAP2+: hwmod: Enable module in shutdown to access sysconfig
authorMiguel Vadillo <vadillo@ti.com>
Fri, 1 Jul 2011 20:54:02 +0000 (22:54 +0200)
committerPaul Walmsley <paul@pwsan.com>
Sun, 10 Jul 2011 01:13:35 +0000 (19:13 -0600)
When calling the shutdown, the module may be already in idle.
Accessing the sysconfig register will then lead to a crash.
In that case, re-enable the module in order to allow the access
to the sysconfig register.

Signed-off-by: Miguel Vadillo <vadillo@ti.com>
Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
arch/arm/mach-omap2/omap_hwmod.c

index 384d3c3ec36d22890c9e0787476ba5d127bb4c87..cbc2a8a4ce39b4d730c63b770cbd6da8ecec2d29 100644 (file)
@@ -1396,8 +1396,11 @@ static int _shutdown(struct omap_hwmod *oh)
                }
        }
 
-       if (oh->class->sysc)
+       if (oh->class->sysc) {
+               if (oh->_state == _HWMOD_STATE_IDLE)
+                       _enable(oh);
                _shutdown_sysc(oh);
+       }
 
        /*
         * If an IP contains only one HW reset line, then assert it