From: Laxman Dewangan <ldewangan@nvidia.com>
To: <john.stultz@linaro.org>, <toddpoynor@google.com>,
<gregkh@linuxfoundation.org>
Cc: <linux-kernel@vger.kernel.org>, Laxman Dewangan <ldewangan@nvidia.com>
Subject: [PATCH] alarmtimer: add error prints when suspend failed
Date: Fri, 8 Mar 2013 00:57:37 +0530 [thread overview]
Message-ID: <1362684457-32570-1-git-send-email-ldewangan@nvidia.com> (raw)
The alramtimer suspend failed when nearest alarm wakeup time is
less than 2 sec or rtc timer can not start.
In suspend/resume stress testing, we found that sometimes alramtimer
failed to suspend and hence it cancel the suspend ops. Add error prints
in suspend failure to provide more info when failure occurs to help
debugging.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
kernel/time/alarmtimer.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c
index f11d83b..eed5646 100644
--- a/kernel/time/alarmtimer.c
+++ b/kernel/time/alarmtimer.c
@@ -249,6 +249,8 @@ static int alarmtimer_suspend(struct device *dev)
if (ktime_to_ns(min) < 2 * NSEC_PER_SEC) {
__pm_wakeup_event(ws, 2 * MSEC_PER_SEC);
+ dev_err(dev,
+ "Nearest alarm wakeup time < 2sec, avoiding suspend\n");
return -EBUSY;
}
@@ -260,8 +262,10 @@ static int alarmtimer_suspend(struct device *dev)
/* Set alarm, if in the past reject suspend briefly to handle */
ret = rtc_timer_start(rtc, &rtctimer, now, ktime_set(0, 0));
- if (ret < 0)
+ if (ret < 0) {
__pm_wakeup_event(ws, MSEC_PER_SEC);
+ dev_err(dev, "RTC timer start failed, %d\n", ret);
+ }
return ret;
}
#else
--
1.7.1.1
next reply other threads:[~2013-03-07 19:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-07 19:27 Laxman Dewangan [this message]
2013-03-07 23:16 ` Greg KH
2013-03-08 7:24 ` Laxman Dewangan
2013-03-11 23:51 ` John Stultz
2013-03-12 0:08 ` Rafael J. Wysocki
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=1362684457-32570-1-git-send-email-ldewangan@nvidia.com \
--to=ldewangan@nvidia.com \
--cc=gregkh@linuxfoundation.org \
--cc=john.stultz@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=toddpoynor@google.com \
/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®