Re: [PATCH v1 03/11] arm_mpam: Set mpam_feat_msmon_mbwu_31counter when there are bandwidth counters

From: Ben Horgan

Date: Wed Jul 15 2026 - 05:22:10 EST


Hi Shaopeng,

On 7/15/26 07:34, Shaopeng Tan (Fujitsu) wrote:
> Hello Ben,
>
>> If there are memory bandwidth counters then there are 31 bit counters even
>> if there are also 44 bit counters or 63 bit counters.
>
> Although 31-bit counters are always exist, aren't they never used simultaneously with 44-bit or 63-bit counters?
> If the `mpam_feat_msmon_mbwu_31counter` feature is set to always be enabled, could that potentially cause a bug?

Sure, potentially, any change of meaning of a feature flag can be a source of confusion and so bugs
but based on my analysis this patch causes no change of behaviour in the driver other than in the
lines it changes. I do, however, think it's clearer to have feature bits just indicate whether the
feature is present or not rather than adding extra meaning.

In a mismatched system, a class may end up using 31 bit counters even if some of the RIS support
long counters.

Thanks,

Ben



>
> Best regards,
> Shaopeng TAN
>
>
>> Set the 31 bit bandwidth counter feature bit whenever there are bandwidth
>> counters.
>>
>> Fixes: fdc29a141d63 ("arm_mpam: Probe for long/lwd mbwu counters")
>> Signed-off-by: Ben Horgan <ben.horgan@xxxxxxx>
>> ---
>>  drivers/resctrl/mpam_devices.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/resctrl/mpam_devices.c b/drivers/resctrl/mpam_devices.c
>> index acfa9a4dc2fc..11b10c3bc334 100644
>> --- a/drivers/resctrl/mpam_devices.c
>> +++ b/drivers/resctrl/mpam_devices.c
>> @@ -930,9 +930,9 @@ static void mpam_ris_hw_probe(struct mpam_msc_ris *ris)
>>                                                  mpam_set_feature(mpam_feat_msmon_mbwu_63counter, props);
>>                                          else
>>                                                  mpam_set_feature(mpam_feat_msmon_mbwu_44counter, props);
>> -                               } else {
>> -                                       mpam_set_feature(mpam_feat_msmon_mbwu_31counter, props);
>>                                  }
>> +
>> +                               mpam_set_feature(mpam_feat_msmon_mbwu_31counter, props);
>>                          }
>>                  }
>>          }
>> --
>> 2.43.0
>>