From df3b20509b24e9bd3a36e5deb09c5243a1555f5d Mon Sep 17 00:00:00 2001 From: Haaris Farooq Date: Tue, 10 Sep 2024 10:01:59 +0100 Subject: [PATCH] module/mpmm: clear bits before writing to MPMMCR When setting the MPMM threshold for a specific core, the MPMMCR value was increased using OR operators. However, this approach is only valid if the MPMMCR value is initially 0. Therefore, add a bit-clear instruction before setting the MPMM threshold. Signed-off-by: Haaris Farooq --- module/mpmm/src/mod_mpmm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/module/mpmm/src/mod_mpmm.c b/module/mpmm/src/mod_mpmm.c index 35a889f3a..14fb63f82 100644 --- a/module/mpmm/src/mod_mpmm.c +++ b/module/mpmm/src/mod_mpmm.c @@ -124,7 +124,9 @@ static void mpmm_core_check_enabled( /* Set the MPMM threshold for a specific core. */ static void mpmm_core_set_threshold(struct mod_mpmm_core_ctx *core_ctx) { - core_ctx->mpmm->MPMMCR |= + core_ctx->mpmm->MPMMCR = + (core_ctx->mpmm->MPMMCR & + ~(MPMM_MPMMCR_GEAR_MASK << MPMM_MPMMCR_GEAR_POS)) | ((core_ctx->threshold & MPMM_MPMMCR_GEAR_MASK) << MPMM_MPMMCR_GEAR_POS); } -- GitLab