Re: [PATCH v24 06/12] power: reset: Add psci-reboot-mode driver
Shivendra Pratap <[email protected]> Mon, 3 Aug 2026 18:37:11 +0530
| Newsgroups | dev.linux.lists.sashiko-reviews,dev.linux.lists.mfd,org.kernel.vger.linux-devicetree |
|---|---|
| Message-ID | <[email protected]> |
On 8/3/2026 3:41 PM, [email protected] wrote: > Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: > - [High] The `psci-reboot-mode` driver is completely unreachable and non-functional because it is never instantiated. > - [High] Standard 'normal' reboot mode commands are entirely ignored by PSCI due to an incorrect `data` check in the restart handler. > -- [snip..] >> +static int psci_reboot_mode_write(struct reboot_mode_driver *reboot, >> + const u32 *magic, u32 count) >> +{ >> + (void)reboot; >> + >> + if (count < 1 || count > 3) >> + return -EINVAL; >> + >> + return psci_set_reset_cmd(magic[0], psci_reboot_mode_get_cookie(magic, count)); > > [Severity: High] > Does this work for standard "normal" reboots? > > When a standard reboot is triggered without a specific command string, the > reboot_mode framework translates the NULL command to "normal" mode and calls > this write function to configure the reset command. No, write can be called only if a mode entry is found that matches name "normal". And there is no mode name defined here as "normal". > > However, in drivers/firmware/psci/psci.c, psci_sys_reset() skips applying > the command because it checks for a non-NULL data argument: > drivers/firmware/psci/psci.c:psci_sys_reset() { > ... > cmd = smp_load_acquire(&reset_cmd); > if (data && cmd && !panic_in_progress()) > psci_handle_reset_cmd(cmd); > > psci_handle_reboot_mode(); > ... > } > > Will this cause standard reboots mapped to vendor-specific commands to be > silently ignored? does not affects. > >> +} > [ ... ] >> +static struct platform_driver psci_reboot_mode_driver = { >> + .probe = psci_reboot_mode_probe, >> + .driver = { >> + .name = "psci-reboot-mode", >> + }, >> +}; > > [Severity: High] > Is this driver ever instantiated? > this is probed as psci-mfd child. thanks, Shivendra