mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: "Rafael J. Wysocki" <rjw@sisk.pl>,
	Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Stephen Warren <swarren@nvidia.com>
Subject: [PATCH] PM / Hibernate: remove duplicate disable_nonboot_cpus()
Date: Tue, 29 Jan 2013 16:20:15 -0700	[thread overview]
Message-ID: <1359501615-16435-1-git-send-email-swarren@wwwdotorg.org> (raw)

From: Stephen Warren <swarren@nvidia.com>

Within hibernate.c, hibernation_platform_enter() is only called from
power_down(), which in turn is only called by hibernate() after having
called hibernation_snapshot(), which in turn calls create_image() which
in turn calls disable_nonboot_cpus().

Elsewhere, snapshot_ioctl() allows hibernation_snapshot() and
hibernation_platform_enter() to be invoked via separate IOCTLs, but I
assume the rule is that SNAPSHOT_CREATE_IMAGE must be executed before
IOCTL SNAPSHOT_POWER_OFF, and hence the same ordering applies.

This means that disable_nonboot_cpus() must have been called already
before hibernation_platform_enter() is entered, and hence the call there
is redundant, so remove it.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
Note: I have compile-tested this on x86-64, but have not attempted to test
it in any way; I'm proposing this patch following code inspection.
---
 kernel/power/hibernate.c |    5 -----
 1 file changed, 5 deletions(-)

diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
index b26f5f1..4ddeacc 100644
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
@@ -537,10 +537,6 @@ int hibernation_platform_enter(void)
 	if (error)
 		goto Platform_finish;
 
-	error = disable_nonboot_cpus();
-	if (error)
-		goto Platform_finish;
-
 	local_irq_disable();
 	syscore_suspend();
 	if (pm_wakeup_pending()) {
@@ -555,7 +551,6 @@ int hibernation_platform_enter(void)
  Power_up:
 	syscore_resume();
 	local_irq_enable();
-	enable_nonboot_cpus();
 
  Platform_finish:
 	hibernation_ops->finish();
-- 
1.7.10.4


             reply	other threads:[~2013-01-29 23:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-29 23:20 Stephen Warren [this message]
2013-01-30 23:43 ` 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=1359501615-16435-1-git-send-email-swarren@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=rjw@sisk.pl \
    --cc=swarren@nvidia.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®