Re: [PATCH] arm_mpam: Only schedule mpam_enable work after first successful MSC probe

From: Ben Horgan

Date: Mon Sep 07 2026 - 10:13:44 EST


Hi Ping,

Thanks for the patch and sorry for the delay in replying; I had to dig this e-mail out of quarantine.

On 18/08/2026 14:06, ping.li wrote:
> mpam_discovery_cpu_online() sets new_device_probed unconditionally after
> processing each reachable MSC. Once an MSC has already been probed
> (msc->probed is true), later CPUs sharing it skip
> mpam_msc_hw_probe() but still leave err at its default value of 0.
> As a result, new_device_probed is still set to true, causing
> mpam_enable_work to be scheduled again even though no new hardware was
> probed.
>
> Set new_device_probed only when mpam_msc_hw_probe() is called and
> succeeds.
>
> Fixes: 8f8d0ac1da78 ("arm_mpam: Add cpuhp callbacks to probe MSC hardware")

Are the extra mpam_enable() calls causing any harm or can this be considered just an optimzsation?
If they aren't causing any real issues then there is no need for the fixes tag.

> Signed-off-by: ping.li <ping.li@xxxxxxxxxxxx>
> ---
> drivers/resctrl/mpam_devices.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/resctrl/mpam_devices.c b/drivers/resctrl/mpam_devices.c
> index 2f09f4b78bd3..fefdcf588932 100644
> --- a/drivers/resctrl/mpam_devices.c
> +++ b/drivers/resctrl/mpam_devices.c
> @@ -1866,13 +1866,15 @@ static int mpam_discovery_cpu_online(unsigned int cpu)
> continue;
>
> mutex_lock(&msc->probe_lock);
> - if (!msc->probed)
> + if (!msc->probed) {
> err = mpam_msc_hw_probe(msc);
> + if (!err)
> + new_device_probed = true;
> + }> mutex_unlock(&msc->probe_lock);
>
> if (err)
> break;
> - new_device_probed = true;
> }
>
> if (new_device_probed && !err)

The code change looks good to me.

Thanks,

Ben