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

Ben Horgan
2026-01-13T17:18:26Z

Hi Zeng,

On 1/9/26 03:45, Zeng Heng wrote:
>> 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.

Yeah, this doesn't look right. A component will usually have affinity
with more than one cpu and if we weren't doing the reset elsewhere we
should only be doing the component level reset when the last of those
cpus goes offline. I'll give this cpu offline/online code another look over.

>
>
> Best Regards,
> Zeng Heng
>

Thanks,

Ben