From patchwork Thu Mar 20 20:53:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Capella X-Patchwork-Id: 3867891 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3A7FABF540 for ; Thu, 20 Mar 2014 20:54:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 69BDA201FD for ; Thu, 20 Mar 2014 20:54:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 913FB20213 for ; Thu, 20 Mar 2014 20:54:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759798AbaCTUxz (ORCPT ); Thu, 20 Mar 2014 16:53:55 -0400 Received: from mail-pd0-f176.google.com ([209.85.192.176]:64371 "EHLO mail-pd0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759759AbaCTUxv (ORCPT ); Thu, 20 Mar 2014 16:53:51 -0400 Received: by mail-pd0-f176.google.com with SMTP id r10so1431305pdi.21 for ; Thu, 20 Mar 2014 13:53:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=XstqI6taKr+47xPhbnwI3NrhvZc6FzC/Kc1ezc//c+8=; b=aL4tm5sxFeUxf8IkuFKV/THZOdxlYDUUUKEKvSxnjAOPD5C9GXsG6APouzpYr4RDLa FZOTt/9NfVQxcGr+nSsRLCB0Y0QKBxOef7MAIRqTUjDjtM5k06t0MxR5biPs3215VLxW kaeyPk8zuhAOggoYWwVShMxff010TRMpb+Rdaun8ly2tp5sHI7RFsPdtT77sDQ2AAv2U 8JrD5uBHY+zHLXIY2/10eQZTWBX2kOANbe7LeGKnrxZbk6vmvFiWdlwjbRNFXnvsMGfq l4qI8K+yF2BeY7mmkplXZCBw1MJhtNDr3EJD7ABaTlT/QWsfWqNtlmspmdkdDxb2HFEl d57g== X-Gm-Message-State: ALoCoQl/9Q8RBGqHmf2pYT7f4uf/sYaghMaGDOKiDeRNPmEgBKYNcJpe01/lsaT2H24c/2q22kve X-Received: by 10.66.164.229 with SMTP id yt5mr50249278pab.67.1395348831396; Thu, 20 Mar 2014 13:53:51 -0700 (PDT) Received: from localhost (cpe-76-93-135-111.san.res.rr.com. [76.93.135.111]) by mx.google.com with ESMTPSA id vo1sm15019206pab.32.2014.03.20.13.53.49 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 20 Mar 2014 13:53:50 -0700 (PDT) From: Sebastian Capella To: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linaro-kernel@lists.linaro.org Cc: Sebastian Capella , Len Brown , Pavel Machek , "Rafael J. Wysocki" Subject: [PATCH RFC] PM / Hibernate: no kernel_power_off when pm_power_off NULL Date: Thu, 20 Mar 2014 13:53:15 -0700 Message-Id: <1395348795-8554-2-git-send-email-sebastian.capella@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1395348795-8554-1-git-send-email-sebastian.capella@linaro.org> References: <1395348795-8554-1-git-send-email-sebastian.capella@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Reboot logic in kernel/reboot will avoid calling kernel_power_off when pm_power_off is null, and instead uses kernel_halt. Change hibernate's power_down to follow the behavior in the reboot call. Calling the notifier twice (once for SYS_POWER_OFF and again for SYS_HALT) causes a panic during hibernation on Kirkwood Openblocks A6 board. Signed-off-by: Sebastian Capella Reported-by: Ezequiel Garcia Cc: Len Brown Cc: Pavel Machek Cc: "Rafael J. Wysocki" --- kernel/power/hibernate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c index 37170d4..6a278dc 100644 --- a/kernel/power/hibernate.c +++ b/kernel/power/hibernate.c @@ -595,7 +595,8 @@ static void power_down(void) case HIBERNATION_PLATFORM: hibernation_platform_enter(); case HIBERNATION_SHUTDOWN: - kernel_power_off(); + if (pm_power_off) + kernel_power_off(); break; #ifdef CONFIG_SUSPEND case HIBERNATION_SUSPEND: