From patchwork Mon Jun 24 23:25: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: 2773961 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 DF40A9F3A0 for ; Mon, 24 Jun 2013 23:25:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EBF4120271 for ; Mon, 24 Jun 2013 23:25:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0FFBD2025C for ; Mon, 24 Jun 2013 23:25:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752029Ab3FXXZZ (ORCPT ); Mon, 24 Jun 2013 19:25:25 -0400 Received: from qmta09.emeryville.ca.mail.comcast.net ([76.96.30.96]:48892 "EHLO qmta09.emeryville.ca.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751569Ab3FXXZY (ORCPT ); Mon, 24 Jun 2013 19:25:24 -0400 Received: from omta03.emeryville.ca.mail.comcast.net ([76.96.30.27]) by qmta09.emeryville.ca.mail.comcast.net with comcast id sNw61l0020b6N64A9PRQBR; Mon, 24 Jun 2013 23:25:24 +0000 Received: from mail.gonehiking.org ([50.134.149.16]) by omta03.emeryville.ca.mail.comcast.net with comcast id sPRN1l0010MU7Qa8PPRNkA; Mon, 24 Jun 2013 23:25:23 +0000 Received: from orthanc.internal (orthanc.internal [192.168.1.24]) by mail.gonehiking.org (Postfix) with ESMTP id D52D4807FA; Mon, 24 Jun 2013 17:25:23 -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 v2] power: Add warning message about incorrect system date and time after resume when pm_trace is enabled Date: Mon, 24 Jun 2013 17:25:18 -0600 Message-Id: <1372116318-10824-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=1372116324; bh=LVSKt9EE9GJkYJCn6gRwUwCemguFd5oSZ0/TEfaOHoQ=; h=Received:Received:Received:From:To:Subject:Date:Message-Id; b=jOX1z31D5vGPmAKFO+xd/cE4DMN9AQ0e+Fpm5/JfOZvEbGDgPDGsfAduWyncDpDmX 9JyySGwVjkpwFa9kwD9sDQ2O771HolY+Mmoiad4d1wOH43zvN5P8R2VuTL5NVWiUA6 8TdQEb8S4bup4srikAD7B7cYdm/Z3A+/cFkhF/SnxYIOqV+dBRP25W9XXow565WpyE ud7nztMvXLc1y81eRBQ1pgn0aPrjjdh0cUbBAGXWyKzYt1OL46IE3k6AilYPmt5Uc5 as9w6KcFP+Fldv7GHpjbyXfZkGO3EMFac9Po+IyYw+Z8HX2a2JMdBMRlGTQGfo7Il8 nkBh3Gs68JLtw== Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-7.9 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 | 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"); return n; } return -EINVAL;