diff options
| author | Ben Horgan <ben.horgan@arm.com> | 2026-09-17 15:56:14 +0100 |
|---|---|---|
| committer | James Morse <james.morse@arm.com> | 2026-10-02 17:39:32 +0100 |
| commit | 09ff5358c6233c3155c8779c608c24d7f146f532 (patch) | |
| tree | 594ecd49668a608e403acb9fbdedad6d6624ff3c /drivers/resctrl | |
| parent | 724eae25d16ee49e5cabbd927af95ef2be8fd78c (diff) | |
arm_mpam: resctrl: Make read_mon_cdp_safe() self consistent
When read_mon_cdp_safe() is called with cdp_enabled equal to false then the
reading returned in val is the sum of the monitor values for the given
component. However, when cdp_enabled equal to true it is again the sum of
the monitor values but with the initial value of val also added. Both
resctrl_arch_cntr_read() and resctrl_arch_rmid_read() call
read_mon_cdp_safe() and are documented to return the val directly without
consideration of the older value.
The val is always zeroed before read_mon_cdp_safe() is called except in
__check_limbo() and __l3_mon_event_count_sum() but the latter is not
relevant on MPAM systems. The extra accumulation in __check_limbo() means
when there are multiple RMIDs in limbo some of them may be marked dirty
when they are already clean.
Change the cdp_enabled equals true case to match the false case.
Fixes: fb56b29932ca ("arm_mpam: resctrl: Add resctrl_arch_rmid_read()")
Signed-off-by: Ben Horgan <ben.horgan@arm.com>
Tested-by: Gavin Shan <gshan@redhat.com>
Reviewed-by: Gavin Shan <gshan@redhat.com>
Reviewed-by: James Morse <james.morse@arm.com>
[morse: fixed commit message indenting and removed stale description]
Signed-off-by: James Morse <james.morse@arm.com>
Diffstat (limited to 'drivers/resctrl')
| -rw-r--r-- | drivers/resctrl/mpam_resctrl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/resctrl/mpam_resctrl.c b/drivers/resctrl/mpam_resctrl.c index b825bd90d4bd..321741a702fe 100644 --- a/drivers/resctrl/mpam_resctrl.c +++ b/drivers/resctrl/mpam_resctrl.c @@ -497,7 +497,7 @@ static int read_mon_cdp_safe(struct mpam_resctrl_mon *mon, struct mpam_component if (err) return err; - *val += code_val + data_val; + *val = code_val + data_val; return 0; } |
