From patchwork Wed Jun 19 16:15:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 2750401 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 888A69F96B for ; Wed, 19 Jun 2013 16:22:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D81B620295 for ; Wed, 19 Jun 2013 16:22:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 30FD32028F for ; Wed, 19 Jun 2013 16:22:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757049Ab3FSQWj (ORCPT ); Wed, 19 Jun 2013 12:22:39 -0400 Received: from qmta10.emeryville.ca.mail.comcast.net ([76.96.30.17]:44705 "EHLO qmta10.emeryville.ca.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757174Ab3FSQWj (ORCPT ); Wed, 19 Jun 2013 12:22:39 -0400 X-Greylist: delayed 426 seconds by postgrey-1.27 at vger.kernel.org; Wed, 19 Jun 2013 12:22:39 EDT Received: from omta16.emeryville.ca.mail.comcast.net ([76.96.30.72]) by qmta10.emeryville.ca.mail.comcast.net with comcast id qEB31l0061ZMdJ4AAGFYF7; Wed, 19 Jun 2013 16:15:32 +0000 Received: from mail.gonehiking.org ([75.71.126.216]) by omta16.emeryville.ca.mail.comcast.net with comcast id qGFW1l00R4gFXnP8cGFW9h; Wed, 19 Jun 2013 16:15:32 +0000 Received: from orthanc.internal (orthanc.internal [192.168.1.24]) by mail.gonehiking.org (Postfix) with ESMTP id A082A80026; Wed, 19 Jun 2013 10:15:43 -0600 (MDT) From: Shuah Khan To: pavel@ucw.cz, rjw@sisk.pl, len.brown@intel.com Cc: Shuah Khan , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, shuahkhan@gmail.com Subject: [PATCH 2/2] power: Add warning message about incorrect system date and time after resume when pm_trace is enabled Date: Wed, 19 Jun 2013 10:15:18 -0600 Message-Id: <1371658518-2878-1-git-send-email-shuah.kh@samsung.com> X-Mailer: git-send-email 1.7.10.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1371658532; bh=wv62Lxl30R3VwhbS583hLuaXtcCZaxLWo6E6tTGJPkQ=; h=Received:Received:Received:From:To:Subject:Date:Message-Id; b=YfR4egiiQczt31iftI9WMRJ5RzH1t1XkcjjMc73fftMrHwPIrxwzqydPNrIxJelRy Q8fFG7KXXjrC3o7PyVfebSoipkwcTre+CIu5SQB9agR9ufrH/mDs3zqgQgs1Zy1IB1 Z5Ozj6PURtnZ4Lc18d/okMJ920TmdTtqxZ4rLp0/9Odju4rJrLBNNEpUSGkkEOkidP l6oHaDvzRODFH6+KcZaVmd8IlObuVU6v0rvqJG2PHo/Fai+goqhPgqffTZNXqURoTP 9YzSBRXg8YKWLfyxu0bZCruPXQsAfrhcnYNeBgbhKHIgLJ5l5tfEN8NfgbYSOo1DMg T67rUu6Iju62A== Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- kernel/power/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/power/main.c b/kernel/power/main.c index d77663b..4f769a6 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c @@ -528,6 +528,7 @@ pm_trace_store(struct kobject *kobj, struct kobj_attribute *attr, if (sscanf(buf, "%d", &val) == 1) { pm_trace_enabled = !!val; + pr_warn("CAUTION: this option will cause your machine's real-time clock to be set to an invalid time after a resume. Remember to set correct time after resume\n"); return n; } return -EINVAL;