All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Bart Van Assche <bvanassche@acm.org>
Cc: "Martin K . Petersen" <martin.petersen@oracle.com>,
	linux-scsi@vger.kernel.org,
	Karan Tilak Kumar <kartilak@cisco.com>,
	Satish Kharat <satishkh@cisco.com>,
	Sesidhar Baddela <sebaddel@cisco.com>,
	"James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
	"Martin K. Petersen" <mkp@kernel.org>
Subject: Re: [PATCH v4 26/54] scsi: fnic: Enable lock context analysis
Date: Thu, 15 Oct 2026 19:31:20 -0700	[thread overview]
Message-ID: <20261016023120.GA2863622@ax162> (raw)
In-Reply-To: <e8ac2000b7ed23cec78f5be360a21d741f50a73e.1790360262.git.bvanassche@acm.org>

Hi Bart,

On Fri, Sep 25, 2026 at 11:26:04AM -0700, Bart Van Assche wrote:
> Document locking requirements with __must_hold(). Suppress complaints
> about conditional locking in fnic_device_reset() with __acquire() and
> __release().
> 
> Cc: Karan Tilak Kumar <kartilak@cisco.com>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>

I am seeing the following warnings/errors with LLVM 23.1.3 after this
change in -next as commit 70d2304ae575 ("scsi: fnic: Enable lock context
analysis"):

  $ make -skj"$(nproc)" ARCH=x86_64 LLVM=1 mrproper allmodconfig drivers/scsi/fnic/
  drivers/scsi/fnic/fnic_nvme.c:1332:2: error: releasing spinlock 'iport->fnic->fnic_lock' that was not held [-Werror,-Wthread-safety-analysis]
   1332 |         spin_unlock_irqrestore(&fnic->fnic_lock, fnic->lock_flags);
        |         ^
  drivers/scsi/fnic/fnic_nvme.c:1336:1: error: spinlock 'iport->fnic->fnic_lock' is not held on every path through here [-Werror,-Wthread-safety-analysis]
   1336 | }
        | ^
  drivers/scsi/fnic/fnic_nvme.c:1335:2: note: spinlock acquired here
   1335 |         spin_lock_irqsave(&fnic->fnic_lock, fnic->lock_flags);
        |         ^
  include/linux/spinlock.h:389:35: note: expanded from macro 'spin_lock_irqsave'
    389 |         __release(spinlock_check(lock)); __acquire(lock);       \
        |                                          ^
  include/linux/compiler-context-analysis.h:375:23: note: expanded from macro '__acquire'
    375 | #define __acquire(x)            __acquire_ctx_lock(x)
        |                                 ^
  drivers/scsi/fnic/fnic_nvme.c:1445:2: error: releasing spinlock 'iport->fnic->fnic_lock' that was not held [-Werror,-Wthread-safety-analysis]
   1445 |         spin_unlock_irqrestore(&fnic->fnic_lock, fnic->lock_flags);
        |         ^
  drivers/scsi/fnic/fnic_nvme.c:1449:1: error: spinlock 'iport->fnic->fnic_lock' is not held on every path through here [-Werror,-Wthread-safety-analysis]
   1449 | }
        | ^
  drivers/scsi/fnic/fnic_nvme.c:1448:2: note: spinlock acquired here
   1448 |         spin_lock_irqsave(&fnic->fnic_lock, fnic->lock_flags);
        |         ^
  include/linux/spinlock.h:389:35: note: expanded from macro 'spin_lock_irqsave'
    389 |         __release(spinlock_check(lock)); __acquire(lock);       \
        |                                          ^
  include/linux/compiler-context-analysis.h:375:23: note: expanded from macro '__acquire'
    375 | #define __acquire(x)            __acquire_ctx_lock(x)
        |                                 ^
  drivers/scsi/fnic/fnic_nvme.c:2120:2: error: releasing spinlock 'iport->fnic->fnic_lock' that was not held [-Werror,-Wthread-safety-analysis]
   2120 |         spin_unlock_irqrestore(&fnic->fnic_lock, flags);
        |         ^
  drivers/scsi/fnic/fnic_nvme.c:2178:1: error: spinlock 'iport->fnic->fnic_lock' is not held on every path through here [-Werror,-Wthread-safety-analysis]
   2178 | }
        | ^
  drivers/scsi/fnic/fnic_nvme.c:2144:2: note: spinlock acquired here
   2144 |         spin_lock_irqsave(&fnic->fnic_lock, flags);
        |         ^
  include/linux/spinlock.h:389:35: note: expanded from macro 'spin_lock_irqsave'
    389 |         __release(spinlock_check(lock)); __acquire(lock);       \
        |                                          ^
  include/linux/compiler-context-analysis.h:375:23: note: expanded from macro '__acquire'
    375 | #define __acquire(x)            __acquire_ctx_lock(x)
        |                                 ^
  drivers/scsi/fnic/fnic_nvme.c:2199:2: error: releasing spinlock 'fnic->fnic_lock' that was not held [-Werror,-Wthread-safety-analysis]
   2199 |         spin_unlock_irqrestore(&fnic->fnic_lock, flags);
        |         ^
  drivers/scsi/fnic/fnic_nvme.c:2215:1: error: spinlock 'fnic->fnic_lock' is still held at the end of function [-Werror,-Wthread-safety-analysis]
   2215 | }
        | ^
  drivers/scsi/fnic/fnic_nvme.c:2202:2: note: spinlock acquired here
   2202 |         spin_lock_irqsave(&fnic->fnic_lock, flags);
        |         ^
  include/linux/spinlock.h:389:35: note: expanded from macro 'spin_lock_irqsave'
    389 |         __release(spinlock_check(lock)); __acquire(lock);       \
        |                                          ^
  include/linux/compiler-context-analysis.h:375:23: note: expanded from macro '__acquire'
    375 | #define __acquire(x)            __acquire_ctx_lock(x)
        |                                 ^
  8 errors generated.

