Re: [PATCH v1 0/6] Introduce power off call chain API
From: Andy Shevchenko <hidden>
Date: 2021-10-07 09:11:21
Also in:
linux-tegra, lkml
On Thu, Oct 07, 2021 at 11:52:46AM +0300, Dmitry Osipenko wrote:
07.10.2021 10:18, Andy Shevchenko пишет:quoted
On Thu, Oct 7, 2021 at 9:05 AM Dmitry Osipenko [off-list ref] wrote:
...
quoted
quoted
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 weproblemsquoted
have on Nexus 7 Android tablet where device needs to chain power offtablets where the deviceThank you for the corrections, so far there is one problem and one tablet :)
Then use "the Nexus 7 Android tablet" :-)
quoted
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 sayquoted
80% current users, and they may be converted like [exampleplaceholder] without any special tricks?The rough plan is: 1. Add new API. 2. Convert drivers to the new API per subsystem.
I would suggest to show that you are actually into it by converting a couple of the subsystems for the starter.
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.
All above in one or another form should be in cover letter. -- With Best Regards, Andy Shevchenko