From patchwork Tue Apr 22 00:30:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Capella X-Patchwork-Id: 28755 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f200.google.com (mail-ig0-f200.google.com [209.85.213.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0EACA2032B for ; Tue, 22 Apr 2014 00:31:52 +0000 (UTC) Received: by mail-ig0-f200.google.com with SMTP id l13sf9573913iga.11 for ; Mon, 21 Apr 2014 17:31:52 -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:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=wS3qg6IEim2TbDgJp4RO8o4AcJP3GK0NBAqMlVLJg5I=; b=CqphCYiAqrDs29S0DIRgrwnSSwR5VkphcxNYtOWVVBCsdpSvK5H7SQnTePY1QV3ExY TStWhf2wSjfldRXfW0XP72q6T0vw3Fu+GPK8mS2t2120k32yyUke9O8eGcGcMKL9ZH5x Yra2o9Nw1elgxWbidmarcY/GG5hFT53K/mKR86k33pBNO3R7P5QENt5EczjjCoNXMbMH hUXOhz0dXJ9TsaTOJFR8noYeIr+7+EfUNLvWuRSbUyOBQnPzXB+4yxY/aWN54k60KqKl q1NGenv4WMUQH4FGAGKOSkcDzkQsFFsCr2xdCiZ7MH/ZdzAfN0OPN82se/iKTXrHc93w xP9Q== X-Gm-Message-State: ALoCoQnIMJt6QIZUGRzJ0lqNCMjdmQzP5V/4JICBQZSy6t3ImJdzEOL+DsTHC19VYCQzTq60TU4n X-Received: by 10.182.230.132 with SMTP id sy4mr10592094obc.48.1398126712214; Mon, 21 Apr 2014 17:31:52 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.97.8 with SMTP id l8ls2687972qge.27.gmail; Mon, 21 Apr 2014 17:31:52 -0700 (PDT) X-Received: by 10.52.142.10 with SMTP id rs10mr28674825vdb.3.1398126712119; Mon, 21 Apr 2014 17:31:52 -0700 (PDT) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id f7si6564905vcz.57.2014.04.21.17.31.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 21 Apr 2014 17:31:52 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.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.128.173; Received: by mail-ve0-f173.google.com with SMTP id oy12so8926148veb.32 for ; Mon, 21 Apr 2014 17:31:52 -0700 (PDT) X-Received: by 10.58.23.6 with SMTP id i6mr36421795vef.12.1398126712026; Mon, 21 Apr 2014 17:31:52 -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.221.72 with SMTP id ib8csp329404vcb; Mon, 21 Apr 2014 17:31:51 -0700 (PDT) X-Received: by 10.68.134.101 with SMTP id pj5mr41412464pbb.62.1398126710957; Mon, 21 Apr 2014 17:31:50 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s8si21697258pas.385.2014.04.21.17.31.49; Mon, 21 Apr 2014 17:31:50 -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 S1753810AbaDVAav (ORCPT + 12 others); Mon, 21 Apr 2014 20:30:51 -0400 Received: from mail-pb0-f47.google.com ([209.85.160.47]:40810 "EHLO mail-pb0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753252AbaDVAau (ORCPT ); Mon, 21 Apr 2014 20:30:50 -0400 Received: by mail-pb0-f47.google.com with SMTP id up15so4287549pbc.34 for ; Mon, 21 Apr 2014 17:30:49 -0700 (PDT) X-Received: by 10.68.106.130 with SMTP id gu2mr40888560pbb.59.1398126649433; Mon, 21 Apr 2014 17:30:49 -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 yv7sm193071915pac.33.2014.04.21.17.30.47 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 21 Apr 2014 17:30:48 -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" , Russell King , One Thousand Gnomes Subject: [PATCH v2] PM / Hibernate: no kernel_power_off when pm_power_off NULL Date: Mon, 21 Apr 2014 17:30:46 -0700 Message-Id: <1398126646-29518-1-git-send-email-sebastian.capella@linaro.org> X-Mailer: git-send-email 1.7.9.5 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.128.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" Cc: Russell King Cc: One Thousand Gnomes Reviewed-by: Pavel Machek --- kernel/power/hibernate.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c index f4f2073..7642932 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: @@ -623,7 +624,8 @@ static void power_down(void) * corruption after resume. */ printk(KERN_CRIT "PM: Please power down manually\n"); - while(1); + while (1) + cpu_relax(); } /**