linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: christoffer.dall@linaro.org (Christoffer Dall)
To: linux-arm-kernel@lists.infradead.org
Subject: [Discussion] how to implement external power down for ARM
Date: Tue, 5 May 2015 12:51:57 +0200	[thread overview]
Message-ID: <CAMJs5B9V_tWxut6LLWDdpN1m9NsaC_JGfR_U_SHN=OOhdHe_Yw@mail.gmail.com> (raw)
In-Reply-To: <2490159.r1U8jHTvO3@wuerfel>

On Tue, May 5, 2015 at 11:53 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Tuesday 05 May 2015 12:27:54 Joel Stanley wrote:
>> On Tue, May 5, 2015 at 1:19 AM, Arnd Bergmann <arnd@arndb.de> wrote:
>> > On Monday 04 May 2015 10:09:04 Shannon Zhao wrote:
>> >> On 2015/4/30 17:56, Arnd Bergmann wrote:
>> >> > On Thursday 30 April 2015 10:29:53 Mark Rutland wrote:
>> >
>> >> > a) have an input device send the KEY_POWEROFF or KEY_REBOOT events to
>> >> >    user space, and have some process (e.g. desktop environment, or daemon)
>> >>
>> >> About this daemon, do we need a doc or spec to standardize it?
>> >
>> > There is probably documentation about this that we just need to locate.
>> > On my workstation, the power button device is owned by "systemd-logind",
>> > I'd assume something like that to be present elsewhere as well.
>> >
>> >> > b) Have a special driver that calls orderly_poweroff or orderly_reboot.
>> >> >    Only PowerPC (OPAL) uses the orderly_reboot() here, but a few platforms
>> >> >    (Xen, fsl_hypervisor, and some sparc and powerpc machines) as well
>> >> >    as some device drivers (thermal management etc) call this as well.
>> >> >    The effect is to call a user-configured binary (/sbin/reboot and
>> >> >    /sbin/poweroff by default).
>> >> >
>> >>
>> >> This looks good which reuses existing user space process.
>> >>
>> >
>> > Joel Stanly wrote that patch for PowerPC, maybe he can explain why
>> > this PowerPC is doing it this way instead of having an input device
>> > that sends KEY_RESTART. It's probably a good idea to have ARM and
>> > PowerPC normally do the same thing here, especially if there are
>> > problems with just using a gpio-key device.
>>
>> We wanted to support reboot and poweroff on existing distributions
>> without having to rely on new userspace.
>>
>> I chatted to a few people at linux.conf.au this year and we came to
>> the conclusion that the options were orderly_poweroff() or ACPI for
>> doing a graceful shutdown involving userspace. ACPI required acpid or
>> a desktop environment listening to the netlink message (plus we aren't
>> an ACPI machine) so that was out.
>>
>> KEY_POWEROFF looks useful, but how would you support userspace that
>> does not have a systemd-logind, or anything listening to that input
>> event?
>
> Ok, thanks for providing that background. I was under the impression
> that the power button was not handled through netlink but instead
> through the input subsystem, and I just checked the acpid source
> code and found that it basically handles acpi events and input
> events separately and should still work fine if only one of the
> two is present.
>
> I still find it hard to come up with a good decision for ARM here:
> I think either way will work in most cases but has minor downsides
> (orderly_poweroff() and orderly_reboot() being less configurable
> vs input events requiring some user space to run).
> Unfortunately, it is not an option to just "do both", because the
> orderly_reboot() will unconditionally reboot the system, so any
> user configuration is just ignored here.
>
> Maybe we just use the the input framework for now, because it
> requires zero kernel changes and is already used on ARM platforms
> today, and see if we run into problems with that.
>
Do ARM distributions (Fedora, Ubuntu, Debian, ...) support the
necessary userspace handling so that things work with the input
subsystem?

-Christoffer

  reply	other threads:[~2015-05-05 10:51 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-30  1:03 [Discussion] how to implement external power down for ARM Shannon Zhao
2015-04-30  8:03 ` Arnd Bergmann
2015-04-30  9:08   ` Peter Maydell
2015-04-30  9:19     ` Arnd Bergmann
2015-04-30  9:29     ` Mark Rutland
2015-04-30  9:56       ` Arnd Bergmann
2015-05-04  2:09         ` Shannon Zhao
2015-05-04 15:49           ` Arnd Bergmann
2015-05-05  2:57             ` Joel Stanley
2015-05-05  9:53               ` Arnd Bergmann
2015-05-05 10:51                 ` Christoffer Dall [this message]
2015-05-05 10:55                   ` Arnd Bergmann
2015-05-05 11:13                     ` Shannon Zhao
2015-05-06  6:56                       ` Shannon Zhao
2015-05-06  7:29                         ` Arnd Bergmann
2015-05-06  8:19                           ` Shannon Zhao
2015-05-06  8:37                             ` Arnd Bergmann
2015-05-06  8:41                               ` Shannon Zhao
2015-05-06 10:14                             ` Christoffer Dall
2015-05-07  2:39                           ` Shannon Zhao
2015-05-07  8:55                             ` Arnd Bergmann
2015-05-07  9:18                               ` Shannon Zhao
2015-05-07  9:43                                 ` Arnd Bergmann
2015-05-07 12:10                                   ` Shannon Zhao
2015-05-07 12:12                                     ` Peter Maydell
2015-05-07 12:18                                       ` Shannon Zhao
2015-05-07 12:34                                         ` Peter Maydell
2015-05-07 12:48                                           ` Arnd Bergmann
2015-05-07 13:02                                           ` Shannon Zhao
2015-04-30 13:38       ` Hanjun Guo
2015-05-04  1:55         ` Shannon Zhao

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='CAMJs5B9V_tWxut6LLWDdpN1m9NsaC_JGfR_U_SHN=OOhdHe_Yw@mail.gmail.com' \
    --to=christoffer.dall@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).