[PATCH OLK-6.6] arm64/mpam: Fix L2 MBWU monitor multiplexing issue
 
            hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/ID29QH -------------------------------- The MBWU monitor performs long-term cumulative statistics on bandwidth for a specified PARTID. However, the number of L2 physical monitors is very limited. To support the expanded quantities of PARTIDs and PMGs, the MBWU monitors need to multiplex. Therefore, when a monitor tracks a new PARTID or PMG, which means a change in monitor configuration is detected, the accumulated correction should set to zero. Fixes: 21ac9fc8f275 ("arm_mpam: Track bandwidth counter state for overflow and power management") Signed-off-by: Zeng Heng <zengheng4@huawei.com> --- drivers/platform/mpam/mpam_devices.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/platform/mpam/mpam_devices.c b/drivers/platform/mpam/mpam_devices.c index c2e58fc4c0e8..ae6791b05e8a 100644 --- a/drivers/platform/mpam/mpam_devices.c +++ b/drivers/platform/mpam/mpam_devices.c @@ -1011,7 +1011,7 @@ static void __ris_msmon_read(void *arg) bool reset_on_next_read = false; struct mpam_msc_ris *ris = m->ris; struct mpam_msc *msc = m->ris->msc; - struct msmon_mbwu_state *mbwu_state; + struct msmon_mbwu_state *mbwu_state = NULL; u32 mon_sel, ctl_val, flt_val, cur_ctl, cur_flt; lockdep_assert_held(&msc->lock); @@ -1043,8 +1043,14 @@ static void __ris_msmon_read(void *arg) config_mismatch = cur_flt != flt_val || cur_ctl != (ctl_val | MSMON_CFG_x_CTL_EN); - if (config_mismatch || reset_on_next_read) + if (config_mismatch || reset_on_next_read) { write_msmon_ctl_flt_vals(m, ctl_val, flt_val); + if (mbwu_state) { + mbwu_state->prev_val = 0; + mbwu_state->correction = 0; + mbwu_overflow = false; + } + } /* * Selects the monitor instance associated to the specified PARTID -- 2.25.1
 
            反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/18553 邮件列表地址:https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/AQQ... 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/18553 Mailing list address: https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/AQQ...
participants (2)
- 
                 patchwork bot patchwork bot
- 
                 Zeng Heng Zeng Heng