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: 5006061 Return-Path: X-Original-To: patchwork-linux-arm@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 52FB0BEEA6 for ; Tue, 30 Sep 2014 18:05:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 77DD920166 for ; Tue, 30 Sep 2014 18:05:13 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A8D232015D for ; Tue, 30 Sep 2014 18:05:12 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XZ1l5-0007qs-QL; Tue, 30 Sep 2014 18:02:43 +0000 Received: from mail-pd0-x235.google.com ([2607:f8b0:400e:c02::235]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XZ1k0-0007I4-GU for linux-arm-kernel@lists.infradead.org; Tue, 30 Sep 2014 18:01:37 +0000 Received: by mail-pd0-f181.google.com with SMTP id z10so5559396pdj.26 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140930_110136_619520_FB75FA09 X-CRM114-Status: GOOD ( 12.98 ) X-Spam-Score: 2.0 (++) Cc: linux-mips@linux-mips.org, linux-ia64@vger.kernel.org, linux-c6x-dev@linux-c6x.org, linux-parisc@vger.kernel.org, linux-pm@vger.kernel.org, Helge Deller , linux-sh@vger.kernel.org, "James E.J. Bottomley" , Guenter Roeck , xen-devel@lists.xenproject.org, linux-metag@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, SUSPICIOUS_RECIPS, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no 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(); } } }