linux/drivers/spmi
AngeloGioacchino Del Regno 63cbabb003 spmi: mtk-pmif: Keep spinlock until read is fully done
Move the spin unlocking to after reading the contents of the
PMIF_SWINF_(x)_RDATA_31_0 register in pmif_spmi_read_cmd():
since this is the only register that we can read to get the
data from all of the arbitered busses, a concurrent request
for reading (especially on a busy arbiter) will show a race
condition and a unexpected or corrupted value may be read.

Doing the entire read sequence while spin locked guarantees
that concurrent access to the arbiter doesn't happen.

Fixes: f200fff8d0 ("spmi: mtk-pmif: Serialize PMIF status check and command submission")
Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Fixes: b45b3ccef8 ("spmi: mediatek: Add support for MT6873/8192")
Link: https://patch.msgid.link/20260123182039.224314-4-sboyd@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-01-23 19:24:38 +01:00
..
hisi-spmi-controller.c spmi: hisi-spmi-controller: Drop duplicated OF node assignment in spmi_controller_probe() 2025-01-17 12:58:49 +01:00
Kconfig spmi: add a spmi driver for Apple SoC 2025-05-21 14:53:17 +02:00
Makefile spmi: add a spmi driver for Apple SoC 2025-05-21 14:53:17 +02:00
spmi-apple-controller.c spmi: add a spmi driver for Apple SoC 2025-05-21 14:53:17 +02:00
spmi-devres.c spmi: Return meaningful errors in spmi_controller_alloc() 2023-12-15 17:27:04 +01:00
spmi-mtk-pmif.c spmi: mtk-pmif: Keep spinlock until read is fully done 2026-01-23 19:24:38 +01:00
spmi-pmic-arb.c irqdomain: spmi: Switch to irq_domain_create_tree() 2025-05-21 14:53:17 +02:00
spmi.c spmi: Set fwnode for spmi devices 2025-01-17 12:58:49 +01:00