From: Heiko Carstens <hca@linux.ibm.com>
To: "James E . J . Bottomley" <James.Bottomley@HansenPartnership.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
Nihar Panda <niharp@linux.ibm.com>
Cc: linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org
Subject: [PATCH 1/2] scsi: zfcp: Add __must_hold() attribute to zfcp_qdio_sbal_get()
Date: Thu, 6 Aug 2026 15:47:58 +0200 [thread overview]
Message-ID: <20260806134759.2122369-2-hca@linux.ibm.com> (raw)
In-Reply-To: <20260806134759.2122369-1-hca@linux.ibm.com>
Add __must_hold() attribute to zfcp_qdio_sbal_get() in order to let
clang's context analysis know that qdio->req_q_wq must be held on
function entry. This is also documented above the function. Without this
annotation this leads to a valid warning when context analysis is
enabled:
drivers/s390/scsi/zfcp_qdio.c:287:8: warning:
expecting spinlock '->req_q_lock' to be held at start of each loop [-Wthread-safety-analysis]
287 | ret = wait_event_interruptible_lock_irq_timeout(qdio->req_q_wq,
| ^
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
---
drivers/s390/scsi/zfcp_ext.h | 3 ++-
drivers/s390/scsi/zfcp_qdio.c | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h
index 40bd597fb4cd..0eb9bc9d03e4 100644
--- a/drivers/s390/scsi/zfcp_ext.h
+++ b/drivers/s390/scsi/zfcp_ext.h
@@ -154,7 +154,8 @@ extern ssize_t zfcp_fsf_scnprint_fc_security(char *buf, size_t size,
/* zfcp_qdio.c */
extern int zfcp_qdio_setup(struct zfcp_adapter *);
extern void zfcp_qdio_destroy(struct zfcp_qdio *);
-extern int zfcp_qdio_sbal_get(struct zfcp_qdio *);
+extern int zfcp_qdio_sbal_get(struct zfcp_qdio *qdio)
+ __must_hold(qdio->req_q_lock);
extern int zfcp_qdio_send(struct zfcp_qdio *, struct zfcp_qdio_req *);
extern int zfcp_qdio_sbals_from_sg(struct zfcp_qdio *, struct zfcp_qdio_req *,
struct scatterlist *);
diff --git a/drivers/s390/scsi/zfcp_qdio.c b/drivers/s390/scsi/zfcp_qdio.c
index ce1af72d9b61..bac8385e069f 100644
--- a/drivers/s390/scsi/zfcp_qdio.c
+++ b/drivers/s390/scsi/zfcp_qdio.c
@@ -281,6 +281,7 @@ static int zfcp_qdio_sbal_check(struct zfcp_qdio *qdio)
* Returns: 0 on success, -EIO if there is no free sbal after waiting.
*/
int zfcp_qdio_sbal_get(struct zfcp_qdio *qdio)
+ __must_hold(qdio->req_q_lock)
{
long ret;
--
2.53.0
next prev parent reply other threads:[~2026-08-06 13:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-06 13:47 [PATCH 0/2] scsi: zfcp: Enable CONTEXT_ANALYSIS Heiko Carstens
2026-08-06 13:47 ` Heiko Carstens [this message]
2026-08-06 13:59 ` [PATCH 1/2] scsi: zfcp: Add __must_hold() attribute to zfcp_qdio_sbal_get() sashiko-bot
2026-08-06 13:47 ` [PATCH 2/2] scsi: zfcp: Enable CONTEXT_ANALYSIS Heiko Carstens
2026-08-06 13:50 ` sashiko-bot
2026-08-06 16:36 ` [PATCH 0/2] " Bart Van Assche
2026-08-07 17:47 ` Martin K. Petersen (Oracle)
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=20260806134759.2122369-2-hca@linux.ibm.com \
--to=hca@linux.ibm.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=linux-s390@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=niharp@linux.ibm.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