Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scsi: fnic: Make fnic_queuecommand() easier to analyze

Move a spin_unlock_irqrestore() call such that the io_lock_acquired
variable can be eliminated. This patch prepares for enabling the Clang
thread-safety analyzer.

Cc: Satish Kharat <satishkh@cisco.com>
Cc: Sesidhar Baddela <sebaddel@cisco.com>
Cc: Karan Tilak Kumar <kartilak@cisco.com>
Cc: James E.J. Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Karan Tilak Kumar <kartilak@cisco.com>
Link: https://patch.msgid.link/20260223220102.2158611-30-bart.vanassche@linux.dev
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Bart Van Assche and committed by
Martin K. Petersen
fc803a39 04d52a5a

+3 -6
+3 -6
drivers/scsi/fnic/fnic_scsi.c
··· 471 471 int sg_count = 0; 472 472 unsigned long flags = 0; 473 473 unsigned long ptr; 474 - int io_lock_acquired = 0; 475 474 uint16_t hwq = 0; 476 475 struct fnic_tport_s *tport = NULL; 477 476 struct rport_dd_data_s *rdd_data; ··· 635 636 spin_lock_irqsave(&fnic->wq_copy_lock[hwq], flags); 636 637 637 638 /* initialize rest of io_req */ 638 - io_lock_acquired = 1; 639 639 io_req->port_id = rport->port_id; 640 640 io_req->start_time = jiffies; 641 641 fnic_priv(sc)->state = FNIC_IOREQ_CMD_PENDING; ··· 687 689 /* REVISIT: Use per IO lock in the final code */ 688 690 fnic_priv(sc)->flags |= FNIC_IO_ISSUED; 689 691 } 692 + 693 + spin_unlock_irqrestore(&fnic->wq_copy_lock[hwq], flags); 694 + 690 695 out: 691 696 cmd_trace = ((u64)sc->cmnd[0] << 56 | (u64)sc->cmnd[7] << 40 | 692 697 (u64)sc->cmnd[8] << 32 | (u64)sc->cmnd[2] << 24 | ··· 699 698 FNIC_TRACE(fnic_queuecommand, sc->device->host->host_no, 700 699 mqtag, sc, io_req, sg_count, cmd_trace, 701 700 fnic_flags_and_state(sc)); 702 - 703 - /* if only we issued IO, will we have the io lock */ 704 - if (io_lock_acquired) 705 - spin_unlock_irqrestore(&fnic->wq_copy_lock[hwq], flags); 706 701 707 702 atomic_dec(&fnic->in_flight); 708 703 atomic_dec(&tport->in_flight);