[PATCH v10 RESEND 04/15] arm_mpam: Fix infinite PARTID reset loop when 65536 PARTIDs are supported
From: Jinjie Ruan
Date: Tue Oct 20 2026 - 09:59:10 EST
mpam_reset_ris() and mpam_reprogram_msc walks the PARTID range with
a u16 counter bounded by mpam_partid_max, which can be 65535 on
hardware implementing the full 16-bit PARTID space. After the final
iteration the counter wraps back to zero and the loop never terminates.
Widen the counter to u32.
Fixes: 09b89d2a72f3 ("arm_mpam: Allow configuration to be applied and restored during cpu online")
Fixes: f188a36ca241 ("arm_mpam: Reset MSC controls from cpuhp callbacks")
Signed-off-by: Jinjie Ruan <ruanjinjie@xxxxxxxxxx>
---
drivers/resctrl/mpam_devices.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/resctrl/mpam_devices.c b/drivers/resctrl/mpam_devices.c
index dd422c56fbb1..61cbc75625fa 100644
--- a/drivers/resctrl/mpam_devices.c
+++ b/drivers/resctrl/mpam_devices.c
@@ -1720,7 +1720,8 @@ static int mpam_save_mbwu_state(void *arg)
*/
static int mpam_reset_ris(void *arg)
{
- u16 partid, partid_max;
+ u16 partid_max;
+ u32 partid;
struct mpam_config reset_cfg = {};
struct mpam_msc_ris *ris = arg;
@@ -1777,7 +1778,7 @@ static int __write_config(void *arg)
static void mpam_reprogram_msc(struct mpam_msc *msc)
{
- u16 partid;
+ u32 partid;
bool reset;
struct mpam_config *cfg;
struct mpam_msc_ris *ris;
--
2.34.1