scsi: hisi_sas: Delete unused lock in hisi_sas_port_notify_formed()
authorYihang Li <liyihang9@huawei.com>
Tue, 11 Jul 2023 03:15:00 +0000 (11:15 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sun, 23 Jul 2023 19:18:25 +0000 (15:18 -0400)
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>
drivers/scsi/hisi_sas/hisi_sas_main.c

index 8f22ece957bd4d3b5b88a16f3d3ceb5730af64da..7a62590f8730b69f2bf6050cccae8013662c4c24 100644 (file)
@@ -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,