From f3e83f6587514271a1706b5b56be32153d779f74 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 25 Sep 2026 11:25:53 -0700 Subject: [PATCH] scsi: cxgbi: Enable lock context analysis Enable compile-time lock context analysis in the Makefile. Document where locking is missing by adding an __assume_ctx_lock() annotation. Signed-off-by: Bart Van Assche Link: https://patch.msgid.link/e663e2d47afc8727991838bbfa29bb5ab21b38b8.1790360262.git.bvanassche@acm.org Signed-off-by: Martin K. Petersen (Oracle) --- drivers/scsi/cxgbi/Makefile | 3 +++ drivers/scsi/cxgbi/libcxgbi.c | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/drivers/scsi/cxgbi/Makefile b/drivers/scsi/cxgbi/Makefile index abfd38a26fec..c614afa18a33 100644 --- a/drivers/scsi/cxgbi/Makefile +++ b/drivers/scsi/cxgbi/Makefile @@ -1,4 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only + +CONTEXT_ANALYSIS := y + ccflags-y += -I $(srctree)/drivers/net/ethernet/chelsio/libcxgb obj-$(CONFIG_SCSI_CXGB3_ISCSI) += libcxgbi.o cxgb3i/ diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c index d73a6578b461..b0bffbc38183 100644 --- a/drivers/scsi/cxgbi/libcxgbi.c +++ b/drivers/scsi/cxgbi/libcxgbi.c @@ -1540,6 +1540,11 @@ skb_read_pdu_bhs(struct cxgbi_sock *csk, struct iscsi_conn *conn, struct iscsi_task *task; u32 data_sn; + /* + * TODO: hold session->back_lock around the iscsi_itt_to_task() + * call below. + */ + __assume_ctx_lock(&conn->session->back_lock); task = iscsi_itt_to_ctask(conn->session, conn, itt); data_sn = be32_to_cpu(((struct iscsi_data *)skb->data)->datasn); if (task && task->sc) {