* [PATCH] ARM: OMAP2+: Fix dmtimer set source clock failure
@ 2012-07-13 20:10 Jon Hunter
0 siblings, 0 replies; 5+ messages in thread
From: Jon Hunter @ 2012-07-13 20:10 UTC (permalink / raw)
To: linux-arm-kernel
Calling the dmtimer function omap_dm_timer_set_source() fails if following a
call to pm_runtime_put() to disable the timer. For example the following
sequence would fail to set the parent clock ...
omap_dm_timer_stop(gptimer);
omap_dm_timer_set_source(gptimer, OMAP_TIMER_SRC_32_KHZ);
The following error message would be seen ...
omap_dm_timer_set_source: failed to set timer_32k_ck as parent
The problem is that, by design, pm_runtime_put() simply decrements the usage
count and returns before the timer has actually been disabled. Therefore,
setting the parent clock failed because the timer was still active when the
trying to set the parent clock. Setting a parent clock will fail if the clock
you are setting the parent of has a non-zero usage count. To ensure that this
does not fail use pm_runtime_put_sync() when disabling the timer.
Note that this will not be seen on OMAP1 devices, because these devices do
not use the clock framework for dmtimers.
Signed-off-by: Jon Hunter <jon-hunter@ti.com>
---
arch/arm/plat-omap/dmtimer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 626ad8c..7b6689a 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -258,7 +258,7 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_enable);
void omap_dm_timer_disable(struct omap_dm_timer *timer)
{
- pm_runtime_put(&timer->pdev->dev);
+ pm_runtime_put_sync(&timer->pdev->dev);
}
EXPORT_SYMBOL_GPL(omap_dm_timer_disable);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] ARM: OMAP2+: Fix dmtimer set source clock failure
@ 2012-07-13 20:12 Jon Hunter
2012-08-07 7:34 ` Tony Lindgren
2012-08-07 18:21 ` Kevin Hilman
0 siblings, 2 replies; 5+ messages in thread
From: Jon Hunter @ 2012-07-13 20:12 UTC (permalink / raw)
To: linux-arm-kernel
Calling the dmtimer function omap_dm_timer_set_source() fails if following a
call to pm_runtime_put() to disable the timer. For example the following
sequence would fail to set the parent clock ...
omap_dm_timer_stop(gptimer);
omap_dm_timer_set_source(gptimer, OMAP_TIMER_SRC_32_KHZ);
The following error message would be seen ...
omap_dm_timer_set_source: failed to set timer_32k_ck as parent
The problem is that, by design, pm_runtime_put() simply decrements the usage
count and returns before the timer has actually been disabled. Therefore,
setting the parent clock failed because the timer was still active when the
trying to set the parent clock. Setting a parent clock will fail if the clock
you are setting the parent of has a non-zero usage count. To ensure that this
does not fail use pm_runtime_put_sync() when disabling the timer.
Note that this will not be seen on OMAP1 devices, because these devices do
not use the clock framework for dmtimers.
Signed-off-by: Jon Hunter <jon-hunter@ti.com>
---
arch/arm/plat-omap/dmtimer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 626ad8c..7b6689a 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -258,7 +258,7 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_enable);
void omap_dm_timer_disable(struct omap_dm_timer *timer)
{
- pm_runtime_put(&timer->pdev->dev);
+ pm_runtime_put_sync(&timer->pdev->dev);
}
EXPORT_SYMBOL_GPL(omap_dm_timer_disable);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] ARM: OMAP2+: Fix dmtimer set source clock failure
2012-07-13 20:12 [PATCH] ARM: OMAP2+: Fix dmtimer set source clock failure Jon Hunter
@ 2012-08-07 7:34 ` Tony Lindgren
2012-08-07 18:21 ` Kevin Hilman
1 sibling, 0 replies; 5+ messages in thread
From: Tony Lindgren @ 2012-08-07 7:34 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
* Jon Hunter <jon-hunter@ti.com> [120713 13:17]:
> Calling the dmtimer function omap_dm_timer_set_source() fails if following a
> call to pm_runtime_put() to disable the timer. For example the following
> sequence would fail to set the parent clock ...
>
> omap_dm_timer_stop(gptimer);
> omap_dm_timer_set_source(gptimer, OMAP_TIMER_SRC_32_KHZ);
>
> The following error message would be seen ...
>
> omap_dm_timer_set_source: failed to set timer_32k_ck as parent
>
> The problem is that, by design, pm_runtime_put() simply decrements the usage
> count and returns before the timer has actually been disabled. Therefore,
> setting the parent clock failed because the timer was still active when the
> trying to set the parent clock. Setting a parent clock will fail if the clock
> you are setting the parent of has a non-zero usage count. To ensure that this
> does not fail use pm_runtime_put_sync() when disabling the timer.
>
> Note that this will not be seen on OMAP1 devices, because these devices do
> not use the clock framework for dmtimers.
Kevin care to ack this one? This should also be Cc: stable it seems?
Regards,
Tony
> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
> ---
> arch/arm/plat-omap/dmtimer.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
> index 626ad8c..7b6689a 100644
> --- a/arch/arm/plat-omap/dmtimer.c
> +++ b/arch/arm/plat-omap/dmtimer.c
> @@ -258,7 +258,7 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_enable);
>
> void omap_dm_timer_disable(struct omap_dm_timer *timer)
> {
> - pm_runtime_put(&timer->pdev->dev);
> + pm_runtime_put_sync(&timer->pdev->dev);
> }
> EXPORT_SYMBOL_GPL(omap_dm_timer_disable);
>
> --
> 1.7.9.5
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] ARM: OMAP2+: Fix dmtimer set source clock failure
2012-07-13 20:12 [PATCH] ARM: OMAP2+: Fix dmtimer set source clock failure Jon Hunter
2012-08-07 7:34 ` Tony Lindgren
@ 2012-08-07 18:21 ` Kevin Hilman
2012-08-08 6:47 ` Tony Lindgren
1 sibling, 1 reply; 5+ messages in thread
From: Kevin Hilman @ 2012-08-07 18:21 UTC (permalink / raw)
To: linux-arm-kernel
Jon Hunter <jon-hunter@ti.com> writes:
> Calling the dmtimer function omap_dm_timer_set_source() fails if following a
> call to pm_runtime_put() to disable the timer. For example the following
> sequence would fail to set the parent clock ...
>
> omap_dm_timer_stop(gptimer);
> omap_dm_timer_set_source(gptimer, OMAP_TIMER_SRC_32_KHZ);
>
> The following error message would be seen ...
>
> omap_dm_timer_set_source: failed to set timer_32k_ck as parent
>
> The problem is that, by design, pm_runtime_put() simply decrements the usage
> count and returns before the timer has actually been disabled. Therefore,
> setting the parent clock failed because the timer was still active when the
> trying to set the parent clock. Setting a parent clock will fail if the clock
> you are setting the parent of has a non-zero usage count. To ensure that this
> does not fail use pm_runtime_put_sync() when disabling the timer.
>
> Note that this will not be seen on OMAP1 devices, because these devices do
> not use the clock framework for dmtimers.
>
> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Acked-by: Kevin Hilman <khilman@ti.com>
> ---
> arch/arm/plat-omap/dmtimer.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
> index 626ad8c..7b6689a 100644
> --- a/arch/arm/plat-omap/dmtimer.c
> +++ b/arch/arm/plat-omap/dmtimer.c
> @@ -258,7 +258,7 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_enable);
>
> void omap_dm_timer_disable(struct omap_dm_timer *timer)
> {
> - pm_runtime_put(&timer->pdev->dev);
> + pm_runtime_put_sync(&timer->pdev->dev);
> }
> EXPORT_SYMBOL_GPL(omap_dm_timer_disable);
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] ARM: OMAP2+: Fix dmtimer set source clock failure
2012-08-07 18:21 ` Kevin Hilman
@ 2012-08-08 6:47 ` Tony Lindgren
0 siblings, 0 replies; 5+ messages in thread
From: Tony Lindgren @ 2012-08-08 6:47 UTC (permalink / raw)
To: linux-arm-kernel
* Kevin Hilman <khilman@ti.com> [120807 11:21]:
> Jon Hunter <jon-hunter@ti.com> writes:
>
> > Calling the dmtimer function omap_dm_timer_set_source() fails if following a
> > call to pm_runtime_put() to disable the timer. For example the following
> > sequence would fail to set the parent clock ...
> >
> > omap_dm_timer_stop(gptimer);
> > omap_dm_timer_set_source(gptimer, OMAP_TIMER_SRC_32_KHZ);
> >
> > The following error message would be seen ...
> >
> > omap_dm_timer_set_source: failed to set timer_32k_ck as parent
> >
> > The problem is that, by design, pm_runtime_put() simply decrements the usage
> > count and returns before the timer has actually been disabled. Therefore,
> > setting the parent clock failed because the timer was still active when the
> > trying to set the parent clock. Setting a parent clock will fail if the clock
> > you are setting the parent of has a non-zero usage count. To ensure that this
> > does not fail use pm_runtime_put_sync() when disabling the timer.
> >
> > Note that this will not be seen on OMAP1 devices, because these devices do
> > not use the clock framework for dmtimers.
> >
> > Signed-off-by: Jon Hunter <jon-hunter@ti.com>
>
> Acked-by: Kevin Hilman <khilman@ti.com>
Thanks applying into fixes with Cc stable.
Tony
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-08-08 6:47 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-13 20:12 [PATCH] ARM: OMAP2+: Fix dmtimer set source clock failure Jon Hunter
2012-08-07 7:34 ` Tony Lindgren
2012-08-07 18:21 ` Kevin Hilman
2012-08-08 6:47 ` Tony Lindgren
-- strict thread matches above, loose matches on Subject: below --
2012-07-13 20:10 Jon Hunter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).