* [RFC] poweroff via pm_power_off if set
@ 2008-06-13 15:36 Christian Krafft
2008-06-13 16:00 ` Kumar Gala
0 siblings, 1 reply; 3+ messages in thread
From: Christian Krafft @ 2008-06-13 15:36 UTC (permalink / raw)
To: linuxppc-dev; +Cc: krafft
[-- Attachment #1: Type: text/plain, Size: 1627 bytes --]
This patch is needed to make ipmi_poweroff working on powerpc.
It straightens the poweroff procedure to match with other architectures.
At the moment powerpc plattforms can define their poweroff method using
ppc_md.power_off. The only way for plattform independent driver (ipmi_poweroff)
to register it's poweroff function is to use pm_power_off. So machine_power_off
should check whether pm_power_off has been set and if so it should be used.
If not, plattform dependent ppc_md.power_off should be called.
Signed-off-by: Christian Krafft <krafft@de.ibm.com>
Index: linux.git/arch/powerpc/kernel/setup-common.c
===================================================================
--- linux.git.orig/arch/powerpc/kernel/setup-common.c
+++ linux.git/arch/powerpc/kernel/setup-common.c
@@ -121,6 +121,8 @@ void machine_restart(char *cmd)
void machine_power_off(void)
{
machine_shutdown();
+ if (pm_power_off)
+ pm_power_off();
if (ppc_md.power_off)
ppc_md.power_off();
#ifdef CONFIG_SMP
@@ -133,7 +135,7 @@ void machine_power_off(void)
/* Used by the G5 thermal driver */
EXPORT_SYMBOL_GPL(machine_power_off);
-void (*pm_power_off)(void) = machine_power_off;
+void (*pm_power_off)(void) = NULL;
EXPORT_SYMBOL_GPL(pm_power_off);
void machine_halt(void)
--
Mit freundlichen Gruessen,
kind regards,
Christian Krafft
IBM Systems & Technology Group,
Linux Kernel Development
IT Specialist
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschaeftsfuehrung: Herbert Kircher
Sitz der Gesellschaft: Boeblingen
Registriergericht: Amtsgericht Stuttgart, HRB 243294
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFC] poweroff via pm_power_off if set
2008-06-13 15:36 [RFC] poweroff via pm_power_off if set Christian Krafft
@ 2008-06-13 16:00 ` Kumar Gala
2008-06-15 15:01 ` Christian Krafft
0 siblings, 1 reply; 3+ messages in thread
From: Kumar Gala @ 2008-06-13 16:00 UTC (permalink / raw)
To: Christian Krafft; +Cc: linuxppc-dev
On Jun 13, 2008, at 10:36 AM, Christian Krafft wrote:
> This patch is needed to make ipmi_poweroff working on powerpc.
> It straightens the poweroff procedure to match with other
> architectures.
> At the moment powerpc plattforms can define their poweroff method
> using
> ppc_md.power_off. The only way for plattform independent driver
> (ipmi_poweroff)
> to register it's poweroff function is to use pm_power_off. So
> machine_power_off
> should check whether pm_power_off has been set and if so it should
> be used.
> If not, plattform dependent ppc_md.power_off should be called.
It seems like this should be the other way around. Meaning
ppc_md.power_off should be called first than pm_power_off. If a
platform provides a power off mechanism that should presuming take
precedence over the ipmi_poweroff.
- k
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFC] poweroff via pm_power_off if set
2008-06-13 16:00 ` Kumar Gala
@ 2008-06-15 15:01 ` Christian Krafft
0 siblings, 0 replies; 3+ messages in thread
From: Christian Krafft @ 2008-06-15 15:01 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev, krafft
[-- Attachment #1: Type: text/plain, Size: 1593 bytes --]
On Fri, 13 Jun 2008 11:00:33 -0500
Kumar Gala <galak@kernel.crashing.org> wrote:
>
> On Jun 13, 2008, at 10:36 AM, Christian Krafft wrote:
>
> > This patch is needed to make ipmi_poweroff working on powerpc.
> > It straightens the poweroff procedure to match with other
> > architectures.
> > At the moment powerpc plattforms can define their poweroff method
> > using
> > ppc_md.power_off. The only way for plattform independent driver
> > (ipmi_poweroff)
> > to register it's poweroff function is to use pm_power_off. So
> > machine_power_off
> > should check whether pm_power_off has been set and if so it should
> > be used.
> > If not, plattform dependent ppc_md.power_off should be called.
>
> It seems like this should be the other way around. Meaning
> ppc_md.power_off should be called first than pm_power_off. If a
> platform provides a power off mechanism that should presuming take
> precedence over the ipmi_poweroff.
>
> - k
I'd see the pm_power_off as an option to override platform specific poweroff
function. If you want to use ppc_md.power_off you simply don't need to load
ipmi_poweroff module. Also it would not be possible to use ipmi_poweroff
on plattforms that provide a ppc_md.power_off.
--
Mit freundlichen Gruessen,
kind regards,
Christian Krafft
IBM Systems & Technology Group,
Linux Kernel Development
IT Specialist
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschaeftsfuehrung: Herbert Kircher
Sitz der Gesellschaft: Boeblingen
Registriergericht: Amtsgericht Stuttgart, HRB 243294
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-06-15 14:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-13 15:36 [RFC] poweroff via pm_power_off if set Christian Krafft
2008-06-13 16:00 ` Kumar Gala
2008-06-15 15:01 ` Christian Krafft
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).