diff options
author | Paul Mundt <lethal@linux-sh.org> | 2011-05-31 02:23:20 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-05-31 02:23:20 -0400 |
commit | d4905ce38c73964b868037e49a5945e1cf47a7f2 (patch) | |
tree | f7b41c1720dabb7b14a92ff0c47aeff1d6e4d70f /drivers/clocksource | |
parent | db7eba292e913390fa881272bfbc3da0a5380513 (diff) |
Revert "clocksource: sh_tmu: Runtime PM support"
This reverts commit 1b842e91fea9447eff5eb687e28ad61c02f5033e.
There is a fundamental ordering race between the early and late probe
paths and the runtime PM tie-in that results in __pm_runtime_resume()
attempting to take a lock that hasn't been initialized yet (which by
proxy also suggests that pm_runtime_init() hasn't yet been run on the
device either, making the entire thing unsafe) -- resulting in instant
death on SMP or on UP with spinlock debugging enabled:
sh_tmu.0: used for clock events
sh_tmu.0: used for periodic clock events
BUG: spinlock trylock failure on UP on CPU#0, swapper/0
lock: 804db198, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0
...
Revert it for now until the ordering issues can be resolved, or we can get
some more help from the runtime PM framework to make this possible.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/clocksource')
-rw-r--r-- | drivers/clocksource/sh_tmu.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/clocksource/sh_tmu.c b/drivers/clocksource/sh_tmu.c index 17296288a205..808135768617 100644 --- a/drivers/clocksource/sh_tmu.c +++ b/drivers/clocksource/sh_tmu.c | |||
@@ -25,7 +25,6 @@ | |||
25 | #include <linux/delay.h> | 25 | #include <linux/delay.h> |
26 | #include <linux/io.h> | 26 | #include <linux/io.h> |
27 | #include <linux/clk.h> | 27 | #include <linux/clk.h> |
28 | #include <linux/pm_runtime.h> | ||
29 | #include <linux/irq.h> | 28 | #include <linux/irq.h> |
30 | #include <linux/err.h> | 29 | #include <linux/err.h> |
31 | #include <linux/clocksource.h> | 30 | #include <linux/clocksource.h> |
@@ -110,12 +109,10 @@ static int sh_tmu_enable(struct sh_tmu_priv *p) | |||
110 | { | 109 | { |
111 | int ret; | 110 | int ret; |
112 | 111 | ||
113 | /* wake up device and enable clock */ | 112 | /* enable clock */ |
114 | pm_runtime_get_sync(&p->pdev->dev); | ||
115 | ret = clk_enable(p->clk); | 113 | ret = clk_enable(p->clk); |
116 | if (ret) { | 114 | if (ret) { |
117 | dev_err(&p->pdev->dev, "cannot enable clock\n"); | 115 | dev_err(&p->pdev->dev, "cannot enable clock\n"); |
118 | pm_runtime_put_sync(&p->pdev->dev); | ||
119 | return ret; | 116 | return ret; |
120 | } | 117 | } |
121 | 118 | ||
@@ -144,9 +141,8 @@ static void sh_tmu_disable(struct sh_tmu_priv *p) | |||
144 | /* disable interrupts in TMU block */ | 141 | /* disable interrupts in TMU block */ |
145 | sh_tmu_write(p, TCR, 0x0000); | 142 | sh_tmu_write(p, TCR, 0x0000); |
146 | 143 | ||
147 | /* stop clock and mark device as idle */ | 144 | /* stop clock */ |
148 | clk_disable(p->clk); | 145 | clk_disable(p->clk); |
149 | pm_runtime_put_sync(&p->pdev->dev); | ||
150 | } | 146 | } |
151 | 147 | ||
152 | static void sh_tmu_set_next(struct sh_tmu_priv *p, unsigned long delta, | 148 | static void sh_tmu_set_next(struct sh_tmu_priv *p, unsigned long delta, |
@@ -415,7 +411,6 @@ static int __devinit sh_tmu_probe(struct platform_device *pdev) | |||
415 | 411 | ||
416 | if (p) { | 412 | if (p) { |
417 | dev_info(&pdev->dev, "kept as earlytimer\n"); | 413 | dev_info(&pdev->dev, "kept as earlytimer\n"); |
418 | pm_runtime_enable(&pdev->dev); | ||
419 | return 0; | 414 | return 0; |
420 | } | 415 | } |
421 | 416 | ||
@@ -430,9 +425,6 @@ static int __devinit sh_tmu_probe(struct platform_device *pdev) | |||
430 | kfree(p); | 425 | kfree(p); |
431 | platform_set_drvdata(pdev, NULL); | 426 | platform_set_drvdata(pdev, NULL); |
432 | } | 427 | } |
433 | |||
434 | if (!is_early_platform_device(pdev)) | ||
435 | pm_runtime_enable(&pdev->dev); | ||
436 | return ret; | 428 | return ret; |
437 | } | 429 | } |
438 | 430 | ||