From patchwork Wed Mar 19 20:47:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Capella X-Patchwork-Id: 3861121 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D7E6A9F334 for ; Wed, 19 Mar 2014 20:47:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 73D3A20203 for ; Wed, 19 Mar 2014 20:47:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6AC15201FA for ; Wed, 19 Mar 2014 20:47:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754151AbaCSUrk (ORCPT ); Wed, 19 Mar 2014 16:47:40 -0400 Received: from mail-wi0-f169.google.com ([209.85.212.169]:33310 "EHLO mail-wi0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753121AbaCSUrj (ORCPT ); Wed, 19 Mar 2014 16:47:39 -0400 Received: by mail-wi0-f169.google.com with SMTP id hm4so5346317wib.0 for ; Wed, 19 Mar 2014 13:47:38 -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:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=V9MrtNSKKDcnxLTr0jfDXO3XPDGyMQiYSnKtoYVV6sc=; b=JbIhm/eF8eNDdsU+7GGac+vE9/hS4BLmgLEu/zk4lmkr5RKLKBdaJ8l0ti8+2BmlkZ Ao2A3ycLlV2o22o5ayGIEb5J6Po90IQSzpBaWRt4yzhj72tgjjvF+VyCHpBV2JomFp0U bFt30GbuaBq35WNjTAo+CPsaVyIo6/1BlTn0U3iqA8XsMV4T76GzGxaWUyQrZ1mu0/pW Tz8/MO53nLMrUO8qP9aqIrWpz0LZpC4ITSwQ9qnFc6aEUHX+xstvOzNWK9qrgrs5fivU bZy5HMVAW1a42fVidqkvmDYrYUHrUKwu4+UK444UvrdznouiwJZFDBvV3y07kd5PEZyU Bfww== X-Gm-Message-State: ALoCoQnPGeXc711cxEpguX+wmAo+a9pKct+OhmbROaymBcLOwecuRbtIhgGz/RgujhXZcULfin/s MIME-Version: 1.0 X-Received: by 10.194.175.202 with SMTP id cc10mr4410891wjc.48.1395262058384; Wed, 19 Mar 2014 13:47:38 -0700 (PDT) Received: by 10.227.241.146 with HTTP; Wed, 19 Mar 2014 13:47:38 -0700 (PDT) In-Reply-To: <20140319154434.GA3488@arch.cereza> References: <1394016605-24120-1-git-send-email-sebastian.capella@linaro.org> <1394016605-24120-3-git-send-email-sebastian.capella@linaro.org> <20140316070917.GA3094@arch.cereza> <20140317204410.GA1118@arch.cereza> <20140319154434.GA3488@arch.cereza> Date: Wed, 19 Mar 2014 13:47:38 -0700 Message-ID: Subject: Re: [PATCH v7 2/2] ARM hibernation / suspend-to-disk From: Sebastian Capella To: Ezequiel Garcia Cc: Stefano Stabellini , Len Brown , "linaro-kernel@lists.linaro.org" , Russell King , Jonathan Austin , "linux-pm@vger.kernel.org" , "Rafael J. Wysocki" , Victor Kamensky , Will Deacon , Linux Kernel , Sricharan R , Santosh Shilimkar , Ben Dooks , Russ Dill , Nicolas Pitre , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , Laura Abbott , Catalin Marinas , Stephen Boyd , "linux-arm-kernel@lists.infradead.org" , Jiang Liu 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 On 19 March 2014 08:44, Ezequiel Garcia wrote: > Tested-by: Ezequiel Garcia Thanks! > On the other side, this board has no pm_power_off() support, which means > kernel_halt() is called after kernel_power_off(). > > I'm not sure if a NULL pm_power_off() is supported, but this makes my kernel > crash in a reboot notifier that's called twice (first in kernel_power_off > and then in kernel_halt): The omap board I'm using has a null pm_power_off. I added code to bypass kernel_power_off in the event pm_power_off is null like this: This follows the behavior in the reboot syscall which does it this way also. I'm testing this now, and it seems work fine. If this looks good, I can add it as an additional patch. Thanks, Sebastian --- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c index a5f702a..d96b910 100644 --- a/kernel/power/hibernate.c +++ b/kernel/power/hibernate.c @@ -594,7 +594,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: