spmi: msm: correctly handle multiple mapping entries
authorNeil Armstrong <neil.armstrong@linaro.org>
Fri, 28 Mar 2025 08:53:24 +0000 (09:53 +0100)
committerCaleb Connolly <caleb.connolly@linaro.org>
Thu, 10 Apr 2025 13:43:10 +0000 (15:43 +0200)
commit5b233442afacde1aca2556c543b1cd8e22946690
treef6bdb88c5ee89ee7d819a725800137f688832877
parent69400a696cb823075990048eac5c4ed857229daf
spmi: msm: correctly handle multiple mapping entries

On v5 & v7 controllers, multiple mapping for different
Execution Environment exists, if the mapping owner is for
a different Execution Environment we can only read and
not write any data.

To allow us to find a Write mapping for our Execution
Environment, we can overwritte a mapping if we encounter
a new one which we own.

Implement this logic, the result is the same mapping
table as in Linux.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Tested-by: caleb.connolly@linaro.org # sdm845
Link: https://lore.kernel.org/r/20250328-topic-sm8x50-spmi-fix-v1-4-a7548d3aef0d@linaro.org
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
drivers/spmi/spmi-msm.c