From ea598cfa561bcc0c8e7bc07fd9b1c22b64c756b3 Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Thu, 6 Aug 2026 15:47:58 +0200 Subject: [PATCH 1/2] scsi: zfcp: Add __must_hold() attribute to zfcp_qdio_sbal_get() 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 Link: https://patch.msgid.link/20260806134759.2122369-2-hca@linux.ibm.com Signed-off-by: Martin K. Petersen (Oracle) --- 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 9f5152b42b0e..ced8687f3b7b 100644 --- a/drivers/s390/scsi/zfcp_ext.h +++ b/drivers/s390/scsi/zfcp_ext.h @@ -152,7 +152,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; From 32d9a4e296524e51879af0477c5898b933eb51df Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Thu, 6 Aug 2026 15:47:59 +0200 Subject: [PATCH 2/2] scsi: zfcp: Enable CONTEXT_ANALYSIS The zfcp driver passes clang's compile time context analysis. Therefore enable CONTEXT_ANALYSIS. Signed-off-by: Heiko Carstens Link: https://patch.msgid.link/20260806134759.2122369-3-hca@linux.ibm.com Signed-off-by: Martin K. Petersen (Oracle) --- drivers/s390/scsi/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/s390/scsi/Makefile b/drivers/s390/scsi/Makefile index 352056eb0dd1..01b41f7c6860 100644 --- a/drivers/s390/scsi/Makefile +++ b/drivers/s390/scsi/Makefile @@ -3,6 +3,8 @@ # Makefile for the S/390 specific device drivers # +CONTEXT_ANALYSIS := y + zfcp-objs := zfcp_aux.o zfcp_ccw.o zfcp_dbf.o zfcp_erp.o \ zfcp_fc.o zfcp_fsf.o zfcp_qdio.o zfcp_scsi.o zfcp_sysfs.o \ zfcp_unit.o zfcp_diag.o