Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1562061ybb; Sun, 29 Mar 2020 07:51:28 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtJ0a3wq0HFtMzKwX1UDH90bPEgRPd3jbTUvWYpkwiwCeS8oQHrOgWMP1fbuUaZYTmorcSE X-Received: by 2002:aca:55ce:: with SMTP id j197mr4821480oib.84.1585493488455; Sun, 29 Mar 2020 07:51:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585493488; cv=none; d=google.com; s=arc-20160816; b=IQi19jLgpc5US6BJtz68IRYSQPVYeCsRvowxNm1FLoof2nZPn0FjOS5m6Geq4wJFPU 2q3aYRzu3aOEvm9aOFUO5FT9Sxe/52aH68s0m3kmfuFjLo51kY13YAqGfC//Kihfsn1U dexuhOhIQYVY0UTz2rTpT3UGvVF5HbPmy2UcEzqBN4uWW/ILCt9E1pUApk769m2xJtlI tpYfdUsTwlBVEOpVrzjp4/6+1FLqPXSZEuETokgy9byVH/ZXbknPHZR7co+wiuB8SUZ9 OF0HILNIvlTubKDobMV9GDPo4XUh8WgnPYwzT6n9HuMKjbUfyXTPQTBQeDl9CLOp00Bs G6dQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=qNTn3j7P0YM05jzrUaNL6i8KSa15TpvNfe+/n8MAKe4=; b=Uu8CoNcE7Pz6H3nkwojm4x6hD6xc/DtBSUpjuA60XXRGIhwUngMxh7rJ1dL+V81Fki uHNbG9f15uWBgl7eG5S9RGCYGkKVkBjY26TONwcKFqUbNaOcOXgXeTxViKjZm1RPZp/L +1QmGGCMucbL84pJH+x26kBYjBNl3uR9q1G/V15GrIy1n63iGiuGnZ/XpXsNsHE2bay4 37ufYMhEHLcFCAvbpW/ft8CXzRiQXjHaLfYice3I4VAf/lVNceyp124ZThfjiZ99ZQQ3 U0ZUAMAyaW/jArDocnvJ/adWZnA8ABOCSybHiM+BX5jQFXrPh46Vd8AoCJE7CIzBbLuH hqzQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u66si4806527oib.159.2020.03.29.07.51.15; Sun, 29 Mar 2020 07:51:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728289AbgC2OsL (ORCPT + 99 others); Sun, 29 Mar 2020 10:48:11 -0400 Received: from mga01.intel.com ([192.55.52.88]:32557 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728245AbgC2OsL (ORCPT ); Sun, 29 Mar 2020 10:48:11 -0400 IronPort-SDR: iLd7iGvGspOVEtGFXGuVAv65b7ywRNq1dQb7N0Tiw4NOA+B7tpiGYw4ndBBW07zpIm2DWnHdc9 Y+PtIyEcPwJQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2020 07:48:10 -0700 IronPort-SDR: nBtIlt8xw3X87rGtSiAizW/ezAp70RXQNKCOhFd0IT1apP1sgku/UPl5TJEycg9t45f4eNxojk SoiuDVtLQgOw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,320,1580803200"; d="scan'208";a="272123787" Received: from chenyu-office.sh.intel.com ([10.239.158.173]) by fmsmga004.fm.intel.com with ESMTP; 29 Mar 2020 07:48:08 -0700 From: Chen Yu To: linux-pm@vger.kernel.org Cc: Jonathan Corbet , Pavel Machek , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Mauro Carvalho Chehab , Thomas Gleixner , Josh Poimboeuf , Andrew Morton , Chen Yu , "Rafael J. Wysocki" , Len Brown , Andy Shevchenko , Randy Dunlap Subject: [PATCH][v2] PM / sleep: Add pm_debug_messages boot command control Date: Sun, 29 Mar 2020 22:46:40 +0800 Message-Id: <20200329144640.20536-1-yu.c.chen@intel.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Debug messages from the system suspend/hibernation infrastructure is disabled by default, and can only be enabled after the system has boot up via /sys/power/pm_debug_messages. This makes the hibernation resume hard to track as it involves system boot up across hibernation. There's no chance for software_resume() to track the resume process, eg. Turning on the pm_debug_messages during boot up by appending 'pm_debug_message'. Cc: "Rafael J. Wysocki" Cc: Len Brown Cc: Andy Shevchenko Cc: Randy Dunlap Signed-off-by: Chen Yu --- v2: According to Randy's suggestion, add the command line option to Documentation/admin-guide/kernel-parameters.txt --- Documentation/admin-guide/kernel-parameters.txt | 3 +++ kernel/power/main.c | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index c07815d230bc..105ec73743d7 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -3698,6 +3698,9 @@ Override pmtimer IOPort with a hex value. e.g. pmtmr=0x508 + pm_debug_message [SUSPEND,KNL] + Enable suspend/resume debug messages during boot up. + pnp.debug=1 [PNP] Enable PNP debug messages (depends on the CONFIG_PNP_DEBUG_MESSAGES option). Change at run-time diff --git a/kernel/power/main.c b/kernel/power/main.c index 69b7a8aeca3b..1da3d7c15e03 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c @@ -535,6 +535,13 @@ static ssize_t pm_debug_messages_store(struct kobject *kobj, power_attr(pm_debug_messages); +static int __init pm_debug_message_setup(char *str) +{ + pm_debug_messages_on = true; + return 1; +} +__setup("pm_debug_message", pm_debug_message_setup); + /** * __pm_pr_dbg - Print a suspend debug message to the kernel log. * @defer: Whether or not to use printk_deferred() to print the message. -- 2.17.1