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: 26769 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f70.google.com (mail-yh0-f70.google.com [209.85.213.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D99ED20143 for ; Thu, 20 Mar 2014 20:54:03 +0000 (UTC) Received: by mail-yh0-f70.google.com with SMTP id c41sf3677888yho.9 for ; Thu, 20 Mar 2014 13:54:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=Tr+vUOiXrc2Qa5Z01FgnR8VnnWp6P0mzIld9gwRgkP4=; b=aq59LKu8YyTL6FGEjMQUz63v+6A++AWRfc27kUXnEn34pYXIQcD9R2iOmbKRC+56V7 yWUelE0C9cd2jxhz8gAfUBaqINxJtssSQZ0i4Gq2kZH+sdSubuAkniv7HNk9ITZPcfqc TjpkGd7U8SaFFxQhdo7mQL7Ul6DuGdd/WcRUGfyn46SKv9FlauxyQ4KUQuTGMjfxfkph +mqBLDExCQVAVjAhnGRP8J/KLLloONhIcT5PmNV2faRfL3myQd61JN1SCpUl9vkeNG5R 7bP+u8lLmeG4Fmk/An0F5fItTvvA1mXSU+Mliug0UHYtWt6R84Olje+cavGyPCfCJgEW WNFA== X-Gm-Message-State: ALoCoQn9NV4wwxe+WxWTjy+s5FZse8saQc5rdvCkiiK52XSPHzpXCR681DvfPxIMHjBYNIdIIHFt X-Received: by 10.224.113.202 with SMTP id b10mr18035024qaq.3.1395348843428; Thu, 20 Mar 2014 13:54:03 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.86.233 with SMTP id p96ls384179qgd.33.gmail; Thu, 20 Mar 2014 13:54:03 -0700 (PDT) X-Received: by 10.220.147.16 with SMTP id j16mr7695815vcv.14.1395348843313; Thu, 20 Mar 2014 13:54:03 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id x3si685111vcn.9.2014.03.20.13.54.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Mar 2014 13:54:03 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.173; Received: by mail-vc0-f173.google.com with SMTP id il7so1641584vcb.4 for ; Thu, 20 Mar 2014 13:54:03 -0700 (PDT) X-Received: by 10.58.247.193 with SMTP id yg1mr2989053vec.41.1395348843219; Thu, 20 Mar 2014 13:54:03 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.78.9 with SMTP id i9csp418581vck; Thu, 20 Mar 2014 13:54:02 -0700 (PDT) X-Received: by 10.66.217.133 with SMTP id oy5mr50484121pac.46.1395348841220; Thu, 20 Mar 2014 13:54:01 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id hh1si2211318pac.382.2014.03.20.13.53.59; Thu, 20 Mar 2014 13:53:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759798AbaCTUxz (ORCPT + 11 others); 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-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: list List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: sebastian.capella@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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: