[PATCH OLK-6.6] arm64/mpam: Fix the logic that determines whether an MPAM MSC should initialize

hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/ICRZPF -------------------------------- In non-full core boot scenarios, L2 MSCs corresponding to offline CPUs should skip. The former logic used a boolean skipped flag to mark an MSC skipped, but this caused mpam_enable() to wrongly ignore MSCs that actually required initialization. This fix patch removes the skipped flag and instead relies on cpu_mask: if the MSC's accessibility mask contains no online CPUs, the MSC is left uninitialized. Fixes: ef5e3cfd0c6a ("arm64/mpam: Support partial-core boot for MPAM") Signed-off-by: Zeng Heng <zengheng4@huawei.com> --- drivers/platform/mpam/mpam_devices.c | 17 +++++++++-------- drivers/platform/mpam/mpam_internal.h | 1 - 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/platform/mpam/mpam_devices.c b/drivers/platform/mpam/mpam_devices.c index c307554bfda4..eaa51fc0f8f3 100644 --- a/drivers/platform/mpam/mpam_devices.c +++ b/drivers/platform/mpam/mpam_devices.c @@ -1530,11 +1530,8 @@ static int mpam_discovery_cpu_online(unsigned int cpu) mutex_lock(&mpam_list_lock); list_for_each_entry(msc, &mpam_all_msc, glbl_list) { - if (!cpumask_test_cpu(cpu, &msc->accessibility)) { - msc->probed = true; - msc->skipped = true; + if (!cpumask_test_cpu(cpu, &msc->accessibility)) continue; - } mutex_lock(&msc->lock); if (!msc->probed) @@ -1952,7 +1949,7 @@ static void mpam_enable_init_class_features(struct mpam_class *class) list_for_each_entry(comp, &class->components, class_list) { list_for_each_entry(ris, &comp->ris, comp_list) { - if (!ris->msc->skipped) + if (ris->msc->probed) break; } } @@ -1977,7 +1974,7 @@ static void mpam_enable_merge_features(void) list_for_each_entry(comp, &class->components, class_list) { list_for_each_entry(ris, &comp->ris, comp_list) { - if (ris->msc->skipped) + if (!ris->msc->probed) continue; __resource_props_mismatch(ris, class); @@ -2353,6 +2350,7 @@ void mpam_disable(struct work_struct *ignored) */ void mpam_enable(struct work_struct *work) { + cpumask_t mask; static atomic_t once; struct mpam_msc *msc; bool all_devices_probed = true; @@ -2360,8 +2358,11 @@ void mpam_enable(struct work_struct *work) mutex_lock(&mpam_list_lock); list_for_each_entry(msc, &mpam_all_msc, glbl_list) { mutex_lock(&msc->lock); - if (!msc->probed) - all_devices_probed = false; + if (!msc->probed) { + cpumask_and(&mask, &msc->accessibility, cpu_online_mask); + if (!cpumask_empty(&mask)) + all_devices_probed = false; + } mutex_unlock(&msc->lock); if (!all_devices_probed) diff --git a/drivers/platform/mpam/mpam_internal.h b/drivers/platform/mpam/mpam_internal.h index 94872c0930a6..ff1890b3a78e 100644 --- a/drivers/platform/mpam/mpam_internal.h +++ b/drivers/platform/mpam/mpam_internal.h @@ -55,7 +55,6 @@ struct mpam_msc struct mutex lock; bool probed; - bool skipped; bool error_irq_requested; bool error_irq_hw_enabled; u16 partid_max; -- 2.25.1

反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/17823 邮件列表地址:https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/244... FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/17823 Mailing list address: https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/244...
participants (2)
-
patchwork bot
-
Zeng Heng