From patchwork Tue Sep 30 18:00:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 5006041 Return-Path: X-Original-To: patchwork-linux-sh@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 164A7BEEA6 for ; Tue, 30 Sep 2014 18:05:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 47D3120225 for ; Tue, 30 Sep 2014 18:05:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9F57720220 for ; Tue, 30 Sep 2014 18:05:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753504AbaI3SBX (ORCPT ); Tue, 30 Sep 2014 14:01:23 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:43664 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753333AbaI3SBQ (ORCPT ); Tue, 30 Sep 2014 14:01:16 -0400 Received: by mail-pa0-f46.google.com with SMTP id kq14so6758072pab.19 for ; Tue, 30 Sep 2014 11:01:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=UQk2ZZIEsVV7XoBvwBpR2xNqiFttFEVsvwGJrA9ovjo=; b=RpgJOc5f6D4ezqK8vg12ZsWDCubAigAMtWGnSg09mE3LDY2cksZZ0QTwtto/Ra15ax yDO7QBUwhaqRqjfuIeEQH+T6Hor5SLCAR6m10hb/43wJcfd1PCRQAzi7SHtcJnQ+gnS9 EOmoNWNZalEbu0nnRVJ+W72p87mGOQ6sAoBX20q7TSwWpQyaMg8mEZHqIpLRjlGP/ZBq TGo2Ol4D0/QlIDtuktQl+RyZA0XtqnNq7rwkwhfSBBW4BvyBNZsGxNce6KPzqnsK3e7s hzmro+ZTqCXzp4yTMb4x860bb61Jigw2Dmo4oQ9PlOmQ6gqu7J9zTMhFIrSTfILrfZZt 8+2g== X-Received: by 10.68.95.227 with SMTP id dn3mr72199435pbb.108.1412100075765; Tue, 30 Sep 2014 11:01:15 -0700 (PDT) Received: from localhost (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by mx.google.com with ESMTPSA id f2sm15798823pdd.25.2014.09.30.11.01.14 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 30 Sep 2014 11:01:15 -0700 (PDT) From: Guenter Roeck To: linux-kernel@vger.kernel.org Cc: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org, linux-ia64@vger.kernel.org, linux-metag@vger.kernel.org, linux-mips@linux-mips.org, linux-parisc@vger.kernel.org, linux-sh@vger.kernel.org, xen-devel@lists.xenproject.org, Guenter Roeck , "James E.J. Bottomley" , Helge Deller Subject: [RFC PATCH 03/16] parisc: support poweroff through poweroff handler call chain Date: Tue, 30 Sep 2014 11:00:43 -0700 Message-Id: <1412100056-15517-4-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1412100056-15517-1-git-send-email-linux@roeck-us.net> References: <1412100056-15517-1-git-send-email-linux@roeck-us.net> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SUSPICIOUS_RECIPS,T_DKIM_INVALID, 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 The kernel core now supports a poweroff handler call chain to remove power from the system. Call it from machine_power_off. Also, do not use pm_power_off as alternate pointer to machine_power_off. Have the parisc/power driver call kernel_power_off() which in turn will call machine_power_off(). Cc: James E.J. Bottomley Cc: Helge Deller Signed-off-by: Guenter Roeck --- arch/parisc/kernel/process.c | 7 +++++-- drivers/parisc/power.c | 3 +-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c index 0bbbf0d..21d1ab3 100644 --- a/arch/parisc/kernel/process.c +++ b/arch/parisc/kernel/process.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -133,7 +134,9 @@ void machine_power_off(void) pdc_soft_power_button(0); pdc_chassis_send_status(PDC_CHASSIS_DIRECT_SHUTDOWN); - + + do_kernel_poweroff(); + /* It seems we have no way to power the system off via * software. The user has to press the button himself. */ @@ -141,7 +144,7 @@ void machine_power_off(void) "Please power this system off now."); } -void (*pm_power_off)(void) = machine_power_off; +void (*pm_power_off)(void); EXPORT_SYMBOL(pm_power_off); /* diff --git a/drivers/parisc/power.c b/drivers/parisc/power.c index 90cca5e..de5b2ff 100644 --- a/drivers/parisc/power.c +++ b/drivers/parisc/power.c @@ -95,8 +95,7 @@ static void process_shutdown(void) /* send kill signal */ if (kill_cad_pid(SIGINT, 1)) { /* just in case killing init process failed */ - if (pm_power_off) - pm_power_off(); + kernel_power_off(); } } }