Linux SCSI subsystem development
 help / color / mirror / Atom feed
* [PATCH] scsi: core: Rework the DEF_SCSI_QCMD() implementation
@ 2026-08-31 19:28 Bart Van Assche
  2026-08-31 21:35 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Bart Van Assche @ 2026-08-31 19:28 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, John Garry, Bart Van Assche, James E.J. Bottomley,
	Martin K. Petersen

In DEF_SCSI_QCMD(), make the following changes:
 - Replace shost with cmd->device->host because func_name##_lck()
   implementations will be annotated with
   __must_hold(&cmd->device->host->host_lock).
 - Do not save and restore the IRQ flags. Since support for the legacy
   block layer has been removed, .queue_rq() implementations are always
   called from thread context and with interrupts enabled. Hence, saving
   and restoring the interrupt state is not necessary.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 include/scsi/scsi_host.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index 16243ec376cd..c018f78ce3ce 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -531,12 +531,11 @@ struct scsi_host_template {
 	enum scsi_qc_status func_name(struct Scsi_Host *shost,		\
 				      struct scsi_cmnd *cmd)		\
 	{								\
-		unsigned long irq_flags;				\
 		enum scsi_qc_status rc;					\
 									\
-		spin_lock_irqsave(shost->host_lock, irq_flags);		\
+		spin_lock_irq(cmd->device->host->host_lock);		\
 		rc = func_name##_lck(cmd);				\
-		spin_unlock_irqrestore(shost->host_lock, irq_flags);	\
+		spin_unlock_irq(cmd->device->host->host_lock);		\
 		return rc;						\
 	}
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-08-31 21:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-31 19:28 [PATCH] scsi: core: Rework the DEF_SCSI_QCMD() implementation Bart Van Assche
2026-08-31 21:35 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox