mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ping Li <leeonion.muyu@gmail.com>
To: james.morse@arm.com, ben.horgan@arm.com
Cc: sashal@kernel.org, andre.przywara@arm.com,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, reinette.chatre@intel.com,
	fenghuay@nvidia.com, Ping Li <leeonion.muyu@gmail.com>
Subject: [PATCH] arm_mpam: make the mon_sel_lock guard return -EIO
Date: Thu, 22 Oct 2026 14:23:35 +0800	[thread overview]
Message-ID: <20261022062335.758832-1-leeonion.muyu@gmail.com> (raw)

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


                 reply	other threads:[~2026-10-22  6:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261022062335.758832-1-leeonion.muyu@gmail.com \
    --to=leeonion.muyu@gmail.com \
    --cc=andre.przywara@arm.com \
    --cc=ben.horgan@arm.com \
    --cc=fenghuay@nvidia.com \
    --cc=james.morse@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=reinette.chatre@intel.com \
    --cc=sashal@kernel.org \
    /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®