[PATCH v1] spmi: msm: Fix V5 ownership table offset

Casey Connolly casey.connolly at linaro.org
Tue Jun 30 18:35:14 CEST 2026



On 6/18/26 18:27, Aswin Murugan wrote:
> The driver reads ownership registers from the wrong address for V5.
> The ownership table is at offset 0x700 from spmi_cnfg base, not 0x0.
> This causes incorrect peripheral ownership detection and potential
> access violations.
> 
> Add the missing 0x700 offset to match the kernel driver [1]
> 
> [1] https://github.com/torvalds/linux/blob/4b99990cdf9560e8a071640baf19f312e6ae02f4/drivers/spmi/spmi-pmic-arb.c#L1737
> 
> Signed-off-by: Aswin Murugan <aswin.murugan at oss.qualcomm.com>

Reviewed-by: Casey Connolly <casey.connolly at linaro.org>

> ---
>   drivers/spmi/spmi-msm.c | 20 +++++++++++++++-----
>   1 file changed, 15 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/spmi/spmi-msm.c b/drivers/spmi/spmi-msm.c
> index b89dd0b406b..a665850cd65 100644
> --- a/drivers/spmi/spmi-msm.c
> +++ b/drivers/spmi/spmi-msm.c
> @@ -260,11 +260,21 @@ static struct dm_spmi_ops msm_spmi_ops = {
>   static void msm_spmi_channel_map_v5(struct msm_spmi_priv *priv, unsigned int i,
>   				    uint8_t slave_id, uint8_t pid)
>   {
> -	/* Mark channels read-only when from different owner */
> -	uint32_t cnfg = readl(priv->spmi_cnfg + ARB_CHANNEL_OFFSET(i));
> -	uint8_t owner = SPMI_OWNERSHIP_PERIPH2OWNER(cnfg);
> -	bool prev_valid = priv->channel_map[slave_id][pid] & SPMI_CHANNEL_VALID;
> -	uint32_t prev_read_only = priv->channel_map[slave_id][pid] & SPMI_CHANNEL_READ_ONLY;
> +	phys_addr_t owner_addr;
> +	uint32_t cnfg;
> +	uint8_t owner;
> +	bool prev_valid;
> +	uint32_t prev_read_only;
> +
> +	if (priv->arb_ver == V5)
> +		owner_addr = priv->spmi_cnfg + 0x700 + ARB_CHANNEL_OFFSET(i);
> +	else /* V7 */
> +		owner_addr = priv->spmi_cnfg + ARB_CHANNEL_OFFSET(i);
> +
> +	cnfg = readl(owner_addr);
> +	owner = SPMI_OWNERSHIP_PERIPH2OWNER(cnfg);
> +	prev_valid = priv->channel_map[slave_id][pid] & SPMI_CHANNEL_VALID;
> +	prev_read_only = priv->channel_map[slave_id][pid] & SPMI_CHANNEL_READ_ONLY;
>   
>   	if (!prev_valid) {
>   		/* First PPID mapping */



More information about the U-Boot mailing list