From: sashiko-bot@kernel.org
To: "Diogo Ivo" <diogo.ivo@tecnico.ulisboa.pt>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org,
krzk+dt@kernel.org
Subject: Re: [PATCH 1/4] firmware: psci: switch SYSTEM_OFF to sys-off handler API
Date: Thu, 14 May 2026 19:48:16 +0000 [thread overview]
Message-ID: <20260514194816.EEFF1C2BCB3@smtp.kernel.org> (raw)
In-Reply-To: <20260514-smaug-poweroff-v1-1-30f9a4688966@tecnico.ulisboa.pt>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Premature memory allocation during early boot causing kernel panic
--
commit ef783d7ffab1683b74c28865d23fcb00064437a6
Author: Diogo Ivo <diogo.ivo@tecnico.ulisboa.pt>
firmware: psci: switch SYSTEM_OFF to sys-off handler API
This commit replaces the legacy pm_power_off hook with the generic sys-off
handler infrastructure. It converts psci_sys_poweroff to the sys-off callback
prototype and registers it through register_sys_off_handler.
> diff --git a/drivers/firmware/psci/psci.c b/drivers/firmware/psci/psci.c
> index 38ca190d4a22d..d6e9721d11e54 100644
> --- a/drivers/firmware/psci/psci.c
> +++ b/drivers/firmware/psci/psci.c
[ ... ]
> @@ -671,7 +672,8 @@ static void __init psci_0_2_set_functions(void)
>
> register_restart_handler(&psci_sys_reset_nb);
>
> - pm_power_off = psci_sys_poweroff;
> + register_sys_off_handler(SYS_OFF_MODE_POWER_OFF, SYS_OFF_PRIO_FIRMWARE,
> + psci_sys_poweroff, NULL);
> }
Can this cause a regression during early boot?
The function psci_0_2_set_functions() is called extremely early via
psci_dt_init() or psci_acpi_init() from setup_arch(). This happens before
mm_core_init() brings up the slab memory allocator.
Because the priority passed is SYS_OFF_PRIO_FIRMWARE, alloc_sys_off_handler()
falls back to dynamically allocating the handler using kzalloc().
Could calling kzalloc() before the slab allocator is initialized result in a
kernel panic?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260514-smaug-poweroff-v1-0-30f9a4688966@tecnico.ulisboa.pt?part=1
next prev parent reply other threads:[~2026-05-14 19:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-14 14:47 [PATCH 0/4] power: sys-off: fix Pixel C shutdown via MAX77620 Diogo Ivo
2026-05-14 14:47 ` [PATCH 1/4] firmware: psci: switch SYSTEM_OFF to sys-off handler API Diogo Ivo
2026-05-14 19:48 ` sashiko-bot [this message]
2026-05-14 14:47 ` [PATCH 2/4] mfd: max77620: convert poweroff support to sys-off API Diogo Ivo
2026-05-14 20:05 ` sashiko-bot
2026-05-14 14:47 ` [PATCH 3/4] mfd: max77620: override PSCI poweroff handler on Pixel C Diogo Ivo
2026-05-14 14:47 ` [PATCH 4/4] arm64: tegra: smaug: mark MAX77620 as system power controller Diogo Ivo
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=20260514194816.EEFF1C2BCB3@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=diogo.ivo@tecnico.ulisboa.pt \
--cc=krzk+dt@kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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.