From patchwork Fri Aug 12 06:22:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Machek X-Patchwork-Id: 9276405 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 791DD60752 for ; Fri, 12 Aug 2016 06:29:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 65010284A9 for ; Fri, 12 Aug 2016 06:29:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 59593284E9; Fri, 12 Aug 2016 06:29:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE65D284A9 for ; Fri, 12 Aug 2016 06:29:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752302AbcHLG3r (ORCPT ); Fri, 12 Aug 2016 02:29:47 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:39449 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752286AbcHLG3q (ORCPT ); Fri, 12 Aug 2016 02:29:46 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 3850A82490; Fri, 12 Aug 2016 08:22:44 +0200 (CEST) Date: Fri, 12 Aug 2016 08:22:41 +0200 From: Pavel Machek To: Chen Yu Cc: Linux PM List , "Rafael J. Wysocki" , Len Brown , linux-kernel@vger.kernel.org Subject: Re: [PATCH][RFC] Documentation/: update hibernation debug documentation Message-ID: <20160812062241.GB30992@amd> References: <1470917891-8386-1-git-send-email-yu.c.chen@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1470917891-8386-1-git-send-email-yu.c.chen@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi! > Update the description of test_resume mode for hibernation. > > Signed-off-by: Chen Yu > --- > Documentation/power/basic-pm-debugging.txt | 7 +++++++ > 1 file changed, 7 insertions(+) That's certainly step in the right direction, but I guess it should be mentioned in the other places, too. Something like this? Additionally, we have testproc. Should we move it to test_proc for consistency (or replace test_resume with simple "resume"? That's what it does... it is hibernate+resume... Thanks, Pavel > diff --git a/Documentation/power/basic-pm-debugging.txt b/Documentation/power/basic-pm-debugging.txt > index b96098c..5f1f228 100644 > --- a/Documentation/power/basic-pm-debugging.txt > +++ b/Documentation/power/basic-pm-debugging.txt > @@ -36,6 +36,13 @@ button to make the system resume). > If neither "platform" nor "shutdown" hibernation mode works, you will need to > identify what goes wrong. > > +Besides, if all the modes described above work, "test_resume" mode can be used to > +verify if the snapshot data written to swap device can be successfully restored > +to memory: > +# echo test_resume > /sys/power/disk > +# echo disk > /sys/power/state > +If everything goes well, the system will resume back without BIOSes involved in. > + > a) Test modes of hibernation > > To find out why hibernation fails on your system, you can use a special testing diff --git a/Documentation/power/interface.txt b/Documentation/power/interface.txt index f1f0f59a..d4ac8f7 100644 --- a/Documentation/power/interface.txt +++ b/Documentation/power/interface.txt @@ -23,8 +23,8 @@ few options for putting the system to sleep - using the platform driver (e.g. ACPI or other suspend_ops), powering off the system or rebooting the system (for testing). -Additionally, /sys/power/disk can be used to turn on one of the two testing -modes of the suspend-to-disk mechanism: 'testproc' or 'test'. If the +Additionally, /sys/power/disk can be used to turn on one of the three testing +modes of the suspend-to-disk mechanism: 'test_resume', 'testproc' or 'test'. If the suspend-to-disk mechanism is in the 'testproc' mode, writing 'disk' to /sys/power/state will cause the kernel to disable nonboot CPUs and freeze tasks, wait for 5 seconds, unfreeze tasks and enable nonboot CPUs. If it is @@ -32,12 +32,13 @@ in the 'test' mode, writing 'disk' to /sys/power/state will cause the kernel to disable nonboot CPUs and freeze tasks, shrink memory, suspend devices, wait for 5 seconds, resume devices, unfreeze tasks and enable nonboot CPUs. Then, we are able to look in the log messages and work out, for example, which code -is being slow and which device drivers are misbehaving. +is being slow and which device drivers are misbehaving. In 'test_resume' mode, +... (insert your description here). Reading from this file will display all supported modes and the currently selected one in brackets, for example - [shutdown] reboot test testproc + [shutdown] reboot test testproc test_resume Writing to this file will accept one of