summaryrefslogtreecommitdiff
path: root/tools/lib/python
diff options
context:
space:
mode:
authorAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>2026-07-01 14:19:08 +0200
committerStephen Boyd <sboyd@kernel.org>2026-10-14 20:02:46 -0700
commit84c72fc05f73df3473b3bfac89c0a7eae765513a (patch)
tree6cc03440de5a5bad81a66c7fd42388e3f08cade1 /tools/lib/python
parent36bb69cf0fdddbd40961818409849aad17ea01eb (diff)
spmi: mtk-pmif: Add workaround for FSM lockup/error in read operation
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@collabora.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions