Re: [PATCH v13 00/85] KVM: Stop grabbing references to PFNMAP'd pages

2024-10-23 Thread Dmitry Osipenko
nd is (was?) >eliminated in v6.12. > - Drop check_user_page_hwpoison(). [Paolo] > - Drop the arm64 MTE fixes that went into 6.12. > - Slightly redo the guest_memfd interaction to account for 6.12 changes. Thanks a lot for working on this patchset! I tested it with native amdgpu/i

[PATCH v1] kernel/reboot: Fix powering off using a non-syscall code paths

2022-06-06 Thread Dmitry Osipenko
process and making the kernel_can_power_off() to check the legacy pm_power_off presence. Tested-by: Michael Ellerman # ppce500 Reported-by: Michael Ellerman # ppce500 Fixes: da007f171fc9 ("kernel/reboot: Change registration order of legacy power-off handler") Signed-off-by: Dmitr

Re: [PATCH v1] kernel/reboot: Change registration order of legacy power-off handler

2022-06-06 Thread Dmitry Osipenko
On 6/6/22 16:06, Michael Ellerman wrote: > Dmitry Osipenko writes: >> Hi Michael, >> >> On 6/5/22 05:01, Michael Ellerman wrote: >>> Dmitry Osipenko writes: >>>> We're unconditionally registering sys-off handler for the legacy >>>> pm_p

Re: [PATCH v1] kernel/reboot: Change registration order of legacy power-off handler

2022-06-05 Thread Dmitry Osipenko
Hi Michael, On 6/5/22 05:01, Michael Ellerman wrote: > Dmitry Osipenko writes: >> We're unconditionally registering sys-off handler for the legacy >> pm_power_off() callback, this causes problem for platforms that don't >> use power-off handlers at all and shoul

Re: [PATCH v5 04/21] kernel: Add combined power-off+restart handler call chain API

2022-01-27 Thread Dmitry Osipenko
Hello Michał, 09.01.2022 02:35, Michał Mirosław пишет: > BTW, I couldn't find a right description of my idea of unifying the > chains before, so let me sketch it now. > > The idea is to have a single system-off chain in which the callback > gets a mode ({QUERY_*, PREP_*, DO_*} for each of {*_REBO

Re: [PATCH v5 04/21] kernel: Add combined power-off+restart handler call chain API

2022-01-11 Thread Dmitry Osipenko
09.01.2022 02:35, Michał Mirosław пишет: > On Mon, Dec 13, 2021 at 12:02:52AM +0300, Dmitry Osipenko wrote: > [...] >> +/** >> + * struct power_off_data - Power-off callback argument >> + * >> + * @cb_data: Callback data. >> + */ >> +str

[PATCH v5 21/21] reboot: Remove pm_power_off_prepare()

2021-12-12 Thread Dmitry Osipenko
All pm_power_off_prepare() users were converted to sys-off handler API. Remove the obsolete callback. Signed-off-by: Dmitry Osipenko --- include/linux/pm.h | 1 - kernel/reboot.c| 11 --- 2 files changed, 12 deletions(-) diff --git a/include/linux/pm.h b/include/linux/pm.h index

[PATCH v5 20/21] regulator: pfuze100: Use devm_register_sys_off_handler()

2021-12-12 Thread Dmitry Osipenko
Use devm_register_sys_off_handler() that replaces global pm_power_off_prepare variable and allows to register multiple power-off handlers. Acked-by: Mark Brown Signed-off-by: Dmitry Osipenko --- drivers/regulator/pfuze100-regulator.c | 38 ++ 1 file changed, 14

[PATCH v5 19/21] ACPI: power: Switch to sys-off handler API

2021-12-12 Thread Dmitry Osipenko
Switch to sys-off API that replaces legacy pm_power_off callbacks. Signed-off-by: Dmitry Osipenko --- drivers/acpi/sleep.c | 25 +++-- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index eaa47753b758..2e613fddd614

[PATCH v5 18/21] memory: emif: Use kernel_can_power_off()

2021-12-12 Thread Dmitry Osipenko
Replace legacy pm_power_off with kernel_can_power_off() helper that is aware about chained power-off handlers. Signed-off-by: Dmitry Osipenko --- drivers/memory/emif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/memory/emif.c b/drivers/memory/emif.c index

[PATCH v5 17/21] nds32: Use do_kernel_power_off()

2021-12-12 Thread Dmitry Osipenko
Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new power-off API. Signed-off-by: Dmitry Osipenko --- arch/nds32

[PATCH v5 16/21] mips: Use do_kernel_power_off()

