mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] arm_mpam: Only schedule mpam_enable work after first successful MSC probe
@ 2026-08-18 13:06 ping.li
  2026-09-08  2:48 ` [PATCH v2] " ping.li
  0 siblings, 1 reply; 6+ messages in thread
From: ping.li @ 2026-08-18 13:06 UTC (permalink / raw)
  To: james.morse, ben.horgan; +Cc: linux-kernel, reinette.chatre, fenghuay, ping.li

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")
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)
-- 
2.34.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-09-15 11:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-18 13:06 [PATCH] arm_mpam: Only schedule mpam_enable work after first successful MSC probe ping.li
2026-09-08  2:48 ` [PATCH v2] " ping.li
2026-09-10  9:25   ` Ben Horgan
2026-09-15  3:18   ` [PATCH v3] arm_mpam: Use an atomic counter to schedule mpam_enable_once() Ping Li
2026-09-15  9:48     ` Ben Horgan
2026-09-15 11:56     ` [PATCH v4] " Ping Li

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®