mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ben Horgan <ben.horgan@arm.com>
To: "ping.li" <leeonion.muyu@gmail.com>, james.morse@arm.com
Cc: linux-kernel@vger.kernel.org, reinette.chatre@intel.com,
	fenghuay@nvidia.com, "ping.li" <ping.li@horizon.auto>
Subject: Re: [PATCH] arm_mpam: Only schedule mpam_enable work after first successful MSC probe
Date: Mon, 7 Sep 2026 15:02:06 +0100	[thread overview]
Message-ID: <3e93f413-2d51-4647-bda4-f1aad6ad1820@arm.com> (raw)
In-Reply-To: <20260818130646.663778-1-ping.li@horizon.auto_quarantine>

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@horizon.auto>
> ---
>  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


       reply	other threads:[~2026-09-07 14:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260818130646.663778-1-ping.li@horizon.auto_quarantine>
2026-09-07 14:02 ` Ben Horgan [this message]
2026-08-18 13:06 ping.li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3e93f413-2d51-4647-bda4-f1aad6ad1820@arm.com \
    --to=ben.horgan@arm.com \
    --cc=fenghuay@nvidia.com \
    --cc=james.morse@arm.com \
    --cc=leeonion.muyu@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ping.li@horizon.auto \
    --cc=reinette.chatre@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®