[RFC PATCH 01/10] arm_mpam: Treat adopting a config feature as a change

From: Jinjie Ruan

Date: Thu Oct 22 2026 - 22:53:30 EST


maybe_update_config() only latched a feature when the new value differed
from the old one. Zero is a valid value for several controls, so a
configuration that adopts a feature with the reset value would be
treated as unchanged and the register would never be reprogrammed.

Always latch a feature the old config does not have, and reprogram when
the value changes as before. This is needed by the controls that follow,
which can legitimately be programmed with zero.

Signed-off-by: Jinjie Ruan <ruanjinjie@xxxxxxxxxx>
---
drivers/resctrl/mpam_devices.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/resctrl/mpam_devices.c b/drivers/resctrl/mpam_devices.c
index dd422c56fbb1..0fbf3464e744 100644
--- a/drivers/resctrl/mpam_devices.c
+++ b/drivers/resctrl/mpam_devices.c
@@ -2897,8 +2897,15 @@ void mpam_enable(struct work_struct *work)
mpam_enable_once();
}

+/*
+ * Adopting a feature is itself a change: 0 is a valid value for several
+ * controls, and writing it must reprogram the reset value, not just merge
+ * the (equal) number.
+ */
#define maybe_update_config(cfg, feature, newcfg, member, changes) do { \
- if (mpam_has_feature(feature, newcfg) && \
+ if (!mpam_has_feature(feature, newcfg)) \
+ break; \
+ if (!mpam_has_feature(feature, cfg) || \
(newcfg)->member != (cfg)->member) { \
(cfg)->member = (newcfg)->member; \
mpam_set_feature(feature, cfg); \
--
2.34.1