mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Cc: Maximilian Luz <luzmaximilian@gmail.com>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konradybcio@kernel.org>,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] firmware: qcom: uefisecapp: Annotate acquiring locks for sparse
Date: Mon, 16 Feb 2026 09:00:35 +0100	[thread overview]
Message-ID: <aZLOo3tMAWhXhdkR@hovoldconsulting.com> (raw)
In-Reply-To: <20260215110548.34152-5-krzysztof.kozlowski@oss.qualcomm.com>

On Sun, Feb 15, 2026 at 12:05:50PM +0100, Krzysztof Kozlowski wrote:
> qcuefi_acquire() and qcuefi_release() end with mutex locked or unlocked
> respectively, so annotate them so the lock usage will be tracked by
> sparse.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> ---
>  drivers/firmware/qcom/qcom_qseecom_uefisecapp.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/firmware/qcom/qcom_qseecom_uefisecapp.c b/drivers/firmware/qcom/qcom_qseecom_uefisecapp.c
> index 21be447374aa..befa68d1dcaf 100644
> --- a/drivers/firmware/qcom/qcom_qseecom_uefisecapp.c
> +++ b/drivers/firmware/qcom/qcom_qseecom_uefisecapp.c
> @@ -710,6 +710,7 @@ static int qcuefi_set_reference(struct qcuefi_client *qcuefi)
>  }
>  
>  static struct qcuefi_client *qcuefi_acquire(void)
> +	__acquires(__qcuefi_lock)
>  {
>  	mutex_lock(&__qcuefi_lock);
>  	if (!__qcuefi) {
> @@ -720,6 +721,7 @@ static struct qcuefi_client *qcuefi_acquire(void)
>  }
>  
>  static void qcuefi_release(void)
> +	__releases(__qcuefi_lock)
>  {
>  	mutex_unlock(&__qcuefi_lock);
>  }

The mutex implementation does not use sparse annotation so this actually
introduces sparse warnings (unless something changed very recently).

See 
	
	https://lore.kernel.org/all/ZJ11H8btBhvCx9gD@hovoldconsulting.com/

for what his looks like for the code in question.

Johan

  reply	other threads:[~2026-02-16  8:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-15 11:05 [PATCH 1/3] firmware: qcom: uefisecapp: Simplify mutex with guard Krzysztof Kozlowski
2026-02-15 11:05 ` [PATCH 2/3] firmware: qcom: uefisecapp: Annotate acquiring locks for sparse Krzysztof Kozlowski
2026-02-16  8:00   ` Johan Hovold [this message]
2026-02-16  8:14     ` Krzysztof Kozlowski
2026-02-16  8:20       ` Johan Hovold
2026-02-16  8:27         ` Krzysztof Kozlowski
2026-02-15 11:05 ` [PATCH 3/3] firmware: qcom: scom: Simplify mutex with guard Krzysztof Kozlowski

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=aZLOo3tMAWhXhdkR@hovoldconsulting.com \
    --to=johan@kernel.org \
    --cc=andersson@kernel.org \
    --cc=konradybcio@kernel.org \
    --cc=krzysztof.kozlowski@oss.qualcomm.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luzmaximilian@gmail.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®