scsi: megaraid_sas: Remove spin lock for dpc operation
authorShivasharan S <shivasharan.srikanteshwara@broadcom.com>
Wed, 17 Oct 2018 06:37:50 +0000 (23:37 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 7 Nov 2018 01:33:57 +0000 (20:33 -0500)
Optimization: No need to hold hba_lock in dpc context for reading atomic
variable.

Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/megaraid/megaraid_sas_fusion.c

index 7df7e2c8d4b3f90e325b5f15fccf3fe35038c7a7..259fc892703e5988dbf864328236c4a4c55bb329 100644 (file)
@@ -3573,18 +3573,13 @@ megasas_complete_cmd_dpc_fusion(unsigned long instance_addr)
 {
        struct megasas_instance *instance =
                (struct megasas_instance *)instance_addr;
-       unsigned long flags;
        u32 count, MSIxIndex;
 
        count = instance->msix_vectors > 0 ? instance->msix_vectors : 1;
 
        /* If we have already declared adapter dead, donot complete cmds */
-       spin_lock_irqsave(&instance->hba_lock, flags);
-       if (atomic_read(&instance->adprecovery) == MEGASAS_HW_CRITICAL_ERROR) {
-               spin_unlock_irqrestore(&instance->hba_lock, flags);
+       if (atomic_read(&instance->adprecovery) == MEGASAS_HW_CRITICAL_ERROR)
                return;
-       }
-       spin_unlock_irqrestore(&instance->hba_lock, flags);
 
        for (MSIxIndex = 0 ; MSIxIndex < count; MSIxIndex++)
                complete_cmd_fusion(instance, MSIxIndex);