diff options
author | Magnus Damm <damm@opensource.se> | 2011-11-09 18:44:10 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2011-11-09 18:44:10 -0500 |
commit | 24050956e029a9ecff096e1992869ada4492963c (patch) | |
tree | 096341c4741fcc967645578af0acb277f9754501 /drivers/base/power/clock_ops.c | |
parent | 056879d2f244001b2888cdc8cf868c33ca8b23a0 (diff) |
PM / Clocks: Only disable enabled clocks in pm_clk_suspend()
Refrain from running clk_disable() on clocks that
have not been enabled. A typical case when this can
happen is during Suspend-to-RAM for devices that have
no driver associated with them. In such case the clock
may be in default ACQUIRED state.
Without this patch the sh7372 Mackerel board crashes
in __clk_disable() during Suspend-to-RAM with:
"Trying to disable clock 0xdeadbeef with 0 usecount"
This happens for the CEU device which is added during
boot. The test case has no CEU driver included in the
kernel configuration. Needed for v3.2-rc1.
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'drivers/base/power/clock_ops.c')
-rw-r--r-- | drivers/base/power/clock_ops.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c index 5f0f85d5c576..428e55e012dc 100644 --- a/drivers/base/power/clock_ops.c +++ b/drivers/base/power/clock_ops.c | |||
@@ -229,7 +229,8 @@ int pm_clk_suspend(struct device *dev) | |||
229 | 229 | ||
230 | list_for_each_entry_reverse(ce, &psd->clock_list, node) { | 230 | list_for_each_entry_reverse(ce, &psd->clock_list, node) { |
231 | if (ce->status < PCE_STATUS_ERROR) { | 231 | if (ce->status < PCE_STATUS_ERROR) { |
232 | clk_disable(ce->clk); | 232 | if (ce->status == PCE_STATUS_ENABLED) |
233 | clk_disable(ce->clk); | ||
233 | ce->status = PCE_STATUS_ACQUIRED; | 234 | ce->status = PCE_STATUS_ACQUIRED; |
234 | } | 235 | } |
235 | } | 236 | } |