All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Osipenko <digetx@gmail.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Thierry Reding <thierry.reding@gmail.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Lee Jones <lee.jones@linaro.org>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	Mark Brown <broonie@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Guenter Roeck <linux@roeck-us.net>,
	Russell King <linux@armlinux.org.uk>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Linux PM <linux-pm@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-tegra <linux-tegra@vger.kernel.org>
Subject: Re: [PATCH v1 0/6] Introduce power off call chain API
Date: Thu, 7 Oct 2021 11:52:46 +0300	[thread overview]
Message-ID: <e7763b75-205c-4e9f-ecdc-a32571a4b822@gmail.com> (raw)
In-Reply-To: <CAHp75VeHC5M-Rv+wvJQEvmtfX0k7fP6uremGHFMnd8kEqPnBpw@mail.gmail.com>

07.10.2021 10:18, Andy Shevchenko пишет:
> On Thu, Oct 7, 2021 at 9:05 AM Dmitry Osipenko <digetx@gmail.com> wrote:
>>
>> Introduce power off call chain API that is inspired by the restart API.
>> It allows to have multiple power off handlers invoked along the chain
> 
> allows multiple
> 
>> until system is powered off. For the starter this series converts couple
> 
> the system
> a couple
> 
>> NVIDIA Tegra drivers to the new API. Existing pm_power_off() method
>> stays around and may be removed once all users will adopt the new API.
> 
> users adopt
> 
>>
>> There were couple attempts in the past to add power off API from
> 
> a couple
> 
>> Guenter Roeck and Thierry Reding, but they were never completed. This
>> is a somewhat simplified version which doesn't try to convert whole kernel
>> to the new API at once, but solves immediate practical problem that we
> 
> problems
> 
>> have on Nexus 7 Android tablet where device needs to chain power off
> 
> tablets where the device

Thank you for the corrections, so far there is one problem and one tablet :)

> Immediate question here is how do you see the plan of spreading this.
> I.o.w. can you put an explanation that you have checked, let's say
>> 80% current users, and they may be converted like [example
> placeholder] without any special tricks?

The rough plan is:

1. Add new API.
2. Convert drivers to the new API per subsystem.
3. Expose do_kernel_restart().
4. Replace pm_power_off() with do_kernel_poweroff() per arch/, making
power off similar to the restart that uses do_kernel_restart().
5. Remove do_kernel_restart() from kernel/reboot.c

Majority of pm_power_off() users shouldn't need the chaining and
pm_power_off() doesn't conflict with the new API, so there is no need to
rush the conversion.

The single-link chain users could be converted to the new API directly,
this will remove some global variables. But at first should be better to
gain more users who actually need the chained power off since they may
have very specific requirements not covered by the current variant of
the API and will be easier to evolve API with less users.

  reply	other threads:[~2021-10-07  8:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-07  6:02 [PATCH v1 0/6] Introduce power off call chain API Dmitry Osipenko
2021-10-07  6:02 ` [PATCH v1 1/6] notifier: Add blocking_notifier_call_chain_empty() Dmitry Osipenko
2021-10-07  6:02 ` [PATCH v1 2/6] kernel: Add power off handler call chain API Dmitry Osipenko
2021-10-07  6:02 ` [PATCH v1 3/6] kernel: Add devm_register_restart_handler() Dmitry Osipenko
2021-10-07  6:02 ` [PATCH v1 4/6] mfd: max77620: Use power off call chain API Dmitry Osipenko
2021-10-19 15:31   ` Lee Jones
2021-10-19 20:51     ` Dmitry Osipenko
2021-10-07  6:02 ` [PATCH v1 5/6] soc/tegra: pmc: Use devm_register_restart_handler() Dmitry Osipenko
2021-10-07  6:02 ` [PATCH v1 6/6] soc/tegra: pmc: Add power off handler Dmitry Osipenko
2021-10-07  7:18 ` [PATCH v1 0/6] Introduce power off call chain API Andy Shevchenko
2021-10-07  8:52   ` Dmitry Osipenko [this message]
2021-10-07  9:11     ` Andy Shevchenko
2021-10-07 10:11       ` Dmitry Osipenko

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=e7763b75-205c-4e9f-ecdc-a32571a4b822@gmail.com \
    --to=digetx@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=broonie@kernel.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=jonathanh@nvidia.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=linux@roeck-us.net \
    --cc=rafael@kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=ulf.hansson@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.