2021-12-12 Thread Dmitry Osipenko
Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new power-off API. Signed-off-by: Dmitry Osipenko --- arch/mips

[PATCH v5 15/21] ia64: Use do_kernel_power_off()

2021-12-12 Thread Dmitry Osipenko
Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new power-off API. Signed-off-by: Dmitry Osipenko --- arch/ia64

[PATCH v5 14/21] x86: Use do_kernel_power_off()

2021-12-12 Thread Dmitry Osipenko
Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new power-off API. Signed-off-by: Dmitry Osipenko --- arch/x86/kernel

[PATCH v5 13/21] sh: Use do_kernel_power_off()

2021-12-12 Thread Dmitry Osipenko
Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new power-off API. Signed-off-by: Dmitry Osipenko --- arch/sh/kernel

[PATCH v5 12/21] m68k: Switch to new sys-off handler API

2021-12-12 Thread Dmitry Osipenko
e can't convert platforms to the new API separately. There are only two platforms changed here, so it's not a big deal. Acked-by: Geert Uytterhoeven Signed-off-by: Dmitry Osipenko --- arch/m68k/emu/natfeat.c | 3 ++- arch/m68k/include/asm/machdep.h | 1 - arch/m68k/kernel/proce

[PATCH v5 11/21] powerpc: Use do_kernel_power_off()

2021-12-12 Thread Dmitry Osipenko
Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new power-off API. Acked-by: Michael Ellerman Signed-off-by: Dmitry

[PATCH v5 10/21] xen/x86: Use do_kernel_power_off()

2021-12-12 Thread Dmitry Osipenko
Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new power-off API. Acked-by: Juergen Gross Signed-off-by: Dmitry

[PATCH v5 09/21] parisc: Use do_kernel_power_off()

2021-12-12 Thread Dmitry Osipenko
: Dmitry Osipenko --- arch/parisc/kernel/process.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c index ea3d83b6fb62..928201b1f58f 100644 --- a/arch/parisc/kernel/process.c +++ b/arch/parisc/kernel/process.c @@ -26,6

[PATCH v5 08/21] arm64: Use do_kernel_power_off()

2021-12-12 Thread Dmitry Osipenko
Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new power-off API. Acked-by: Catalin Marinas Signed-off-by: Dmitry

[PATCH v5 07/21] riscv: Use do_kernel_power_off()

2021-12-12 Thread Dmitry Osipenko
Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new power-off API. Acked-by: Palmer Dabbelt Signed-off-by: Dmitry

[PATCH v5 06/21] csky: Use do_kernel_power_off()

2021-12-12 Thread Dmitry Osipenko
Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new power-off API. Acked-by: Guo Ren Signed-off-by: Dmitry Osipenko

[PATCH v5 05/21] ARM: Use do_kernel_power_off()

2021-12-12 Thread Dmitry Osipenko
: Dmitry Osipenko --- arch/arm/kernel/reboot.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/arm/kernel/reboot.c b/arch/arm/kernel/reboot.c index 3044fcb8d073..2cb943422554 100644 --- a/arch/arm/kernel/reboot.c +++ b/arch/arm/kernel/reboot.c @@ -116,9 +116,7 @@ void

[PATCH v5 04/21] kernel: Add combined power-off+restart handler call chain API

2021-12-12 Thread Dmitry Osipenko
l existing drivers want, and thus, they could be easily converted to the new API. Users of the new API should explicitly enable power-off chaining by setting corresponding flag of the power_handler structure. Signed-off-by: Dmitry Osipenko --- include/linux/reboot.h | 265 ++- ke

[PATCH v5 03/21] reboot: Print error message if restart handler has duplicated priority

2021-12-12 Thread Dmitry Osipenko
Add sanity check which ensures that there are no two restart handlers registered using the same priority. This requirement will become mandatory once all drivers will be converted to the new API and such errors will be fixed. Signed-off-by: Dmitry Osipenko --- kernel/reboot.c | 15

[PATCH v5 02/21] notifier: Add atomic/blocking_notifier_chain_register_unique_prio()

2021-12-12 Thread Dmitry Osipenko
Add variant of atomic/blocking_notifier_chain_register() functions that doesn't allow to register notifier using a duplicated priority. The -EBUSY error code is returned in this case by the new API functions. Signed-off-by: Dmitry Osipenko --- include/linux/notifier.h | 5 +++ k

[PATCH v5 01/21] notifier: Add blocking_notifier_call_chain_is_empty()

