Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm_mpam: On saving mbwu state read the monitors before clearing CFG_MBWU_CTL
@ 2026-10-03 13:12 Ben Horgan
  2026-10-06 22:56 ` Catalin Marinas
  0 siblings, 1 reply; 2+ messages in thread
From: Ben Horgan @ 2026-10-03 13:12 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel, ben.horgan
  Cc: catalin.marinas, will, james.morse, reinette.chatre, fenghuay

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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] arm_mpam: On saving mbwu state read the monitors before clearing CFG_MBWU_CTL
  2026-10-03 13:12 [PATCH] arm_mpam: On saving mbwu state read the monitors before clearing CFG_MBWU_CTL Ben Horgan
@ 2026-10-06 22:56 ` Catalin Marinas
  0 siblings, 0 replies; 2+ messages in thread
From: Catalin Marinas @ 2026-10-06 22:56 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel, Ben Horgan
  Cc: Will Deacon, james.morse, reinette.chatre, fenghuay

On Sat, 03 Oct 2026 14:12:07 +0100, Ben Horgan wrote:
> 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.

Applied to arm64 (for-next/mpam), thanks!

[1/1] arm_mpam: On saving mbwu state read the monitors before clearing CFG_MBWU_CTL
      https://git.kernel.org/arm64/c/197a7a41e6e0


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-06 22:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-03 13:12 [PATCH] arm_mpam: On saving mbwu state read the monitors before clearing CFG_MBWU_CTL Ben Horgan
2026-10-06 22:56 ` Catalin Marinas

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