[PATCH] arm_mpam: On saving mbwu state read the monitors before clearing CFG_MBWU_CTL
Ben Horgan
ben.horgan at arm.com
Sat Oct 3 06:12:07 PDT 2026
In mpam_save_mbwu_state() the monitor values are read using __ris_msmon_read_locked()
which checks if the configuration provided matches that in the hardware and if
not then resets the monitor. To avoid resetting the monitor before reading the
value that needs saving only clear the configuration after the monitor is read.
Fixes: d056d29aefbe ("arm_mpam: Use __ris_msmon_read() for saving MBWU state")
Signed-off-by: Ben Horgan <ben.horgan at arm.com>
---
based on arm64 for-next/mpam
---
drivers/resctrl/mpam_devices.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/resctrl/mpam_devices.c b/drivers/resctrl/mpam_devices.c
index c32175426433..48adc49b833c 100644
--- a/drivers/resctrl/mpam_devices.c
+++ b/drivers/resctrl/mpam_devices.c
@@ -2052,9 +2052,6 @@ static int mpam_save_mbwu_state(void *arg)
if (ret)
return ret;
ret = mpam_read_monsel_reg(msc, CFG_MBWU_CTL, &cur_ctl);
- if (ret)
- return ret;
- ret = mpam_write_monsel_reg(msc, CFG_MBWU_CTL, 0);
if (ret)
return ret;
@@ -2088,6 +2085,10 @@ static int mpam_save_mbwu_state(void *arg)
mbwu_state->correction = val;
}
+ ret = mpam_write_monsel_reg(msc, CFG_MBWU_CTL, 0);
+ if (ret)
+ return ret;
+
mpam_mon_sel_unlock(msc);
}
--
2.43.0
More information about the linux-arm-kernel
mailing list