Re: [PATCH v2 18/45] arm_mpam: resctrl: Implement resctrl_arch_reset_all_ctrls()

Zeng Heng
2026-01-09T03:45:29Z

> From: James Morse <james.morse@arm.com>
> Date: Fri, 5 Dec 2025 21:58:32 +0000
> Subject: [PATCH v2 18/45] arm_mpam: resctrl: Implement resctrl_arch_reset_all_ctrls()
>
> We already have a helper for resetting an mpam class and component. Hook
> it up to resctrl_arch_reset_all_ctrls() and the domain offline path.
>
> Signed-off-by: James Morse <james.morse@arm.com>
> Signed-off-by: Ben Horgan <ben.horgan@arm.com>
> ---
> drivers/resctrl/mpam_devices.c | 6 +++---
> drivers/resctrl/mpam_internal.h | 7 +++++++
> drivers/resctrl/mpam_resctrl.c | 15 +++++++++++++++
> 3 files changed, 25 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/resctrl/mpam_resctrl.c b/drivers/resctrl/mpam_resctrl.c
> index bc4f1c80eab..d32e8700245 100644
> --- a/drivers/resctrl/mpam_resctrl.c
> +++ b/drivers/resctrl/mpam_resctrl.c
> @@ -353,6 +366,8 @@ void mpam_resctrl_offline_cpu(unsigned int cpu)
>
> ctrl_dom_empty = true;
> if (exposed_alloc_capable) {
> + mpam_reset_component_locked(dom->ctrl_comp);
> +
> ctrl_d = &dom->resctrl_ctrl_dom;
> ctrl_dom_empty = mpam_resctrl_offline_domain_hdr(cpu, &ctrl_d->hdr);
> if (ctrl_dom_empty)

mpam_cpu_offline() already directly calls mpam_reset_ris() to reset the
MPAM MSC that is about to go offline. So why here still need
mpam_resctrl_offline_cpu() to invoke mpam_reset_component_locked(),
which ends up calling mpam_reset_ris() again?

Please point it out if I might have overlooked anything, thank you.

Best Regards,
Zeng Heng