2021-12-12 Thread Dmitry Osipenko
Add blocking_notifier_call_chain_is_empty() that returns true if call chain is empty. Signed-off-by: Dmitry Osipenko --- include/linux/notifier.h | 2 ++ kernel/notifier.c| 13 + 2 files changed, 15 insertions(+) diff --git a/include/linux/notifier.h b/include/linux

[PATCH v5 00/21] Introduce power-off+restart call chain API

2021-12-12 Thread Dmitry Osipenko
g disabled by default and require drivers to explicitly opt-in to the chaining. This preserves old behaviour for existing drivers once they are converted to the new API. Dmitry Osipenko (21): notifier: Add blocking_notifier_call_chain_is_empty() notifier: Add atomic/bloc

Re: [PATCH v4 03/25] notifier: Add atomic/blocking_notifier_has_unique_priority()

2021-12-12 Thread Dmitry Osipenko
10.12.2021 22:33, Dmitry Osipenko пишет: >> Not really, they only prevent the race from occurring while >> notifier_has_unique_priority() is running. >> >> If anyone depends on this check for correctness, they need to lock the >> rwsem, do the check, do the thin

Re: [PATCH v4 05/25] reboot: Warn if restart handler has duplicated priority

2021-12-12 Thread Dmitry Osipenko
10.12.2021 22:44, Dmitry Osipenko пишет: > 10.12.2021 22:42, Dmitry Osipenko пишет: > ... >>>> There is no strong requirement for priorities to be unique, the reboot.c >>>> code will work properly. >>> >>> In which case adding the WARN() is not

Re: [PATCH v4 05/25] reboot: Warn if restart handler has duplicated priority

2021-12-12 Thread Dmitry Osipenko
10.12.2021 22:42, Dmitry Osipenko пишет: ... >>> There is no strong requirement for priorities to be unique, the reboot.c >>> code will work properly. >> >> In which case adding the WARN() is not appropriate IMV. >> >> Also I've looked at the existi

Re: [PATCH v4 05/25] reboot: Warn if restart handler has duplicated priority

2021-12-12 Thread Dmitry Osipenko
10.12.2021 22:14, Rafael J. Wysocki пишет: > On Fri, Dec 10, 2021 at 8:04 PM Dmitry Osipenko wrote: >> >> 10.12.2021 21:27, Rafael J. Wysocki пишет: >>> On Mon, Nov 29, 2021 at 12:34 PM Dmitry Osipenko wrote: >>>> >>>> 29.11.2021 03:26, Michał Mir

Re: [PATCH v4 06/25] reboot: Warn if unregister_restart_handler() fails

2021-12-12 Thread Dmitry Osipenko
10.12.2021 22:08, Rafael J. Wysocki пишет: > On Fri, Dec 10, 2021 at 7:54 PM Dmitry Osipenko wrote: >> >> 10.12.2021 21:32, Rafael J. Wysocki пишет: >>> On Fri, Nov 26, 2021 at 7:02 PM Dmitry Osipenko wrote: >>>> >>>> Emit warning if unregist

Re: [PATCH v4 03/25] notifier: Add atomic/blocking_notifier_has_unique_priority()

