Skip to contentSkip to conversation

drivers: sh: resume enabled clocks fix

PATCH In review Magnus Damm 2 participants 2 messages Jun 13, 2011 SuperH

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers: sh: resume enabled clocks fix

From: Magnus Damm <[email protected]>

Extend the SH / SH-Mobile ARM clock framework to only resume clocks that has been enabled.

Without this fix divide-by-zero is triggering on sh7372 FSIDIV during system wide resume of Suspend-to-RAM.

---

This is a rewrite of the patch recently posted as:
"[PATCH] ARM: mach-shmobile: sh7372 divide-by-zero FSIDIV fix"

 drivers/sh/clk/core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/sh/clk/core.c +1 -1
@@ -635,7 +635,7 @@ static void clks_core_resume(void)
 	struct clk *clkp;
 
 	list_for_each_entry(clkp, &clock_list, node) {
-		if (likely(clkp->ops)) {
+		if (likely(clkp->usecount && clkp->ops)) {
 			unsigned long rate = clkp->rate;
 
 			if (likely(clkp->ops->set_parent))
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Magnus Damm

From: Magnus Damm <[email protected]>

Extend the SH / SH-Mobile ARM clock framework to only resume clocks that has been enabled.

Without this fix divide-by-zero is triggering on sh7372 FSIDIV during system wide resume of Suspend-to-RAM.

Quoted 8 lines

---

This is a rewrite of the patch recently posted as:
"[PATCH] ARM: mach-shmobile: sh7372 divide-by-zero FSIDIV fix"

 drivers/sh/clk/core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

I much prefer this to the approach that was in "[PATCH] ARM: mach-shmobile: sh7372 divide-by-zero FSIDIV fix".

Quoted 17 lines
drivers/sh/clk/core.c +1 -2
@@ -635,7 +635,7 @@ static void clks_core_resume(void)
 	struct clk *clkp;
 
 	list_for_each_entry(clkp, &clock_list, node) {
-		if (likely(clkp->ops)) {
+		if (likely(clkp->usecount && clkp->ops)) {
 			unsigned long rate = clkp->rate;
 
 			if (likely(clkp->ops->set_parent))
--

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