* [PATCH] arm_mpam: make the mon_sel_lock guard return -EIO
@ 2026-10-22 6:23 Ping Li
0 siblings, 0 replies; only message in thread
From: Ping Li @ 2026-10-22 6:23 UTC (permalink / raw)
To: james.morse, ben.horgan
Cc: sashal, andre.przywara, linux-kernel, linux-arm-kernel,
reinette.chatre, fenghuay, Ping Li
The mon_sel_lock guard class reports -EBUSY when the lock cannot be
taken, but every other failure path of mpam_mon_sel_lock() returns
-EIO.
Encode the error with ERR_PTR(-EIO) in the guard class, so that
ACQUIRE_ERR() reports -EIO as well.
Suggested-by: Ben Horgan <ben.horgan@arm.com>
Signed-off-by: Ping Li <leeonion.muyu@gmail.com>
---
drivers/resctrl/mpam_internal.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/resctrl/mpam_internal.h b/drivers/resctrl/mpam_internal.h
index 1f86cc158100..2f6dfb9d3906 100644
--- a/drivers/resctrl/mpam_internal.h
+++ b/drivers/resctrl/mpam_internal.h
@@ -204,8 +204,8 @@ static inline int mpam_mon_sel_lock_init(struct device *dev,
}
DEFINE_CLASS(mon_sel_lock, struct mpam_msc *,
- if (_T) mpam_mon_sel_unlock(_T),
- mpam_mon_sel_lock(msc) ? msc : NULL, struct mpam_msc *msc);
+ if (_T && !IS_ERR(_T)) mpam_mon_sel_unlock(_T),
+ mpam_mon_sel_lock(msc) ? msc : ERR_PTR(-EIO), struct mpam_msc *msc);
DEFINE_CLASS_IS_COND_GUARD(mon_sel_lock);
/* Bits for mpam features bitmaps */
base-commit: 8ea457f746d915d55f78b43d33b1cd618f3d93ad
--
2.34.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-22 6:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-22 6:23 [PATCH] arm_mpam: make the mon_sel_lock guard return -EIO 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®