* [PATCH] clockevents: check 'state' instead of 'mode' in suspend/resume path
@ 2015-06-17 10:34 Viresh Kumar
2015-06-18 7:31 ` [tip:timers/core] clockevents: Check state instead of mode " tip-bot for Viresh Kumar
2015-06-18 14:26 ` [PATCH] clockevents: check 'state' instead of 'mode' " Alexandre Belloni
0 siblings, 2 replies; 5+ messages in thread
From: Viresh Kumar @ 2015-06-17 10:34 UTC (permalink / raw)
To: Thomas Gleixner
Cc: linaro-kernel, linux-kernel, alexandre.belloni, sylvain.rochet,
Viresh Kumar
CLOCK_EVT_MODE_* macros are present for backward compatibility (as most
of the drivers are still using old ->set_mode() interface).
These macro's shouldn't be used anymore in code, that is common to both
driver interfaces, i.e. ->set_mode() and ->set_state_*().
Drivers implementing ->set_state_*() interface, which have their
clkevt->mode set to 0 (clkevt device structures are normally globally
defined), will not participate in suspend/resume as they will always be
marked as UNUSED.
Fix this by checking state of the clockevent device instead of mode,
which is updated for both the interfaces.
Fixes: ac34ad27fc16 ("clockevents: Do not suspend/resume if unused")
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
kernel/time/clockevents.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
index 2397b97320d8..08ccc3da3ca0 100644
--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -639,7 +639,7 @@ void clockevents_suspend(void)
struct clock_event_device *dev;
list_for_each_entry_reverse(dev, &clockevent_devices, list)
- if (dev->suspend && dev->mode != CLOCK_EVT_MODE_UNUSED)
+ if (dev->suspend && !clockevent_state_detached(dev))
dev->suspend(dev);
}
@@ -651,7 +651,7 @@ void clockevents_resume(void)
struct clock_event_device *dev;
list_for_each_entry(dev, &clockevent_devices, list)
- if (dev->resume && dev->mode != CLOCK_EVT_MODE_UNUSED)
+ if (dev->resume && !clockevent_state_detached(dev))
dev->resume(dev);
}
--
2.4.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [tip:timers/core] clockevents: Check state instead of mode in suspend/resume path
2015-06-17 10:34 [PATCH] clockevents: check 'state' instead of 'mode' in suspend/resume path Viresh Kumar
@ 2015-06-18 7:31 ` tip-bot for Viresh Kumar
2015-06-18 14:26 ` [PATCH] clockevents: check 'state' instead of 'mode' " Alexandre Belloni
1 sibling, 0 replies; 5+ messages in thread
From: tip-bot for Viresh Kumar @ 2015-06-18 7:31 UTC (permalink / raw)
To: linux-tip-commits; +Cc: viresh.kumar, mingo, tglx, linux-kernel, hpa
Commit-ID: a9d20988ac7db47fec4510cefc966e876a4ce674
Gitweb: http://git.kernel.org/tip/a9d20988ac7db47fec4510cefc966e876a4ce674
Author: Viresh Kumar <viresh.kumar@linaro.org>
AuthorDate: Wed, 17 Jun 2015 16:04:46 +0530
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 18 Jun 2015 09:27:02 +0200
clockevents: Check state instead of mode in suspend/resume path
CLOCK_EVT_MODE_* macros are present for backward compatibility (as most
of the drivers are still using old ->set_mode() interface).
These macro's shouldn't be used anymore in code, that is common to both
driver interfaces, i.e. ->set_mode() and ->set_state_*().
Drivers implementing ->set_state_*() interface, which have their
clkevt->mode set to 0 (clkevt device structures are normally globally
defined), will not participate in suspend/resume as they will always be
marked as UNUSED.
Fix this by checking state of the clockevent device instead of mode,
which is updated for both the interfaces.
Fixes: ac34ad27fc16 ("clockevents: Do not suspend/resume if unused")
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Cc: linaro-kernel@lists.linaro.org
Cc: alexandre.belloni@free-electrons.com
Cc: sylvain.rochet@finsecur.com
Link: http://lkml.kernel.org/r/a1964eef6e8a47d02b1ff9083c6c91f73f0ff643.1434537215.git.viresh.kumar@linaro.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
kernel/time/clockevents.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
index 2397b97..08ccc3d 100644
--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -639,7 +639,7 @@ void clockevents_suspend(void)
struct clock_event_device *dev;
list_for_each_entry_reverse(dev, &clockevent_devices, list)
- if (dev->suspend && dev->mode != CLOCK_EVT_MODE_UNUSED)
+ if (dev->suspend && !clockevent_state_detached(dev))
dev->suspend(dev);
}
@@ -651,7 +651,7 @@ void clockevents_resume(void)
struct clock_event_device *dev;
list_for_each_entry(dev, &clockevent_devices, list)
- if (dev->resume && dev->mode != CLOCK_EVT_MODE_UNUSED)
+ if (dev->resume && !clockevent_state_detached(dev))
dev->resume(dev);
}
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] clockevents: check 'state' instead of 'mode' in suspend/resume path
2015-06-17 10:34 [PATCH] clockevents: check 'state' instead of 'mode' in suspend/resume path Viresh Kumar
2015-06-18 7:31 ` [tip:timers/core] clockevents: Check state instead of mode " tip-bot for Viresh Kumar
@ 2015-06-18 14:26 ` Alexandre Belloni
2015-06-18 14:38 ` Viresh Kumar
1 sibling, 1 reply; 5+ messages in thread
From: Alexandre Belloni @ 2015-06-18 14:26 UTC (permalink / raw)
To: Viresh Kumar; +Cc: Thomas Gleixner, linaro-kernel, linux-kernel, sylvain.rochet
On 17/06/2015 at 16:04:46 +0530, Viresh Kumar wrote :
> CLOCK_EVT_MODE_* macros are present for backward compatibility (as most
> of the drivers are still using old ->set_mode() interface).
>
> These macro's shouldn't be used anymore in code, that is common to both
> driver interfaces, i.e. ->set_mode() and ->set_state_*().
>
> Drivers implementing ->set_state_*() interface, which have their
> clkevt->mode set to 0 (clkevt device structures are normally globally
> defined), will not participate in suspend/resume as they will always be
> marked as UNUSED.
>
> Fix this by checking state of the clockevent device instead of mode,
> which is updated for both the interfaces.
>
> Fixes: ac34ad27fc16 ("clockevents: Do not suspend/resume if unused")
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> ---
> kernel/time/clockevents.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
> index 2397b97320d8..08ccc3da3ca0 100644
> --- a/kernel/time/clockevents.c
> +++ b/kernel/time/clockevents.c
> @@ -639,7 +639,7 @@ void clockevents_suspend(void)
> struct clock_event_device *dev;
>
> list_for_each_entry_reverse(dev, &clockevent_devices, list)
> - if (dev->suspend && dev->mode != CLOCK_EVT_MODE_UNUSED)
> + if (dev->suspend && !clockevent_state_detached(dev))
> dev->suspend(dev);
> }
>
> @@ -651,7 +651,7 @@ void clockevents_resume(void)
> struct clock_event_device *dev;
>
> list_for_each_entry(dev, &clockevent_devices, list)
> - if (dev->resume && dev->mode != CLOCK_EVT_MODE_UNUSED)
> + if (dev->resume && !clockevent_state_detached(dev))
> dev->resume(dev);
> }
>
> --
> 2.4.0
>
--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] clockevents: check 'state' instead of 'mode' in suspend/resume path
2015-06-18 14:26 ` [PATCH] clockevents: check 'state' instead of 'mode' " Alexandre Belloni
@ 2015-06-18 14:38 ` Viresh Kumar
2015-06-18 14:44 ` Alexandre Belloni
0 siblings, 1 reply; 5+ messages in thread
From: Viresh Kumar @ 2015-06-18 14:38 UTC (permalink / raw)
To: Alexandre Belloni
Cc: Thomas Gleixner, linaro-kernel, linux-kernel, sylvain.rochet
On 18-06-15, 16:26, Alexandre Belloni wrote:
> > Fixes: ac34ad27fc16 ("clockevents: Do not suspend/resume if unused")
> > Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
>
> Reviewed-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Thanks, its already applied today :)
--
viresh
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] clockevents: check 'state' instead of 'mode' in suspend/resume path
2015-06-18 14:38 ` Viresh Kumar
@ 2015-06-18 14:44 ` Alexandre Belloni
0 siblings, 0 replies; 5+ messages in thread
From: Alexandre Belloni @ 2015-06-18 14:44 UTC (permalink / raw)
To: Viresh Kumar; +Cc: Thomas Gleixner, linaro-kernel, linux-kernel, sylvain.rochet
On 18/06/2015 at 20:08:37 +0530, Viresh Kumar wrote :
> On 18-06-15, 16:26, Alexandre Belloni wrote:
> > > Fixes: ac34ad27fc16 ("clockevents: Do not suspend/resume if unused")
> > > Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> >
> > Reviewed-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
>
> Thanks, its already applied today :)
>
Ok, I didn't get any notification and I had to dig up th tree on which
it actually applied :)
--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-06-18 14:44 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-17 10:34 [PATCH] clockevents: check 'state' instead of 'mode' in suspend/resume path Viresh Kumar
2015-06-18 7:31 ` [tip:timers/core] clockevents: Check state instead of mode " tip-bot for Viresh Kumar
2015-06-18 14:26 ` [PATCH] clockevents: check 'state' instead of 'mode' " Alexandre Belloni
2015-06-18 14:38 ` Viresh Kumar
2015-06-18 14:44 ` Alexandre Belloni
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.