]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
arm_mpam: Fix monitor instance selection when checking for hardware NRDY
authorBen Horgan <ben.horgan@arm.com>
Thu, 7 May 2026 15:28:12 +0000 (16:28 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Thu, 14 May 2026 08:51:41 +0000 (09:51 +0100)
In _mpam_ris_hw_probe_hw_nrdy() a new register value to select the first
monitor and relevant RIS is prepared in mon_sel. However, it is written to
the monitor value register, e.g. MSMON_CSU, rather than MSMON_CFG_MON_SEL.

As MSMON_CFG_MON_SEL is a 32 bit register update the type of mon_sel to
u32.  Write mon_sel to the intended register, MSMON_CFG_MON_SEL.

Fixes: 8c90dc68a5de ("arm_mpam: Probe the hardware features resctrl supports")
Cc: <stable@vger.kernel.org>
Signed-off-by: Ben Horgan <ben.horgan@arm.com>
Reviewed-by: James Morse <james.morse@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
drivers/resctrl/mpam_devices.c

index 41b14344b16f2d361e67c261a7243c40b7773ed9..817cb10a8e795f97bab1b8934c2099b762e48d43 100644 (file)
@@ -731,7 +731,7 @@ static void mpam_enable_quirks(struct mpam_msc *msc)
 static bool _mpam_ris_hw_probe_hw_nrdy(struct mpam_msc_ris *ris, u32 mon_reg)
 {
        u32 now;
-       u64 mon_sel;
+       u32 mon_sel;
        bool can_set, can_clear;
        struct mpam_msc *msc = ris->vmsc->msc;
 
@@ -740,7 +740,7 @@ static bool _mpam_ris_hw_probe_hw_nrdy(struct mpam_msc_ris *ris, u32 mon_reg)
 
        mon_sel = FIELD_PREP(MSMON_CFG_MON_SEL_MON_SEL, 0) |
                  FIELD_PREP(MSMON_CFG_MON_SEL_RIS, ris->ris_idx);
-       _mpam_write_monsel_reg(msc, mon_reg, mon_sel);
+       mpam_write_monsel_reg(msc, CFG_MON_SEL, mon_sel);
 
        _mpam_write_monsel_reg(msc, mon_reg, MSMON___NRDY);
        now = _mpam_read_monsel_reg(msc, mon_reg);