mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 7.3.y] arm_mpam: On saving mbwu state read the monitors before clearing CFG_MBWU_CTL
@ 2026-11-19 15:19 Andre Przywara
  0 siblings, 0 replies; only message in thread
From: Andre Przywara @ 2026-11-19 15:19 UTC (permalink / raw)
  To: stable
  Cc: Ben Horgan, James Morse, Reinette Chatre, Fenghua Yu,
	Sasha Levin, linux-kernel

From: Ben Horgan <ben.horgan@arm.com>

commit 197a7a41e6e006916fe68c952e96d768933104fe upstream

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@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
[backport: drop error returns, adjust to changed context]
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
Hi,

this is the backport version of this patch for v7.3, as discussed on the
list before. This avoids backporting two lengthy patches that do not
make any sense for v7.3 (introduction of error return checks only used
in v7.4-rc1 code).

Applies on top of stable-rc/linux-7.3.y (commit "Linux 7.3.6-rc1").

Please apply for v7.3.6!

Cheers,
Andre

 drivers/resctrl/mpam_devices.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/resctrl/mpam_devices.c b/drivers/resctrl/mpam_devices.c
index 30d08d1634a2b..aabbe2ad8f1af 100644
--- a/drivers/resctrl/mpam_devices.c
+++ b/drivers/resctrl/mpam_devices.c
@@ -1716,7 +1716,6 @@ static int mpam_save_mbwu_state(void *arg)
 
 		cur_flt = mpam_read_monsel_reg(msc, CFG_MBWU_FLT);
 		cur_ctl = mpam_read_monsel_reg(msc, CFG_MBWU_CTL);
-		mpam_write_monsel_reg(msc, CFG_MBWU_CTL, 0);
 
 		cfg->mon = i;
 		cfg->pmg = FIELD_GET(MSMON_CFG_x_FLT_PMG, cur_flt);
@@ -1748,6 +1747,8 @@ static int mpam_save_mbwu_state(void *arg)
 			mbwu_state->correction = val;
 		}
 
+		mpam_write_monsel_reg(msc, CFG_MBWU_CTL, 0);
+
 		mpam_mon_sel_unlock(msc);
 	}
 

base-commit: 62eba995b019cddac60e54392601f157010821e9
-- 
2.43.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-19 15:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-19 15:19 [PATCH 7.3.y] arm_mpam: On saving mbwu state read the monitors before clearing CFG_MBWU_CTL Andre Przywara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®