From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Shuah Khan <shuah.kh@samsung.com>
Cc: pavel@ucw.cz, len.brown@intel.com, linux-pm@vger.kernel.org,
linux-kernel@vger.kernel.org, shuahkhan@gmail.com
Subject: Re: [PATCH v2] power: Add warning message about incorrect system date and time after resume when pm_trace is enabled
Date: Wed, 26 Jun 2013 01:10:05 +0200 [thread overview]
Message-ID: <2689226.oQ0T3XLPmT@vostro.rjw.lan> (raw)
In-Reply-To: <1372116318-10824-1-git-send-email-shuah.kh@samsung.com>
On Monday, June 24, 2013 05:25:18 PM Shuah Khan wrote:
> pm_trace uses the system's Real Time Clock (RTC) to save the magic number.
> Reason for this is that the RTC is the only reliably available piece of
> hardware during resume operations where a value can be set that will
> survive a reboot.
>
> Consequence is that after a resume (even if it is successful) your system
> clock will have a value corresponding to the magic number instead of the
> correct date/time! It is therefore advisable to use a program like ntp-date
> or rdate to reset the correct date/time from an external time source when
> using this trace option.
>
> There is no run-time message to warn users of the consequences of enabling
> pm_trace. Adding a warning message to pm_trace_store() will serve as a
> reminder to users to set the system date and time after resume.
>
> Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
> ---
> kernel/power/main.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/kernel/power/main.c b/kernel/power/main.c
> index d77663b..fd744d1 100644
> --- a/kernel/power/main.c
> +++ b/kernel/power/main.c
> @@ -528,6 +528,8 @@ pm_trace_store(struct kobject *kobj, struct kobj_attribute *attr,
>
> if (sscanf(buf, "%d", &val) == 1) {
> pm_trace_enabled = !!val;
> + pr_warn("PM: Enabling pm_trace changes system date and time after resume.\n");
> + pr_cont("PM: Remember to set correct time after resume\n");
You can do it like this:
+ pr_warn("PM: Enabling pm_trace changes system date and time after resume.\n"
+ "PM: Remember to set correct time after resume\n");
No need to use pr_cont(). :-)
And I'd say "during" instead of "after" in the first sentence.
I'd also say something like "Correct system time has to be restored manually after resume."
instead of the second one.
> return n;
> }
> return -EINVAL;
Thanks,
Rafael
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
next prev parent reply other threads:[~2013-06-25 23:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-24 23:25 Shuah Khan
2013-06-25 23:10 ` Rafael J. Wysocki [this message]
2013-06-26 21:12 ` Shuah Khan
2013-06-26 21:34 ` 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=2689226.oQ0T3XLPmT@vostro.rjw.lan \
--to=rjw@sisk.pl \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=shuah.kh@samsung.com \
--cc=shuahkhan@gmail.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®