From: Guenter Roeck <linux@roeck-us.net>
To: Alexander Graf <agraf@suse.de>, linuxppc-dev@lists.ozlabs.org
Cc: arnd@arndb.de, geoff@infradead.org, alistair@popple.id.au,
scottwood@freescale.com, agust@denx.de
Subject: Re: [PATCH v2 00/20] powerpc: Convert power off logic to pm_power_off
Date: Mon, 13 Oct 2014 08:54:23 -0700 [thread overview]
Message-ID: <543BF5AF.9010806@roeck-us.net> (raw)
In-Reply-To: <1413208888-49211-1-git-send-email-agraf@suse.de>
On 10/13/2014 07:01 AM, Alexander Graf wrote:
> The generic Linux framework to power off the machine is a function pointer
> called pm_power_off. The trick about this pointer is that device drivers can
> potentially implement it rather than board files.
>
> Today on PowerPC we set pm_power_off to invoke our generic full machine power
> off logic which then calls ppc_md.power_off to invoke machine specific power
> off.
>
> However, when we want to add a power off GPIO via the "gpio-poweroff" driver,
> this card house falls apart. That driver only registers itself if pm_power_off
> is NULL to ensure it doesn't override board specific logic. However, since we
> always set pm_power_off to the generic power off logic (which will just not
> power off the machine if no ppc_md.power_off call is implemented), we can't
> implement power off via the generic GPIO power off driver.
>
> To fix this up, let's get rid of the ppc_md.power_off logic and just always use
> pm_power_off as was intended. Then individual drivers such as the GPIO power off
> driver can implement power off logic via that function pointer.
>
> With this patch set applied and a few patches on top of QEMU that implement a
> power off GPIO on the virt e500 machine, I can successfully turn off my virtual
> machine after halt.
>
> Michael / Ben, you can find this patch set as a git branch at the URL below.
> When applying it, please use that one to ensure that Guenter can easily merge
> his work with my work.
>
> git://github.com/agraf/linux-2.6.git pm_power_off-v2
>
> Alex
>
> ---
>
> v1 -> v2:
>
> - fix typo in 47x
> - put ppc_md static replacement setters into probe function
>
> Alexander Graf (20):
> powerpc: Support override of pm_power_off
> powerpc/xmon: Support either ppc_md.power_off or pm_power_off
> powerpc/47x: Use pm_power_off rather than ppc_md.power_off
> powerpc/52xx/efika: Use pm_power_off rather than ppc_md.power_off
> powerpc/mpc8349emitx: Use pm_power_off rather than ppc_md.power_off
> powerpc/corenet: Use pm_power_off rather than ppc_md.power_off
> powerpc/85xx/sgy_cts1000: Use pm_power_off rather than
> ppc_md.power_off
> powerpc/celleb: Use pm_power_off rather than ppc_md.power_off
> powerpc/cell/qpace: Use pm_power_off rather than ppc_md.power_off
> powerpc/cell: Use pm_power_off rather than ppc_md.power_off
> powerpc/chrp: Use pm_power_off rather than ppc_md.power_off
> powerpc/6xx/gamecube: Use pm_power_off rather than ppc_md.power_off
> powerpc/6xx/linkstation: Use pm_power_off rather than ppc_md.power_off
> powerpc/6xx/wii: Use pm_power_off rather than ppc_md.power_off
> powerpc/maple: Use pm_power_off rather than ppc_md.power_off
> powerpc/powermac: Use pm_power_off rather than ppc_md.power_off
> powerpc/powernv: Use pm_power_off rather than ppc_md.power_off
> powerpc/ps3: Use pm_power_off rather than ppc_md.power_off
> powerpc/pseries: Use pm_power_off rather than ppc_md.power_off
> powerpc: Remove ppc_md.power_off
>
On another note, and maybe you discussed this separately: I don't really
see the value of having 20 separate patches here, other than creating
a lot of work for the maintainer. Wouldn't it be easier
to just have one patch instead ?
Sure, it would touch 20+ files instead of just one, but then you
could drop some of the workarounds you have to put in place just
to undo it at the end, and it is not as if the patches are really
independent of each other or as if there would be any benefit
in respect to the ability to bisect or merge into earlier versions
of the kernel.
I for my part don't plan for 20 patches when I convert it to
use the poweroff handler. Hope it is ok with everyone that it
will be just one patch.
Thanks,
Guenter
prev parent reply other threads:[~2014-10-13 15:55 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-13 14:01 [PATCH v2 00/20] powerpc: Convert power off logic to pm_power_off Alexander Graf
2014-10-13 14:01 ` [PATCH v2 01/20] powerpc: Support override of pm_power_off Alexander Graf
2014-10-13 14:01 ` [PATCH v2 02/20] powerpc/xmon: Support either ppc_md.power_off or pm_power_off Alexander Graf
2014-10-13 14:01 ` [PATCH v2 03/20] powerpc/47x: Use pm_power_off rather than ppc_md.power_off Alexander Graf
2014-10-13 14:01 ` [PATCH v2 04/20] powerpc/52xx/efika: " Alexander Graf
2014-10-13 14:01 ` [PATCH v2 05/20] powerpc/mpc8349emitx: " Alexander Graf
2014-10-13 14:01 ` [PATCH v2 06/20] powerpc/corenet: " Alexander Graf
2014-10-13 14:01 ` [PATCH v2 07/20] powerpc/85xx/sgy_cts1000: " Alexander Graf
2014-10-13 14:01 ` [PATCH v2 08/20] powerpc/celleb: " Alexander Graf
2014-10-13 14:01 ` [PATCH v2 09/20] powerpc/cell/qpace: " Alexander Graf
2014-10-13 14:01 ` [PATCH v2 10/20] powerpc/cell: " Alexander Graf
2014-10-13 14:01 ` [PATCH v2 11/20] powerpc/chrp: " Alexander Graf
2014-10-13 14:01 ` [PATCH v2 12/20] powerpc/6xx/gamecube: " Alexander Graf
2014-10-13 14:01 ` [PATCH v2 13/20] powerpc/6xx/linkstation: " Alexander Graf
2014-10-13 14:01 ` [PATCH v2 14/20] powerpc/6xx/wii: " Alexander Graf
2014-10-13 14:01 ` [PATCH v2 15/20] powerpc/maple: " Alexander Graf
2014-10-13 14:01 ` [PATCH v2 16/20] powerpc/powermac: " Alexander Graf
2014-10-13 14:01 ` [PATCH v2 17/20] powerpc/powernv: " Alexander Graf
2014-10-13 14:01 ` [PATCH v2 18/20] powerpc/ps3: " Alexander Graf
2014-10-13 14:01 ` [PATCH v2 19/20] powerpc/pseries: " Alexander Graf
2014-10-13 14:01 ` [PATCH v2 20/20] powerpc: Remove ppc_md.power_off Alexander Graf
2014-10-13 15:47 ` [PATCH v2 00/20] powerpc: Convert power off logic to pm_power_off Guenter Roeck
2014-10-13 15:54 ` Guenter Roeck [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=543BF5AF.9010806@roeck-us.net \
--to=linux@roeck-us.net \
--cc=agraf@suse.de \
--cc=agust@denx.de \
--cc=alistair@popple.id.au \
--cc=arnd@arndb.de \
--cc=geoff@infradead.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=scottwood@freescale.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).