Skip to content

Commit 4be4ad6

Browse files
Justin Teemartinkpetersen
authored andcommitted
scsi: lpfc: Remove shost_lock protection for fc_host_port shost APIs
Desiring to reduce the amount of unnecessary shost_lock acquisitions in the lpfc driver, it has been determined that there is no need for shost_lock protection when retrieving fc_host port information because it is only for display to user via sysfs. Signed-off-by: Justin Tee <justin.tee@broadcom.com> Link: https://lore.kernel.org/r/20240131185112.149731-12-justintee8345@gmail.com Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 140bd88 commit 4be4ad6

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

drivers/scsi/lpfc/lpfc_attr.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6429,8 +6429,6 @@ lpfc_get_host_port_type(struct Scsi_Host *shost)
64296429
struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
64306430
struct lpfc_hba *phba = vport->phba;
64316431

6432-
spin_lock_irq(shost->host_lock);
6433-
64346432
if (vport->port_type == LPFC_NPIV_PORT) {
64356433
fc_host_port_type(shost) = FC_PORTTYPE_NPIV;
64366434
} else if (lpfc_is_link_up(phba)) {
@@ -6447,8 +6445,6 @@ lpfc_get_host_port_type(struct Scsi_Host *shost)
64476445
}
64486446
} else
64496447
fc_host_port_type(shost) = FC_PORTTYPE_UNKNOWN;
6450-
6451-
spin_unlock_irq(shost->host_lock);
64526448
}
64536449

64546450
/**
@@ -6461,8 +6457,6 @@ lpfc_get_host_port_state(struct Scsi_Host *shost)
64616457
struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
64626458
struct lpfc_hba *phba = vport->phba;
64636459

6464-
spin_lock_irq(shost->host_lock);
6465-
64666460
if (vport->fc_flag & FC_OFFLINE_MODE)
64676461
fc_host_port_state(shost) = FC_PORTSTATE_OFFLINE;
64686462
else {
@@ -6490,8 +6484,6 @@ lpfc_get_host_port_state(struct Scsi_Host *shost)
64906484
break;
64916485
}
64926486
}
6493-
6494-
spin_unlock_irq(shost->host_lock);
64956487
}
64966488

64976489
/**
@@ -6504,8 +6496,6 @@ lpfc_get_host_speed(struct Scsi_Host *shost)
65046496
struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
65056497
struct lpfc_hba *phba = vport->phba;
65066498

6507-
spin_lock_irq(shost->host_lock);
6508-
65096499
if ((lpfc_is_link_up(phba)) && (!(phba->hba_flag & HBA_FCOE_MODE))) {
65106500
switch(phba->fc_linkspeed) {
65116501
case LPFC_LINK_SPEED_1GHZ:
@@ -6568,8 +6558,6 @@ lpfc_get_host_speed(struct Scsi_Host *shost)
65686558
}
65696559
} else
65706560
fc_host_speed(shost) = FC_PORTSPEED_UNKNOWN;
6571-
6572-
spin_unlock_irq(shost->host_lock);
65736561
}
65746562

65756563
/**
@@ -6583,8 +6571,6 @@ lpfc_get_host_fabric_name (struct Scsi_Host *shost)
65836571
struct lpfc_hba *phba = vport->phba;
65846572
u64 node_name;
65856573

6586-
spin_lock_irq(shost->host_lock);
6587-
65886574
if ((vport->port_state > LPFC_FLOGI) &&
65896575
((vport->fc_flag & FC_FABRIC) ||
65906576
((phba->fc_topology == LPFC_TOPOLOGY_LOOP) &&
@@ -6594,8 +6580,6 @@ lpfc_get_host_fabric_name (struct Scsi_Host *shost)
65946580
/* fabric is local port if there is no F/FL_Port */
65956581
node_name = 0;
65966582

6597-
spin_unlock_irq(shost->host_lock);
6598-
65996583
fc_host_fabric_name(shost) = node_name;
66006584
}
66016585

0 commit comments

Comments
 (0)