* [PATCH] amba: be more careful in runtime_suspend/resume
@ 2011-10-18 12:24 Linus Walleij
2011-10-18 12:29 ` Russell King - ARM Linux
0 siblings, 1 reply; 3+ messages in thread
From: Linus Walleij @ 2011-10-18 12:24 UTC (permalink / raw)
To: linux-arm-kernel
From: Linus Walleij <linus.walleij@linaro.org>
This checks that a valid pclk actually was retrieved before
trying to disable/enable it in the runtime PM hooks on the
PrimeCell bus.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
drivers/amba/bus.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index bd230e8..57c33b9 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -378,7 +378,7 @@ static int amba_pm_runtime_suspend(struct device *dev)
int ret = pm_generic_runtime_suspend(dev);
if (ret == 0 && dev->driver)
- clk_disable(pcdev->pclk);
+ amba_pclk_disable(pcdev);
return ret;
}
@@ -388,8 +388,8 @@ static int amba_pm_runtime_resume(struct device *dev)
struct amba_device *pcdev = to_amba_device(dev);
int ret;
- if (dev->driver) {
- ret = clk_enable(pcdev->pclk);
+ if (dev->driver && !IS_ERR(pcdev->pclk)) {
+ ret = amba_pclk_enable(pcdev->pclk);
/* Failure is probably fatal to the system, but... */
if (ret)
return ret;
--
1.7.3.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] amba: be more careful in runtime_suspend/resume
2011-10-18 12:24 [PATCH] amba: be more careful in runtime_suspend/resume Linus Walleij
@ 2011-10-18 12:29 ` Russell King - ARM Linux
2011-10-18 12:30 ` Linus Walleij
0 siblings, 1 reply; 3+ messages in thread
From: Russell King - ARM Linux @ 2011-10-18 12:29 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Oct 18, 2011 at 02:24:50PM +0200, Linus Walleij wrote:
> From: Linus Walleij <linus.walleij@linaro.org>
>
> This checks that a valid pclk actually was retrieved before
> trying to disable/enable it in the runtime PM hooks on the
> PrimeCell bus.
This isn't necessary - we only enable runtime-pm after the pclk has been
obtained and enabled, and disable runtime-pm before we release the pclk.
So pclk should always be valid here.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] amba: be more careful in runtime_suspend/resume
2011-10-18 12:29 ` Russell King - ARM Linux
@ 2011-10-18 12:30 ` Linus Walleij
0 siblings, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2011-10-18 12:30 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Oct 18, 2011 at 2:29 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Tue, Oct 18, 2011 at 02:24:50PM +0200, Linus Walleij wrote:
>> From: Linus Walleij <linus.walleij@linaro.org>
>>
>> This checks that a valid pclk actually was retrieved before
>> trying to disable/enable it in the runtime PM hooks on the
>> PrimeCell bus.
>
> This isn't necessary - we only enable runtime-pm after the pclk has been
> obtained and enabled, and disable runtime-pm before we release the pclk.
> So pclk should always be valid here.
Ah of course. Sorry for the fuzz!
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-10-18 12:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-18 12:24 [PATCH] amba: be more careful in runtime_suspend/resume Linus Walleij
2011-10-18 12:29 ` Russell King - ARM Linux
2011-10-18 12:30 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox