Re: [PATCH v7 05/11] arm_mpam: propagate MSC access errors for __ris_msmon_read()

Jonathan Cameron <[email protected]> Mon, 3 Aug 2026 15:13:42 -0700
Newsgroups gmane.linux.kernel,gmane.linux.acpi.devel,gmane.linux.ports.arm.kernel
Organization Qualcomm
Message-ID <[email protected]>
On Fri, 31 Jul 2026 19:03:18 +0200
Andre Przywara <[email protected]> wrote:

> Allow the function for RIS accesses to return an error, and propagate
> read and write errors from the lower level up.
> This function is a bit special, since it can be called via an SMP
> helper, so the prototype must stay as void. So propagate any errors
> using the "err" field in the struct passed in as the sole argument to
> that function.
> 
> Signed-off-by: Andre Przywara <[email protected]>
> Reviewed-by: Jonathan Cameron <[email protected]>

Just taking a fresh look and one really trivial formatting thing
popped out.

> ---
>  drivers/resctrl/mpam_devices.c | 36 +++++++++++++++++++++++++---------
>  1 file changed, 27 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/resctrl/mpam_devices.c b/drivers/resctrl/mpam_devices.c
> index 9d9f0c635527..fa8ed20a6740 100644
> --- a/drivers/resctrl/mpam_devices.c
> +++ b/drivers/resctrl/mpam_devices.c

> @@ -1390,18 +1398,24 @@ static void __ris_msmon_read(void *arg)
>  			  cur_ctl != (ctl_val | MSMON_CFG_x_CTL_EN);
>  
>  	if (config_mismatch || reset_on_next_read) {
> -		write_msmon_ctl_flt_vals(m, ctl_val, flt_val);
> +		m->err = write_msmon_ctl_flt_vals(m, ctl_val, flt_val);
> +		if (m->err)
> +			return;
>  		overflow = false;
>  	} else if (overflow) {
> -		mpam_write_monsel_reg(msc, CFG_MBWU_CTL,
> -				      cur_ctl &
> -				      ~(MSMON_CFG_x_CTL_OFLOW_STATUS |
> -					MSMON_CFG_MBWU_CTL_OFLOW_STATUS_L));
> +		m->err = mpam_write_monsel_reg(msc, CFG_MBWU_CTL,
> +					    cur_ctl &
> +					    ~(MSMON_CFG_x_CTL_OFLOW_STATUS |
> +					    MSMON_CFG_MBWU_CTL_OFLOW_STATUS_L))

Indent seems to be wrong here.

		m->err = mpam_write_monsel_reg(msc, CFG_MBWU_CTL,
					       cur_ctl &
					       ~(MSMON_CFG_x_CTL_OFLOW_STATUS |
					         MSMON_CFG_MBWU_CTL_OFLOW_STATUS_L));

> +		if (m->err)
> +			return;
>  	}