Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: "Martin K . Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org, Bart Van Assche <bvanassche@acm.org>,
	"James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
	"Martin K. Petersen" <mkp@kernel.org>
Subject: [PATCH v4 47/54] scsi: qla1280: Prepare for enabling lock context analysis
Date: Fri, 25 Sep 2026 11:26:25 -0700	[thread overview]
Message-ID: <ddbb3ac055d757d5113096ebda77dfa122606239.1790360262.git.bvanassche@acm.org> (raw)
In-Reply-To: <cover.1790360262.git.bvanassche@acm.org>

Document locking requirements with __must_hold().

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/qla1280.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
index 863b89ac6ba2..f71e668d011c 100644
--- a/drivers/scsi/qla1280.c
+++ b/drivers/scsi/qla1280.c
@@ -737,6 +737,7 @@ static void qla1280_mailbox_timeout(struct timer_list *t)
 static int
 _qla1280_wait_for_single_command(struct Scsi_Host *host, struct srb *sp,
 				 struct completion *wait)
+	__must_hold(&host->host_lock)
 {
 	int	status = FAILED;
 	struct scsi_cmnd *cmd = sp->cmd;
@@ -754,6 +755,7 @@ _qla1280_wait_for_single_command(struct Scsi_Host *host, struct srb *sp,
 
 static int
 qla1280_wait_for_single_command(struct Scsi_Host *host, struct srb *sp)
+	__must_hold(&host->host_lock)
 {
 	DECLARE_COMPLETION_ONSTACK(wait);
 
@@ -764,6 +766,7 @@ qla1280_wait_for_single_command(struct Scsi_Host *host, struct srb *sp)
 static int
 qla1280_wait_for_pending_commands(struct scsi_qla_host *ha, struct Scsi_Host *host,
 				  int bus, int target)
+	__must_hold(&host->host_lock)
 {
 	int		cnt;
 	int		status;
@@ -811,6 +814,7 @@ qla1280_wait_for_pending_commands(struct scsi_qla_host *ha, struct Scsi_Host *ho
 static int
 qla1280_error_action(struct Scsi_Host *host, struct scsi_cmnd *cmd,
 		     enum action action)
+	__must_hold(&host->host_lock)
 {
 	struct scsi_qla_host *ha;
 	int bus, target, lun;
@@ -1495,6 +1499,7 @@ qla1280_initialize_adapter(struct scsi_qla_host *ha)
  */
 static const struct firmware *
 qla1280_request_firmware(struct scsi_qla_host *ha)
+	__must_hold(&ha->host->host_lock)
 {
 	const struct firmware *fw;
 	int err;
@@ -1660,6 +1665,7 @@ qla1280_chip_diag(struct scsi_qla_host *ha)
 
 static int
 qla1280_load_firmware_pio(struct scsi_qla_host *ha)
+	__must_hold(&ha->host->host_lock)
 {
 	/* enter with host_lock acquired */
 
@@ -1710,6 +1716,7 @@ qla1280_load_firmware_pio(struct scsi_qla_host *ha)
 #define DUMP_IT_BACK 0		/* for debug of RISC loading */
 static int
 qla1280_load_firmware_dma(struct scsi_qla_host *ha)
+	__must_hold(&ha->host->host_lock)
 {
 	/* enter with host_lock acquired */
 	const struct firmware *fw;
@@ -1849,6 +1856,7 @@ qla1280_start_firmware(struct scsi_qla_host *ha)
 
 static int
 qla1280_load_firmware(struct scsi_qla_host *ha)
+	__must_hold(&ha->host->host_lock)
 {
 	/* enter with host_lock taken */
 	int err;
@@ -2418,6 +2426,7 @@ qla1280_nv_write(struct scsi_qla_host *ha, uint16_t data)
  */
 static int
 qla1280_mailbox_command(struct scsi_qla_host *ha, uint8_t mr, uint16_t *mb)
+	__must_hold(&ha->host->host_lock)
 {
 	struct device_reg __iomem *reg = ha->iobase;
 	int status = 0;
@@ -2543,6 +2552,7 @@ qla1280_poll(struct scsi_qla_host *ha)
  */
 static int
 qla1280_bus_reset(struct scsi_qla_host *ha, int bus)
+	__must_hold(&ha->host->host_lock)
 {
 	uint16_t mb[MAILBOX_REGISTER_COUNT];
 	uint16_t reset_delay;
@@ -2603,6 +2613,7 @@ qla1280_bus_reset(struct scsi_qla_host *ha, int bus)
  */
 static int
 qla1280_device_reset(struct scsi_qla_host *ha, int bus, int target)
+	__must_hold(&ha->host->host_lock)
 {
 	uint16_t mb[MAILBOX_REGISTER_COUNT];
 	int status;
@@ -2637,6 +2648,7 @@ qla1280_device_reset(struct scsi_qla_host *ha, int bus, int target)
  */
 static int
 qla1280_abort_command(struct scsi_qla_host *ha, struct srb * sp, int handle)
+	__must_hold(&ha->host->host_lock)
 {
 	uint16_t mb[MAILBOX_REGISTER_COUNT];
 	unsigned int bus, target, lun;
@@ -3754,6 +3766,7 @@ qla1280_error_entry(struct scsi_qla_host *ha, struct response *pkt,
  */
 static int
 qla1280_abort_isp(struct scsi_qla_host *ha)
+	__must_hold(&ha->host->host_lock)
 {
 	struct device_reg __iomem *reg = ha->iobase;
 	struct srb *sp;
@@ -3886,6 +3899,7 @@ qla1280_check_for_dead_scsi_bus(struct scsi_qla_host *ha, unsigned int bus)
 static void
 qla1280_get_target_parameters(struct scsi_qla_host *ha,
 			      struct scsi_device *device)
+	__must_hold(&ha->host->host_lock)
 {
 	uint16_t mb[MAILBOX_REGISTER_COUNT];
 	int bus, target, lun;

  parent reply	other threads:[~2026-09-25 18:32 UTC|newest]

Thread overview: 64+ 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-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 ` Bart Van Assche [this message]
2026-09-25 18:26 ` [PATCH v4 48/54] scsi: qla2xxx: Enable lock context analysis 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

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=ddbb3ac055d757d5113096ebda77dfa122606239.1790360262.git.bvanassche@acm.org \
    --to=bvanassche@acm.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mkp@kernel.org \
    /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