From: Miguel Vadillo <[email protected]>

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 <[email protected]>
Signed-off-by: Benoit Cousson <[email protected]>
Cc: Paul Walmsley <[email protected]>
---
 arch/arm/mach-omap2/omap_hwmod.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 384d3c3..cbc2a8a 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -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
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to