Re: [PATCH v6 02/40] arm_mpam: Reset when feature configuration bit unset

From: James Morse

Date: Fri Mar 27 2026 - 12:28:00 EST


Hi Ben,

On 13/03/2026 14:45, Ben Horgan wrote:
> To indicate that the configuration, of the controls used by resctrl, in a
> RIS need resetting to driver defaults the reset flags in mpam_config are
> set. However, these flags are only ever set temporarily at RIS scope in
> mpam_reset_ris() and hence mpam_cpu_online() will never reset these
> controls to default. As the hardware reset is unknown this leads to unknown
> configuration when the control values haven't been configured away from the
> defaults.
>
> Use the policy that an unset feature configuration bit means reset. In this
> way the mpam_config in the component can encode that it should be in reset
> state and mpam_reprogram_msc() will reset controls as needed.


> diff --git a/drivers/resctrl/mpam_devices.c b/drivers/resctrl/mpam_devices.c
> index 0fd6590a9b5c..ff861291bd4e 100644
> --- a/drivers/resctrl/mpam_devices.c
> +++ b/drivers/resctrl/mpam_devices.c
> @@ -1364,17 +1364,15 @@ static void mpam_reprogram_ris_partid(struct mpam_msc_ris *ris, u16 partid,
> __mpam_intpart_sel(ris->ris_idx, partid, msc);
> }
>
> - if (mpam_has_feature(mpam_feat_cpor_part, rprops) &&
> - mpam_has_feature(mpam_feat_cpor_part, cfg)) {
> - if (cfg->reset_cpbm)

After this, nothing reads/writes these explicit reset flags so they can be removed from
struct mpam_config.

(I'll do this locally)


> - mpam_reset_msc_bitmap(msc, MPAMCFG_CPBM, rprops->cpbm_wd);
> - else
> + if (mpam_has_feature(mpam_feat_cpor_part, rprops)) {
> + if (mpam_has_feature(mpam_feat_cpor_part, cfg))
> mpam_write_partsel_reg(msc, CPBM, cfg->cpbm);
> + else
> + mpam_reset_msc_bitmap(msc, MPAMCFG_CPBM, rprops->cpbm_wd);
> }
>
> - if (mpam_has_feature(mpam_feat_mbw_part, rprops) &&
> - mpam_has_feature(mpam_feat_mbw_part, cfg)) {
> - if (cfg->reset_mbw_pbm)
> + if (mpam_has_feature(mpam_feat_mbw_part, rprops)) {
> + if (mpam_has_feature(mpam_feat_mbw_part, cfg))
> mpam_reset_msc_bitmap(msc, MPAMCFG_MBW_PBM, rprops->mbw_pbm_bits);
> else
> mpam_write_partsel_reg(msc, MBW_PBM, cfg->mbw_pbm);

Reviewed-by: James Morse <james.morse@xxxxxxx>


Thanks!

James