From: Feng Tang <feng.tang@intel.com>
To: John Stultz <john.stultz@linaro.org>,
Thomas Gleixner <tglx@linutronix.de>,
Alessandro Zummo <a.zummo@towertech.it>,
linux-kernel@vger.kernel.org
Cc: "Jason Gunthorpe" <jgunthorpe@obsidianresearch.com>,
"Feng Tang" <feng.tang@intel.com>,
"Arve Hjønnevåg" <arve@android.com>
Subject: [PATCH v2 2/3] rtc: Skip the suspend/resume handling if persistent clock exist
Date: Wed, 16 Jan 2013 00:09:48 +0800 [thread overview]
Message-ID: <1358266189-8812-2-git-send-email-feng.tang@intel.com> (raw)
In-Reply-To: <1358266189-8812-1-git-send-email-feng.tang@intel.com>
All the RTC suspend and resume functions are to compensate the
sleep time, but this is already done in timekeeping.c if persistent
clock exist.
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Feng Tang <feng.tang@intel.com>
---
drivers/rtc/class.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c
index 5143629..26388f1 100644
--- a/drivers/rtc/class.c
+++ b/drivers/rtc/class.c
@@ -50,6 +50,10 @@ static int rtc_suspend(struct device *dev, pm_message_t mesg)
struct rtc_device *rtc = to_rtc_device(dev);
struct rtc_time tm;
struct timespec delta, delta_delta;
+
+ if (has_persistent_clock())
+ return 0;
+
if (strcmp(dev_name(&rtc->dev), CONFIG_RTC_HCTOSYS_DEVICE) != 0)
return 0;
@@ -88,6 +92,9 @@ static int rtc_resume(struct device *dev)
struct timespec new_system, new_rtc;
struct timespec sleep_time;
+ if (has_persistent_clock())
+ return 0;
+
rtc_hctosys_ret = -ENODEV;
if (strcmp(dev_name(&rtc->dev), CONFIG_RTC_HCTOSYS_DEVICE) != 0)
return 0;
--
1.7.9.5
next prev parent reply other threads:[~2013-01-15 16:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-15 16:09 [PATCH v2 1/3] timekeeping: Add persistent_clock_exist flag Feng Tang
2013-01-15 16:09 ` Feng Tang [this message]
2013-01-15 19:49 ` [PATCH v2 2/3] rtc: Skip the suspend/resume handling if persistent clock exist John Stultz
2013-01-15 16:09 ` [PATCH v2 3/3] timekeeping: Add CONFIG_HAS_PERSISTENT_CLOCK option Feng Tang
2013-01-15 19:50 ` John Stultz
2013-01-22 19:44 ` Jason Gunthorpe
2013-01-22 19:49 ` John Stultz
2013-01-26 1:07 ` John Stultz
2013-01-15 19:48 ` [PATCH v2 1/3] timekeeping: Add persistent_clock_exist flag John Stultz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1358266189-8812-2-git-send-email-feng.tang@intel.com \
--to=feng.tang@intel.com \
--cc=a.zummo@towertech.it \
--cc=arve@android.com \
--cc=jgunthorpe@obsidianresearch.com \
--cc=john.stultz@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®