From patchwork Tue Jan 29 23:20:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Warren X-Patchwork-Id: 2064141 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 9F67A3FDD1 for ; Tue, 29 Jan 2013 23:20:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751326Ab3A2XU1 (ORCPT ); Tue, 29 Jan 2013 18:20:27 -0500 Received: from avon.wwwdotorg.org ([70.85.31.133]:35212 "EHLO avon.wwwdotorg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751073Ab3A2XU0 (ORCPT ); Tue, 29 Jan 2013 18:20:26 -0500 Received: from severn.wwwdotorg.org (unknown [192.168.65.5]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by avon.wwwdotorg.org (Postfix) with ESMTPS id B13886345; Tue, 29 Jan 2013 16:22:43 -0700 (MST) Received: from swarren-lx1.nvidia.com (localhost [127.0.0.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by severn.wwwdotorg.org (Postfix) with ESMTPSA id 3ED65E4107; Tue, 29 Jan 2013 16:20:24 -0700 (MST) From: Stephen Warren To: "Rafael J. Wysocki" , Len Brown , Pavel Machek Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Stephen Warren Subject: [PATCH] PM / Hibernate: remove duplicate disable_nonboot_cpus() Date: Tue, 29 Jan 2013 16:20:15 -0700 Message-Id: <1359501615-16435-1-git-send-email-swarren@wwwdotorg.org> X-Mailer: git-send-email 1.7.10.4 X-NVConfidentiality: public X-Virus-Scanned: clamav-milter 0.96.5 at avon.wwwdotorg.org X-Virus-Status: Clean Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org From: Stephen Warren 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 --- 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();