Blob Blame History Raw
From: Yihang Li <liyihang9@huawei.com>
Date: Tue, 11 Jul 2023 11:15:00 +0800
Subject: scsi: hisi_sas: Delete unused lock in hisi_sas_port_notify_formed()
Git-commit: 29f45ed18aa9b75b99126ea675dd29757b621073
Patch-mainline: v6.6-rc1
References: bsc#1216435

Currently spinlock hisi_hba->lock is used by both interrupts and threads
which requires the use of spin_lock_irqsave()/spin_unlock_irqrestore().
However, some places still use spin_lock()/spin_unlock().  Reviewing the
code revealed that it is unnecessary to use hisi_hba->lock in the function
hisi_sas_port_notify_formed() which is the only place that uses the
spinlock in interrupt context. So delete unused lock in
hisi_sas_port_notify_formed().

Signed-off-by: Yihang Li <liyihang9@huawei.com>
Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
Link: https://lore.kernel.org/r/1689045300-44318-4-git-send-email-chenxiang66@hisilicon.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Acked-by: Lee Duncan <lduncan@suse.com>
---
 drivers/scsi/hisi_sas/hisi_sas_main.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c
index 8f22ece957bd..7a62590f8730 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_main.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
@@ -1065,23 +1065,18 @@ EXPORT_SYMBOL_GPL(hisi_sas_phy_enable);
 
 static void hisi_sas_port_notify_formed(struct asd_sas_phy *sas_phy)
 {
-	struct sas_ha_struct *sas_ha = sas_phy->ha;
-	struct hisi_hba *hisi_hba = sas_ha->lldd_ha;
 	struct hisi_sas_phy *phy = sas_phy->lldd_phy;
 	struct asd_sas_port *sas_port = sas_phy->port;
 	struct hisi_sas_port *port;
-	unsigned long flags;
 
 	if (!sas_port)
 		return;
 
 	port = to_hisi_sas_port(sas_port);
-	spin_lock_irqsave(&hisi_hba->lock, flags);
 	port->port_attached = 1;
 	port->id = phy->port_id;
 	phy->port = port;
 	sas_port->lldd_port = port;
-	spin_unlock_irqrestore(&hisi_hba->lock, flags);
 }
 
 static void hisi_sas_do_release_task(struct hisi_hba *hisi_hba, struct sas_task *task,