[PATCH] spmi: mtk-pmif: Add workaround for FSM lockup/error in read operation
Stephen Boyd
sboyd at kernel.org
Wed Oct 14 20:02:54 PDT 2026
Quoting AngeloGioacchino Del Regno (2026-07-01 05:19:08)
> The SPMI PMIF in some SoCs like MT8196 is affected by a hardware
> issue that makes the first read operation on each SID to fail as
> the FSM locks up after sending the read command, and this happens
> at least in the following conditions:
> - At boot, after bootloader handoff; and
> - At every suspend->resume cycle.
>
> This critical bug may produce unwanted issues in regulator drivers
> which may fail to set voltages, making the platform to end up in a
> undervoltage or, a bit more critically, an overvoltage condition,
> producing instability or ... worse.
>
> In order to work around this issue, add a retry mechanism into the
> pmif_spmi_read_cmd() callback which will resend the read command
> up to 3 times in the following conditions:
> - Software Interface returns an error; or
> - Software Interface never gets in WFVLDCLR state.
>
> As to avoid uselessly blocking for too much time, only during the
> read-retry loop, the maximum SWINF polling time for each trial is
> reduced to PMIF_TIMEOUT_US / 2: this was tested on multiple SoCs
> and seems to always be enough, as when any read succeeds it will
> always take less than 40ms.
> In any case, this is still allowing 1.5 times the previous maximum
> polling time, reaching a total maximum (for 3 retries) of 150ms.
>
> Worst case testing that I performed saw a third retry only 3 times
> out of ~100 reboots.
>
> Fixes: 1f5be2d7f743 ("spmi: mtk-pmif: Add support for MT8196 SPMI Controller")
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com>
> ---
Applied to spmi-next
More information about the linux-arm-kernel
mailing list