Re: [RFC PATCH] mfd: rk8xx-core: Leave a warm restart to the next handler
From: Nguyen Cong Thanh
Date: Thu Dec 03 2026 - 21:48:54 EST
On Thu, 03 Dec 2026 18:35:35 +0000, sashiko-bot@xxxxxxxxxx wrote:
> Does skipping DEV_RST leave RK817_SLPPIN_FUNC_MSK armed with
> SLPPIN_DN_FUN across a normal warm reboot?
Yes, I think it does. kernel_restart() runs device_shutdown() before
the restart handlers, rk8xx_shutdown() sets SLPPIN_DN_FUN in
RK817_SYS_CFG(3) on RK809/RK817 whatever system_state is, and with
DEV_RST skipped nothing clears it: rk817_pre_init_reg[] does not touch
it, and only rk8xx_resume() writes SLPPIN_NULL_FUN.
My tests did not cover this. The warm restarts I ran were all
reboot=panic_warm after a panic, which goes through emergency_restart()
and does not call device_shutdown(). A plain reboot with reboot=warm,
which does run rk8xx_shutdown(), was not tested.
For v2 I would add a patch before this one, so that rk8xx_shutdown()
sets the power-down function only when system_state is
SYSTEM_POWER_OFF and a restart leaves the sleep pin function as it
was. Lee, Peter, would you rather have that, or the sleep pin function
cleared at probe in rk817_pre_init_reg[], or both? Before v2 I will
also run plain warm reboots on the board and read RK817_SYS_CFG(3)
after them.
> Should it include:
>
> Fixes: 56f216d8efbc ("mfd: rk808: Add reboot support to rk808.c")
I left it out on purpose: the handler has restarted the PMIC in every
mode since that commit, so this is a change of behaviour rather than
a fix of a regression. I can add the tag if Lee prefers.
Thanks,
Nguyen Cong Thanh