Re: [PATCH v6 07/10] arm_mpam: prepare mon_sel locking for MPAM-Fb

From: Andre Przywara

Date: Fri Jul 31 2026 - 07:16:57 EST


Hi Lee,

On 7/30/26 23:46, Lee Trager wrote:
On 7/30/26 8:25 AM, Andre Przywara wrote:

diff --git a/drivers/resctrl/mpam_devices.c b/drivers/resctrl/ mpam_devices.c
index 38450c55e45e..d175d1d50030 100644
--- a/drivers/resctrl/mpam_devices.c
+++ b/drivers/resctrl/mpam_devices.c
@@ -2230,7 +2230,10 @@ static struct mpam_msc *do_mpam_msc_drv_probe(struct platform_device *pdev)
      if (err)
          return ERR_PTR(err);
-    mpam_mon_sel_lock_init(msc);
+    err = mpam_mon_sel_lock_init(dev, msc);
+    if (err)
+        return ERR_PTR(err);
+
      msc->id = pdev->id;
      msc->pdev = pdev;
      INIT_LIST_HEAD_RCU(&msc->all_msc_list);

msc->iface is set below, it needs to be set before calling mpam_mon_sel_lock_init() so PCC devices initalize mon_sel_mtex, while MMIO initialize the spinlock.

Ouch, that's a good one. This worked before, because we initialised both, but indeed now breaks.

Thanks for noticing, just moved the initialisation down now.

Cheers,
Andre