2021-12-12 Thread Dmitry Osipenko
10.12.2021 22:05, Rafael J. Wysocki пишет: > On Fri, Dec 10, 2021 at 7:52 PM Dmitry Osipenko wrote: >> >> 10.12.2021 21:19, Rafael J. Wysocki пишет: >> ... >>>> +bool atomic_notifier_has_unique_priority(struct atomic_notifier_head *nh, >>>

Re: [PATCH v4 05/25] reboot: Warn if restart handler has duplicated priority

2021-12-12 Thread Dmitry Osipenko
10.12.2021 21:27, Rafael J. Wysocki пишет: > On Mon, Nov 29, 2021 at 12:34 PM Dmitry Osipenko wrote: >> >> 29.11.2021 03:26, Michał Mirosław пишет: >>> On Mon, Nov 29, 2021 at 12:06:19AM +0300, Dmitry Osipenko wrote: >>>> 28.11.2021 03:28, Michał Mirosław пиш

Re: [PATCH v4 07/25] reboot: Remove extern annotation from function prototypes

2021-12-12 Thread Dmitry Osipenko
10.12.2021 21:35, Rafael J. Wysocki пишет: > On Fri, Dec 10, 2021 at 7:16 PM Dmitry Osipenko wrote: >> >> 10.12.2021 21:09, Rafael J. Wysocki пишет: >>> On Fri, Nov 26, 2021 at 7:02 PM Dmitry Osipenko wrote: >>>> >>>> There is no need to anno

Re: [PATCH v4 06/25] reboot: Warn if unregister_restart_handler() fails

2021-12-12 Thread Dmitry Osipenko
10.12.2021 21:32, Rafael J. Wysocki пишет: > On Fri, Nov 26, 2021 at 7:02 PM Dmitry Osipenko wrote: >> >> Emit warning if unregister_restart_handler() fails since it never should >> fail. This will ease further API development by catching mistakes early. >> >&g

Re: [PATCH v4 03/25] notifier: Add atomic/blocking_notifier_has_unique_priority()

2021-12-12 Thread Dmitry Osipenko
10.12.2021 21:19, Rafael J. Wysocki пишет: ... >> +bool atomic_notifier_has_unique_priority(struct atomic_notifier_head *nh, >> + struct notifier_block *n) >> +{ >> + unsigned long flags; >> + bool ret; >> + >> + spin_lock_irqsave(&nh->lock, flags); >> + ret =

Re: [PATCH v4 02/25] notifier: Add blocking_notifier_call_chain_is_empty()

2021-12-12 Thread Dmitry Osipenko
10.12.2021 21:14, Rafael J. Wysocki пишет: > On Fri, Nov 26, 2021 at 7:01 PM Dmitry Osipenko wrote: >> >> Add blocking_notifier_call_chain_is_empty() that returns true if call >> chain is empty. >> >> Signed-off-by: Dmitry Osipenko >> --- >>

Re: [PATCH v4 07/25] reboot: Remove extern annotation from function prototypes

2021-12-12 Thread Dmitry Osipenko
10.12.2021 21:09, Rafael J. Wysocki пишет: > On Fri, Nov 26, 2021 at 7:02 PM Dmitry Osipenko wrote: >> >> There is no need to annotate function prototypes with 'extern', it makes >> code less readable. Remove unnecessary annotations from . >> >> Signed

Re: [PATCH v2 28/45] mfd: rn5t618: Use devm_register_power_handler()

2021-11-29 Thread Dmitry Osipenko
29.11.2021 14:55, Lee Jones пишет: > On Thu, 28 Oct 2021, Dmitry Osipenko wrote: > >> Use devm_register_power_handler() that replaces global pm_power_off >> variable and allows to register multiple power-off handlers. It also >> provides restart-handler support, i.e. all

Re: [PATCH v4 08/25] kernel: Add combined power-off+restart handler call chain API

2021-11-29 Thread Dmitry Osipenko
29.11.2021 03:36, Michał Mirosław пишет: > On Mon, Nov 29, 2021 at 12:53:51AM +0300, Dmitry Osipenko wrote: >> 29.11.2021 00:17, Michał Mirosław пишет: >>>> I'm having trouble with parsing this comment. Could you please try to >>>> rephrase it? I don'

Re: [PATCH v4 05/25] reboot: Warn if restart handler has duplicated priority

2021-11-29 Thread Dmitry Osipenko
29.11.2021 03:26, Michał Mirosław пишет: > On Mon, Nov 29, 2021 at 12:06:19AM +0300, Dmitry Osipenko wrote: >> 28.11.2021 03:28, Michał Mirosław пишет: >>> On Fri, Nov 26, 2021 at 09:00:41PM +0300, Dmitry Osipenko wrote: >>>> Add sanity check which ensures that the

Re: [PATCH v4 08/25] kernel: Add combined power-off+restart handler call chain API

2021-11-28 Thread Dmitry Osipenko
29.11.2021 00:17, Michał Mirosław пишет: >> I'm having trouble with parsing this comment. Could you please try to >> rephrase it? I don't see how you could check whether power-off handler >> is available if you'll mix all handlers together. > If notify_call_chain() would be fixed to return NOTIFY_O

Re: [PATCH v4 18/25] x86: Use do_kernel_power_off()

2021-11-28 Thread Dmitry Osipenko
28.11.2021 04:15, Michał Mirosław пишет: > On Fri, Nov 26, 2021 at 09:00:54PM +0300, Dmitry Osipenko wrote: >> Kernel now supports chained power-off handlers. Use do_kernel_power_off() >> that invokes chained power-off handlers. It also invokes legacy >> pm_power_off() f

Re: [PATCH v4 05/25] reboot: Warn if restart handler has duplicated priority

2021-11-28 Thread Dmitry Osipenko
28.11.2021 03:28, Michał Mirosław пишет: > On Fri, Nov 26, 2021 at 09:00:41PM +0300, Dmitry Osipenko wrote: >> Add sanity check which ensures that there are no two restart handlers >> registered with the same priority. Normally it's a direct sign of a >> problem if

Re: [PATCH v4 22/25] memory: emif: Use kernel_can_power_off()

2021-11-28 Thread Dmitry Osipenko
28.11.2021 04:23, Michał Mirosław пишет: > On Fri, Nov 26, 2021 at 09:00:58PM +0300, Dmitry Osipenko wrote: >> Replace legacy pm_power_off with kernel_can_power_off() helper that >> is aware about chained power-off handlers. >> >> Signed-off-by: Dmitry Osipenko >&

Re: [PATCH v4 08/25] kernel: Add combined power-off+restart handler call chain API

2021-11-28 Thread Dmitry Osipenko
28.11.2021 03:43, Michał Mirosław пишет: > On Fri, Nov 26, 2021 at 09:00:44PM +0300, Dmitry Osipenko wrote: >> SoC platforms often have multiple ways of how to perform system's >> power-off and restart operations. Meanwhile today's kernel is limited to >> a single

[PATCH v4 25/25] reboot: Remove pm_power_off_prepare()

2021-11-26 Thread Dmitry Osipenko
All pm_power_off_prepare() users were converted to sys-off handler API. Remove the obsolete callback. Signed-off-by: Dmitry Osipenko --- include/linux/pm.h | 1 - kernel/reboot.c| 11 --- 2 files changed, 12 deletions(-) diff --git a/include/linux/pm.h b/include/linux/pm.h index

[PATCH v4 24/25] regulator: pfuze100: Use devm_register_sys_off_handler()

2021-11-26 Thread Dmitry Osipenko
Use devm_register_sys_off_handler() that replaces global pm_power_off_prepare variable and allows to register multiple power-off handlers. Acked-by: Mark Brown Signed-off-by: Dmitry Osipenko --- drivers/regulator/pfuze100-regulator.c | 38 ++ 1 file changed, 14

[PATCH v4 23/25] ACPI: power: Switch to sys-off handler API

2021-11-26 Thread Dmitry Osipenko
Switch to sys-off API that replaces legacy pm_power_off callbacks. Signed-off-by: Dmitry Osipenko --- drivers/acpi/sleep.c | 25 +++-- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index eaa47753b758..2e613fddd614

[PATCH v4 22/25] memory: emif: Use kernel_can_power_off()

2021-11-26 Thread Dmitry Osipenko
Replace legacy pm_power_off with kernel_can_power_off() helper that is aware about chained power-off handlers. Signed-off-by: Dmitry Osipenko --- drivers/memory/emif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/memory/emif.c b/drivers/memory/emif.c index

[PATCH v4 21/25] nds32: Use do_kernel_power_off()

2021-11-26 Thread Dmitry Osipenko
Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new power-off API. Signed-off-by: Dmitry Osipenko --- arch/nds32

[PATCH v4 20/25] mips: Use do_kernel_power_off()

2021-11-26 Thread Dmitry Osipenko
Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new power-off API. Signed-off-by: Dmitry Osipenko --- arch/mips

[PATCH v4 19/25] ia64: Use do_kernel_power_off()

2021-11-26 Thread Dmitry Osipenko
Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new power-off API. Signed-off-by: Dmitry Osipenko --- arch/ia64

[PATCH v4 18/25] x86: Use do_kernel_power_off()

2021-11-26 Thread Dmitry Osipenko
Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new power-off API. Signed-off-by: Dmitry Osipenko --- arch/x86/kernel

[PATCH v4 17/25] sh: Use do_kernel_power_off()

2021-11-26 Thread Dmitry Osipenko
Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new power-off API. Signed-off-by: Dmitry Osipenko --- arch/sh/kernel

[PATCH v4 16/25] m68k: Switch to new sys-off handler API

2021-11-26 Thread Dmitry Osipenko
e can't convert platforms to the new API separately. There are only two platforms changed here, so it's not a big deal. Acked-by: Geert Uytterhoeven Signed-off-by: Dmitry Osipenko --- arch/m68k/emu/natfeat.c | 3 ++- arch/m68k/include/asm/machdep.h | 1 - arch/m68k/kernel/proce

[PATCH v4 15/25] powerpc: Use do_kernel_power_off()

2021-11-26 Thread Dmitry Osipenko
Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new power-off API. Acked-by: Michael Ellerman Signed-off-by: Dmitry

[PATCH v4 14/25] xen/x86: Use do_kernel_power_off()

2021-11-26 Thread Dmitry Osipenko
Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new power-off API. Acked-by: Juergen Gross Signed-off-by: Dmitry

[PATCH v4 13/25] parisc: Use do_kernel_power_off()

2021-11-26 Thread Dmitry Osipenko
: Dmitry Osipenko --- arch/parisc/kernel/process.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c index ea3d83b6fb62..928201b1f58f 100644 --- a/arch/parisc/kernel/process.c +++ b/arch/parisc/kernel/process.c @@ -26,6

[PATCH v4 12/25] arm64: Use do_kernel_power_off()

2021-11-26 Thread Dmitry Osipenko
Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new power-off API. Acked-by: Catalin Marinas Signed-off-by: Dmitry

[PATCH v4 11/25] riscv: Use do_kernel_power_off()

2021-11-26 Thread Dmitry Osipenko
Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new power-off API. Acked-by: Palmer Dabbelt Signed-off-by: Dmitry

[PATCH v4 10/25] csky: Use do_kernel_power_off()

2021-11-26 Thread Dmitry Osipenko
Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new power-off API. Acked-by: Guo Ren Signed-off-by: Dmitry Osipenko

[PATCH v4 09/25] ARM: Use do_kernel_power_off()

2021-11-26 Thread Dmitry Osipenko
: Dmitry Osipenko --- arch/arm/kernel/reboot.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/arm/kernel/reboot.c b/arch/arm/kernel/reboot.c index 3044fcb8d073..2cb943422554 100644 --- a/arch/arm/kernel/reboot.c +++ b/arch/arm/kernel/reboot.c @@ -116,9 +116,7 @@ void

[PATCH v4 08/25] kernel: Add combined power-off+restart handler call chain API

2021-11-26 Thread Dmitry Osipenko
l existing drivers want, and thus, they could be easily converted to the new API. Users of the new API should explicitly enable power-off chaining by setting corresponding flag of the power_handler structure. Signed-off-by: Dmitry Osipenko --- include/linux/reboot.h | 265 ++- ke

[PATCH v4 07/25] reboot: Remove extern annotation from function prototypes

2021-11-26 Thread Dmitry Osipenko
There is no need to annotate function prototypes with 'extern', it makes code less readable. Remove unnecessary annotations from . Signed-off-by: Dmitry Osipenko --- include/linux/reboot.h | 38 +++--- 1 file changed, 19 insertions(+), 19 deletions(-)

[PATCH v4 06/25] reboot: Warn if unregister_restart_handler() fails

2021-11-26 Thread Dmitry Osipenko
Emit warning if unregister_restart_handler() fails since it never should fail. This will ease further API development by catching mistakes early. Signed-off-by: Dmitry Osipenko --- kernel/reboot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/reboot.c b/kernel

[PATCH v4 05/25] reboot: Warn if restart handler has duplicated priority

2021-11-26 Thread Dmitry Osipenko
Add sanity check which ensures that there are no two restart handlers registered with the same priority. Normally it's a direct sign of a problem if two handlers use the same priority. Signed-off-by: Dmitry Osipenko --- kernel/reboot.c | 15 ++- 1 file changed, 14 insertions(

[PATCH v4 04/25] reboot: Correct typo in a comment

2021-11-26 Thread Dmitry Osipenko
Correct s/implemenations/implementations/ in . Signed-off-by: Dmitry Osipenko --- include/linux/reboot.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/reboot.h b/include/linux/reboot.h index af907a3d68d1..7c288013a3ca 100644 --- a/include/linux/reboot.h +++ b

[PATCH v4 03/25] notifier: Add atomic/blocking_notifier_has_unique_priority()

2021-11-26 Thread Dmitry Osipenko
Add atomic/blocking_notifier_has_unique_priority() helpers which return true if given handler has unique priority. Signed-off-by: Dmitry Osipenko --- include/linux/notifier.h | 5 +++ kernel/notifier.c| 69 2 files changed, 74 insertions

[PATCH v4 02/25] notifier: Add blocking_notifier_call_chain_is_empty()

2021-11-26 Thread Dmitry Osipenko
Add blocking_notifier_call_chain_is_empty() that returns true if call chain is empty. Signed-off-by: Dmitry Osipenko --- include/linux/notifier.h | 2 ++ kernel/notifier.c| 14 ++ 2 files changed, 16 insertions(+) diff --git a/include/linux/notifier.h b/include/linux

[PATCH v4 01/25] notifier: Remove extern annotation from function prototypes

2021-11-26 Thread Dmitry Osipenko
There is no need to annotate function prototypes with 'extern', it makes code less readable. Remove unnecessary annotations from . Signed-off-by: Dmitry Osipenko --- include/linux/notifier.h | 30 +++--- 1 file changed, 15 insertions(+), 15 deletions(-) di

[PATCH v4 00/25] Introduce power-off+restart call chain API

2021-11-26 Thread Dmitry Osipenko
ere. - v2 API doesn't expose notifier to users and require handlers to have unique priority. Suggested by Guenter Roeck. - v2 API has power-off chaining disabled by default and require drivers to explicitly opt-in to the chaining. This preserves old behaviour for existing d

Re: [PATCH v2 27/45] mfd: ntxec: Use devm_register_power_handler()

2021-11-10 Thread Dmitry Osipenko
10.11.2021 13:43, Jonathan Neuschäfer пишет: > On Mon, Nov 08, 2021 at 02:36:42PM +0300, Dmitry Osipenko wrote: >> 08.11.2021 14:22, Jonathan Neuschäfer пишет: >>> On Sun, Nov 07, 2021 at 08:42:33PM +0300, Dmitry Osipenko wrote: >>> [...] >>>> EC drivers

Re: [PATCH v2 27/45] mfd: ntxec: Use devm_register_power_handler()

2021-11-08 Thread Dmitry Osipenko
08.11.2021 14:22, Jonathan Neuschäfer пишет: > On Sun, Nov 07, 2021 at 08:42:33PM +0300, Dmitry Osipenko wrote: > [...] >> EC drivers tend to use higher priority in general. Jonathan, could you >> please confirm that NTXEC driver is a more preferable restart method >> tha

Re: [PATCH v3 00/25] Introduce power-off+restart call chain API

2021-11-07 Thread Dmitry Osipenko
08.11.2021 03:44, Dmitry Osipenko пишет: > Problem > --- > > SoC devices require power-off call chaining functionality from kernel. > We have a widely used restart chaining provided by restart notifier API, > but nothing for power-off. > > Solution >

[PATCH v3 25/25] reboot: Remove pm_power_off_prepare()

2021-11-07 Thread Dmitry Osipenko
All pm_power_off_prepare() users were converted to sys-off handler API. Remove the obsolete callback. Signed-off-by: Dmitry Osipenko --- include/linux/pm.h | 1 - kernel/reboot.c| 11 --- 2 files changed, 12 deletions(-) diff --git a/include/linux/pm.h b/include/linux/pm.h index

[PATCH v3 24/25] regulator: pfuze100: Use devm_register_sys_off_handler()

2021-11-07 Thread Dmitry Osipenko
Use devm_register_sys_off_handler() that replaces global pm_power_off_prepare variable and allows to register multiple power-off handlers. Acked-by: Mark Brown Signed-off-by: Dmitry Osipenko --- drivers/regulator/pfuze100-regulator.c | 38 ++ 1 file changed, 14

[PATCH v3 23/25] ACPI: power: Switch to sys-off handler API

2021-11-07 Thread Dmitry Osipenko
Switch to sys-off API that replaces legacy pm_power_off callbacks. Signed-off-by: Dmitry Osipenko --- drivers/acpi/sleep.c | 25 +++-- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index eaa47753b758..2e613fddd614

[PATCH v3 22/25] memory: emif: Use kernel_can_power_off()

2021-11-07 Thread Dmitry Osipenko
Replace legacy pm_power_off with kernel_can_power_off() helper that is aware about chained power-off handlers. Signed-off-by: Dmitry Osipenko --- drivers/memory/emif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/memory/emif.c b/drivers/memory/emif.c index

[PATCH v3 21/25] m68k: Switch to new sys-off handler API

2021-11-07 Thread Dmitry Osipenko
e can't convert platforms to the new API separately. There are only two platforms changed here, so it's not a big deal. Signed-off-by: Dmitry Osipenko --- arch/m68k/emu/natfeat.c | 3 ++- arch/m68k/include/asm/machdep.h | 1 - arch/m68k/kernel/process.c | 5 ++--- ar

[PATCH v3 20/25] powerpc: Use do_kernel_power_off()

2021-11-07 Thread Dmitry Osipenko
Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new power-off API. Signed-off-by: Dmitry Osipenko --- arch/powerpc

[PATCH v3 19/25] nds32: Use do_kernel_power_off()

2021-11-07 Thread Dmitry Osipenko
Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new power-off API. Signed-off-by: Dmitry Osipenko --- arch/nds32

[PATCH v3 18/25] mips: Use do_kernel_power_off()

2021-11-07 Thread Dmitry Osipenko
Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new power-off API. Signed-off-by: Dmitry Osipenko --- arch/mips

[PATCH v3 17/25] ia64: Use do_kernel_power_off()

2021-11-07 Thread Dmitry Osipenko
Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new power-off API. Signed-off-by: Dmitry Osipenko --- arch/ia64

[PATCH v3 16/25] x86: Use do_kernel_power_off()

2021-11-07 Thread Dmitry Osipenko
Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new power-off API. Signed-off-by: Dmitry Osipenko --- arch/x86/kernel

[PATCH v3 15/25] sh: Use do_kernel_power_off()

2021-11-07 Thread Dmitry Osipenko
Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new power-off API. Signed-off-by: Dmitry Osipenko --- arch/sh/kernel

[PATCH v3 14/25] xen/x86: Use do_kernel_power_off()

2021-11-07 Thread Dmitry Osipenko
Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new power-off API. Acked-by: Juergen Gross Signed-off-by: Dmitry

[PATCH v3 13/25] parisc: Use do_kernel_power_off()

2021-11-07 Thread Dmitry Osipenko
: Dmitry Osipenko --- arch/parisc/kernel/process.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c index ea3d83b6fb62..928201b1f58f 100644 --- a/arch/parisc/kernel/process.c +++ b/arch/parisc/kernel/process.c @@ -26,6

[PATCH v3 12/25] arm64: Use do_kernel_power_off()

2021-11-07 Thread Dmitry Osipenko
Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new power-off API. Acked-by: Catalin Marinas Signed-off-by: Dmitry

[PATCH v3 11/25] riscv: Use do_kernel_power_off()

2021-11-07 Thread Dmitry Osipenko
Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new power-off API. Acked-by: Palmer Dabbelt Signed-off-by: Dmitry

[PATCH v3 10/25] csky: Use do_kernel_power_off()

2021-11-07 Thread Dmitry Osipenko
Kernel now supports chained power-off handlers. Use do_kernel_power_off() that invokes chained power-off handlers. It also invokes legacy pm_power_off() for now, which will be removed once all drivers will be converted to the new power-off API. Acked-by: Guo Ren Signed-off-by: Dmitry Osipenko

[PATCH v3 09/25] ARM: Use do_kernel_power_off()

2021-11-07 Thread Dmitry Osipenko
: Dmitry Osipenko --- arch/arm/kernel/reboot.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/arm/kernel/reboot.c b/arch/arm/kernel/reboot.c index 3044fcb8d073..2cb943422554 100644 --- a/arch/arm/kernel/reboot.c +++ b/arch/arm/kernel/reboot.c @@ -116,9 +116,7 @@ void

[PATCH v3 08/25] kernel: Add combined power-off+restart handler call chain API

2021-11-07 Thread Dmitry Osipenko
l existing drivers want, and thus, they could be easily converted to the new API. Users of the new API should explicitly enable power-off chaining by setting corresponding flag of the power_handler structure. Signed-off-by: Dmitry Osipenko --- include/linux/reboot.h | 265 ++- ke

[PATCH v3 07/25] reboot: Remove extern annotation from function prototypes

2021-11-07 Thread Dmitry Osipenko
There is no need to annotate function prototypes with 'extern', it makes code less readable. Remove unnecessary annotations from . Signed-off-by: Dmitry Osipenko --- include/linux/reboot.h | 38 +++--- 1 file changed, 19 insertions(+), 19 deletions(-)

[PATCH v3 06/25] reboot: Warn if unregister_restart_handler() fails

2021-11-07 Thread Dmitry Osipenko
Emit warning if unregister_restart_handler() fails since it never should fail. This will ease further API development by catching mistakes early. Signed-off-by: Dmitry Osipenko --- kernel/reboot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/reboot.c b/kernel

[PATCH v3 05/25] reboot: Warn if restart handler has duplicated priority

2021-11-07 Thread Dmitry Osipenko
Add sanity check which ensures that there are no two restart handlers registered with the same priority. Normally it's a direct sign of a problem if two handlers use the same priority. Signed-off-by: Dmitry Osipenko --- kernel/reboot.c | 15 ++- 1 file changed, 14 insertions(

[PATCH v3 04/25] reboot: Correct typo in a comment

2021-11-07 Thread Dmitry Osipenko
Correct s/implemenations/implementations/ in . Signed-off-by: Dmitry Osipenko --- include/linux/reboot.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/reboot.h b/include/linux/reboot.h index af907a3d68d1..7c288013a3ca 100644 --- a/include/linux/reboot.h +++ b

[PATCH v3 03/25] notifier: Add atomic/blocking_notifier_has_unique_priority()

2021-11-07 Thread Dmitry Osipenko
Add atomic/blocking_notifier_has_unique_priority() helpers which return true if given handler has unique priority. Signed-off-by: Dmitry Osipenko --- include/linux/notifier.h | 5 +++ kernel/notifier.c| 69 2 files changed, 74 insertions

  1   2   >