diff --git a/drivers/platform/mpam/mpam_devices.c b/drivers/platform/mpam/mpam_devices.c index 387fc444267c9982d959c07250437789a7a31c17..6c1c82f79ec04209d75f9d89dffa7a6cbd8100f0 100644 --- a/drivers/platform/mpam/mpam_devices.c +++ b/drivers/platform/mpam/mpam_devices.c @@ -937,7 +937,6 @@ static void write_msmon_ctl_flt_vals(struct mon_read *m, u32 ctl_val, u32 flt_val) { struct mpam_msc *msc = m->ris->msc; - struct msmon_mbwu_state *mbwu_state; /* * Write the ctl_val with the enable bit cleared, reset the counter, @@ -960,11 +959,6 @@ static void write_msmon_ctl_flt_vals(struct mon_read *m, u32 ctl_val, mpam_write_monsel_reg(msc, MBWU, 0); mpam_write_monsel_reg(msc, CFG_MBWU_CTL, ctl_val|MSMON_CFG_x_CTL_EN); - - mbwu_state = &m->ris->mbwu_state[m->ctx->mon]; - if (mbwu_state) - mbwu_state->prev_val = 0; - break; default: return; @@ -1070,7 +1064,6 @@ static void __ris_msmon_read(void *arg) mpam_csu_hisi_need_retrigger(ris, m->err == -EBUSY)) { 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; } @@ -1132,7 +1125,6 @@ static void __ris_msmon_read(void *arg) if (mbwu_overflow) overflow_val = mpam_msmon_overflow_val(ris); - mbwu_state->prev_val = now; mbwu_state->correction += overflow_val; /* Include bandwidth consumed before the last hardware reset */ @@ -2584,6 +2576,7 @@ int mpam_apply_config(struct mpam_component *comp, u16 partid, arg.ris = ris; mutex_lock(&ris->msc->lock); mpam_touch_msc(ris->msc, __write_config, &arg); + ris->in_reset_state = false; mutex_unlock(&ris->msc->lock); } srcu_read_unlock(&mpam_srcu, idx); diff --git a/drivers/platform/mpam/mpam_internal.h b/drivers/platform/mpam/mpam_internal.h index 7fe4ac6369528e355b3a6de347f44d6c13b698d5..5f60e0cc4eeb17ee771cf293d922cd1580addb16 100644 --- a/drivers/platform/mpam/mpam_internal.h +++ b/drivers/platform/mpam/mpam_internal.h @@ -224,9 +224,6 @@ struct msmon_mbwu_state { bool reset_on_next_read; struct mon_cfg cfg; - /* The value last read from the hardware. Used to detect overflow. */ - u64 prev_val; - /* * The value to add to the new reading to account for power management, * and shifts to trigger the overflow interrupt. diff --git a/drivers/platform/mpam/mpam_resctrl.c b/drivers/platform/mpam/mpam_resctrl.c index 7c386ce7b80fa817ab60453c2200b0f060b84259..8ee0857f9a93002a8a00398ad110779278f30f60 100644 --- a/drivers/platform/mpam/mpam_resctrl.c +++ b/drivers/platform/mpam/mpam_resctrl.c @@ -439,7 +439,8 @@ void resctrl_arch_reset_rmid(struct rdt_resource *r, struct rdt_domain *d, struct mpam_resctrl_dom *dom; struct mpam_resctrl_res *res; - if (eventid != QOS_L3_MBM_LOCAL_EVENT_ID) + if (eventid == QOS_L3_OCCUP_EVENT_ID || + eventid == QOS_L2_OCCUP_EVENT_ID) return; res = container_of(r, struct mpam_resctrl_res, resctrl_res);