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); }
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
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 :)
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 :)
linaro-kernel@lists.linaro.org