[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-a9d20988ac7db47fec4510cefc966e876a4ce674@git.kernel.org>
Date: Thu, 18 Jun 2015 00:31:16 -0700
From: tip-bot for Viresh Kumar <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: viresh.kumar@...aro.org, mingo@...nel.org, tglx@...utronix.de,
linux-kernel@...r.kernel.org, hpa@...or.com
Subject: [tip:timers/core] clockevents:
Check state instead of mode in suspend/resume path
Commit-ID: a9d20988ac7db47fec4510cefc966e876a4ce674
Gitweb: http://git.kernel.org/tip/a9d20988ac7db47fec4510cefc966e876a4ce674
Author: Viresh Kumar <viresh.kumar@...aro.org>
AuthorDate: Wed, 17 Jun 2015 16:04:46 +0530
Committer: Thomas Gleixner <tglx@...utronix.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@...aro.org>
Cc: linaro-kernel@...ts.linaro.org
Cc: alexandre.belloni@...e-electrons.com
Cc: sylvain.rochet@...secur.com
Link: http://lkml.kernel.org/r/a1964eef6e8a47d02b1ff9083c6c91f73f0ff643.1434537215.git.viresh.kumar@linaro.org
Signed-off-by: Thomas Gleixner <tglx@...utronix.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);
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists