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

From: Gavin Shan

Date: Thu Jul 16 2026 - 20:52:49 EST


Hi Ben,

On 7/16/26 7:26 PM, Ben Horgan wrote:
On 7/16/26 05:18, Gavin Shan wrote:
On 7/10/26 9:55 PM, Ben Horgan wrote:
If there are memory bandwidth counters then there are 31 bit counters even
if there are also 44 bit counters or 63 bit counters.

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(-)


It might be worthwhile to put some context in the commit log helping readers
to correlate to the specification. What I found is something like below in
section 8.2.1.2 Long MBWU counter and capture of ARM IHI 0099A.a:

In MSMON_MBWU, the VALUE field is always 31 bits. If MSMON_MBWU_L is implemented,
the length of the VALUE field is either 63 or 44 bits as set by MPAMF_MBWUMON_IDR.LWD.

How about?

When MPAMF_MSMON_IDR.MSMON_MBWU is 1, MSMON_MBWU is present and has a VALUE field of 31 bits. If
additionally, MPAMF_MBWUMON_IDR.HAS_LONG is 1, then MSMON_MBWU_L is also present and has a VALUE
field of 44 or 63 bits as indicated by MPAMF_MBWUMON_IDR.LWD.


Looks good to me, thanks!

Thanks,

Ben


Thanks,
Gavin


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);
              }
          }
      }

Thanks,
Gavin