From 45e1aadcead0ef7da2d8b850c3c4f131444b7e56 Mon Sep 17 00:00:00 2001 From: Zeng Heng Date: Thu, 10 Jul 2025 20:53:20 +0800 Subject: [PATCH] arm64/mpam: Add quirk for MPAM MSMON_MBWU monitor NRDY bit hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/IAJLCY -------------------------------- Fix the issue where the MSMON_MBWU monitor does not properly update statistics results on certain platforms due to the absence of NRDY bit functionality. On such platforms, when configuring a new partid, the NRDY bit remains 0, causing the monitor to remain 0 or the previous statistics result. For the specified chip vendors, assume the NRDY bit is set on the time configuration update and force the software to re-read the statistics result to ensure accurate data. Signed-off-by: Zeng Heng --- drivers/platform/mpam/mpam_devices.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/platform/mpam/mpam_devices.c b/drivers/platform/mpam/mpam_devices.c index 5f05771e3e4d..21ca76695d3e 100644 --- a/drivers/platform/mpam/mpam_devices.c +++ b/drivers/platform/mpam/mpam_devices.c @@ -928,6 +928,14 @@ bool resctrl_arch_would_mbm_overflow(void) return read_cpuid_implementor() != ARM_CPU_IMP_HISI; } +static bool mpam_ris_has_nrdy_bit(struct mpam_msc_ris *ris) +{ + if (ris->comp->class->type == MPAM_CLASS_MEMORY) + return read_cpuid_implementor() != ARM_CPU_IMP_HISI; + + return true; +} + static void __ris_msmon_read(void *arg) { bool nrdy = false; @@ -1002,6 +1010,9 @@ static void __ris_msmon_read(void *arg) now = FIELD_GET(MSMON___VALUE, now); } + if (config_mismatch && !mpam_ris_has_nrdy_bit(ris)) + nrdy = true; + if (nrdy) break; -- Gitee