-- 
Cheers,
Nathan

  reply	other threads:[~2026-10-16  2:31 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-25 18:25 [PATCH v4 00/54] scsi: Enable context analysis for most drivers Bart Van Assche
2026-09-25 18:25 ` [PATCH v4 01/54] PCI: Convert to_pci_dev() into an inline function Bart Van Assche
2026-09-25 18:25 ` [PATCH v4 02/54] scsi: sg: Prepare for enabling lock context analysis Bart Van Assche
2026-09-25 18:25 ` [PATCH v4 03/54] scsi: st: " Bart Van Assche
2026-09-25 18:25 ` [PATCH v4 04/54] scsi: BusLogic: Pass the host pointer directly to several functions Bart Van Assche
2026-09-26 20:02   ` Khalid Aziz
2026-09-28 17:41     ` Bart Van Assche
2026-09-28 18:55       ` Khalid Aziz
2026-09-28 19:28         ` Bart Van Assche
2026-09-30 20:13           ` Khalid Aziz
2026-09-30 20:42             ` Bart Van Assche
2026-09-25 18:25 ` [PATCH v4 05/54] scsi: BusLogic: Prepare for enabling lock context analysis Bart Van Assche
2026-09-25 18:25 ` [PATCH v4 06/54] scsi: NCR5380: " Bart Van Assche
2026-09-26  0:42   ` Finn Thain
2026-09-28 17:42     ` Bart Van Assche
2026-09-25 18:25 ` [PATCH v4 07/54] scsi: aacraid: Enable " Bart Van Assche
2026-09-25 18:25 ` [PATCH v4 08/54] scsi: aha152x: Prepare for enabling " Bart Van Assche
2026-09-25 18:25 ` [PATCH v4 09/54] scsi: aic7xxx: Enable " Bart Van Assche
2026-09-25 18:25 ` [PATCH v4 10/54] scsi: aic94xx: " Bart Van Assche
2026-09-25 18:25 ` [PATCH v4 11/54] scsi: arcmsr: " Bart Van Assche
2026-09-25 18:25 ` [PATCH v4 12/54] scsi: libiscsi: Pass the session pointer directly to several functions Bart Van Assche
2026-09-25 18:25 ` [PATCH v4 13/54] scsi: libiscsi: Prepare for enabling lock context analysis Bart Van Assche
2026-09-25 18:25 ` [PATCH v4 14/54] scsi: be2iscsi: Enable " Bart Van Assche
2026-09-25 18:25 ` [PATCH v4 15/54] scsi: cxgbi: " Bart Van Assche
2026-09-25 18:25 ` [PATCH v4 16/54] scsi: bfa: " Bart Van Assche
2026-09-25 18:25 ` [PATCH v4 17/54] scsi: bnx2fc: Pass tgt directly to several functions Bart Van Assche
2026-09-25 18:25 ` [PATCH v4 18/54] scsi: bnx2fc: Enable lock context analysis Bart Van Assche
2026-09-25 18:25 ` [PATCH v4 19/54] scsi: bnx2i: " Bart Van Assche
2026-09-25 18:25 ` [PATCH v4 20/54] scsi: csiostor: Pass the hw pointer directly to several functions Bart Van Assche
2026-09-28  6:27   ` Damien Le Moal
2026-09-25 18:25 ` [PATCH v4 21/54] scsi: csiostor: Enable lock context analysis Bart Van Assche
2026-09-25 18:26 ` [PATCH v4 22/54] scsi: elx: " Bart Van Assche
2026-09-25 18:26 ` [PATCH v4 23/54] scsi: esas2r: " Bart Van Assche
2026-09-25 18:26 ` [PATCH v4 24/54] scsi: fcoe: " Bart Van Assche
2026-09-25 18:26 ` [PATCH v4 25/54] scsi: fnic: Pass pointers directly to several functions Bart Van Assche
2026-09-25 18:26 ` [PATCH v4 26/54] scsi: fnic: Enable lock context analysis Bart Van Assche
2026-10-16  2:31   ` Nathan Chancellor [this message]
2026-10-16  3:38     ` Bart Van Assche
2026-09-25 18:26 ` [PATCH v4 27/54] scsi: hisi_sas: " Bart Van Assche
2026-09-25 18:26 ` [PATCH v4 28/54] scsi: hpsa: Prepare for enabling " Bart Van Assche
2026-09-25 18:26 ` [PATCH v4 29/54] scsi: ibmvscsi: Enable " Bart Van Assche
2026-09-25 18:26 ` [PATCH v4 30/54] scsi: ibmvscsi_tgt: " Bart Van Assche
2026-09-25 18:26 ` [PATCH v4 31/54] scsi: ipr: Simplify ipr_eh_abort() Bart Van Assche
2026-09-25 18:26 ` [PATCH v4 32/54] scsi: ipr: Pass the host pointer directly to several functions Bart Van Assche
2026-09-25 18:26 ` [PATCH v4 33/54] scsi: ipr: Prepare for enabling lock context analysis Bart Van Assche
2026-09-25 18:26 ` [PATCH v4 34/54] scsi: ips: " Bart Van Assche
2026-09-25 18:26 ` [PATCH v4 35/54] scsi: isci: Enable " Bart Van Assche
2026-09-25 18:26 ` [PATCH v4 36/54] scsi: libfc: " Bart Van Assche
2026-09-25 18:26 ` [PATCH v4 37/54] scsi: libsas: Prepare for enabling " Bart Van Assche
2026-09-25 18:26 ` [PATCH v4 38/54] scsi: libsas: Enable " Bart Van Assche
2026-09-25 18:26 ` [PATCH v4 39/54] scsi: lpfc: Prepare for enabling " Bart Van Assche
2026-09-25 18:26 ` [PATCH v4 40/54] scsi: mpt3sas: Enable " Bart Van Assche
2026-09-25 18:26 ` [PATCH v4 41/54] scsi: mvsas: " Bart Van Assche
2026-09-25 18:26 ` [PATCH v4 42/54] scsi: pcmcia: " Bart Van Assche
2026-09-25 18:26 ` [PATCH v4 43/54] scsi: pm8001: " Bart Van Assche
2026-09-25 18:26 ` [PATCH v4 44/54] scsi: qedf: " Bart Van Assche
2026-09-25 18:26 ` [PATCH v4 45/54] scsi: qedi: " Bart Van Assche
2026-09-25 18:26 ` [PATCH v4 46/54] scsi: qla1280: Pass the host pointer directly to several functions Bart Van Assche
2026-09-25 18:26 ` [PATCH v4 47/54] scsi: qla1280: Prepare for enabling lock context analysis Bart Van Assche
2026-09-25 18:26 ` [PATCH v4 48/54] scsi: qla2xxx: Enable " Bart Van Assche
2026-09-25 18:26 ` [PATCH v4 49/54] scsi: qla4xxx: " Bart Van Assche
2026-09-25 18:26 ` [PATCH v4 50/54] scsi: iSCSI transport: Prepare for enabling " Bart Van Assche
2026-09-25 18:26 ` [PATCH v4 51/54] scsi: smartpqi: Enable " Bart Van Assche
2026-09-25 18:26 ` [PATCH v4 52/54] scsi: snic: " Bart Van Assche
2026-09-25 18:26 ` [PATCH v4 53/54] scsi: sym53c8xx_2: " Bart Van Assche
2026-09-25 18:26 ` [PATCH v4 54/54] scsi: drivers: " Bart Van Assche
2026-10-15  2:52 ` [PATCH v4 00/54] scsi: Enable context analysis for most drivers Martin K. Petersen

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=20261016023120.GA2863622@ax162 \
    --to=nathan@kernel.org \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=bvanassche@acm.org \
    --cc=kartilak@cisco.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mkp@kernel.org \
    --cc=satishkh@cisco.com \
    --cc=sebaddel@cisco.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.