Re: [PATCH 11/17] lpfc: Remove shost_lock protection for fc_host_port shost APIs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 1/30/24 16:35, Justin Tee wrote:
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@xxxxxxxxxxxx>
---
  drivers/scsi/lpfc/lpfc_attr.c | 16 ----------------
  1 file changed, 16 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
index d3a5d6ecdf7d..1f9a529e09ff 100644
--- a/drivers/scsi/lpfc/lpfc_attr.c
+++ b/drivers/scsi/lpfc/lpfc_attr.c
@@ -6429,8 +6429,6 @@ lpfc_get_host_port_type(struct Scsi_Host *shost)
  	struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
  	struct lpfc_hba   *phba = vport->phba;
- spin_lock_irq(shost->host_lock);
-
  	if (vport->port_type == LPFC_NPIV_PORT) {
  		fc_host_port_type(shost) = FC_PORTTYPE_NPIV;
  	} else if (lpfc_is_link_up(phba)) {
@@ -6447,8 +6445,6 @@ lpfc_get_host_port_type(struct Scsi_Host *shost)
  		}
  	} else
  		fc_host_port_type(shost) = FC_PORTTYPE_UNKNOWN;
-
-	spin_unlock_irq(shost->host_lock);
  }
/**
@@ -6461,8 +6457,6 @@ lpfc_get_host_port_state(struct Scsi_Host *shost)
  	struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
  	struct lpfc_hba   *phba = vport->phba;
- spin_lock_irq(shost->host_lock);
-
  	if (vport->fc_flag & FC_OFFLINE_MODE)
  		fc_host_port_state(shost) = FC_PORTSTATE_OFFLINE;
  	else {
@@ -6490,8 +6484,6 @@ lpfc_get_host_port_state(struct Scsi_Host *shost)
  			break;
  		}
  	}
-
-	spin_unlock_irq(shost->host_lock);
  }
/**
@@ -6504,8 +6496,6 @@ lpfc_get_host_speed(struct Scsi_Host *shost)
  	struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
  	struct lpfc_hba   *phba = vport->phba;
- spin_lock_irq(shost->host_lock);
-
  	if ((lpfc_is_link_up(phba)) && (!(phba->hba_flag & HBA_FCOE_MODE))) {
  		switch(phba->fc_linkspeed) {
  		case LPFC_LINK_SPEED_1GHZ:
@@ -6568,8 +6558,6 @@ lpfc_get_host_speed(struct Scsi_Host *shost)
  		}
  	} else
  		fc_host_speed(shost) = FC_PORTSPEED_UNKNOWN;
-
-	spin_unlock_irq(shost->host_lock);
  }
/**
@@ -6583,8 +6571,6 @@ lpfc_get_host_fabric_name (struct Scsi_Host *shost)
  	struct lpfc_hba   *phba = vport->phba;
  	u64 node_name;
- spin_lock_irq(shost->host_lock);
-
  	if ((vport->port_state > LPFC_FLOGI) &&
  	    ((vport->fc_flag & FC_FABRIC) ||
  	     ((phba->fc_topology == LPFC_TOPOLOGY_LOOP) &&
@@ -6594,8 +6580,6 @@ lpfc_get_host_fabric_name (struct Scsi_Host *shost)
  		/* fabric is local port if there is no F/FL_Port */
  		node_name = 0;
- spin_unlock_irq(shost->host_lock);
-
  	fc_host_fabric_name(shost) = node_name;
  }

Reviewed-by: Himanshu Madhani <himanshu.madhani@xxxxxxxxxx>

--
Himanshu Madhani                                Oracle Linux Engineering




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux