lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220814064337.32621-10-91tuocao@gmail.com>
Date:   Sun, 14 Aug 2022 14:43:37 +0800
From:   Tuo Cao <91tuocao@...il.com>
To:     James.Bottomley@...senPartnership.com, martin.petersen@...cle.com,
        khalid@...ehiking.org, willy@...radead.org, hare@...e.com
Cc:     anil.gurumurthy@...gic.com, sudarsana.kalluru@...gic.com,
        linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
        91tuocao@...il.com
Subject: [PATCH 9/9] scsi: bfad: move spin_lock_irqsave to spin_lock in interrupt handler

it is unnecessary to call spin_lock_irqsave in a interrupt handler.

Signed-off-by: Tuo Cao <91tuocao@...il.com>
---
 drivers/scsi/bfa/bfad.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/drivers/scsi/bfa/bfad.c b/drivers/scsi/bfa/bfad.c
index e5aa982ffedc..3191377d543b 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -1086,25 +1086,24 @@ bfad_intx(int irq, void *dev_id)
 {
 	struct bfad_s	*bfad = dev_id;
 	struct list_head	doneq;
-	unsigned long	flags;
 	bfa_boolean_t rc;
 
-	spin_lock_irqsave(&bfad->bfad_lock, flags);
+	spin_lock(&bfad->bfad_lock);
 	rc = bfa_intx(&bfad->bfa);
 	if (!rc) {
-		spin_unlock_irqrestore(&bfad->bfad_lock, flags);
+		spin_unlock(&bfad->bfad_lock);
 		return IRQ_NONE;
 	}
 
 	bfa_comp_deq(&bfad->bfa, &doneq);
-	spin_unlock_irqrestore(&bfad->bfad_lock, flags);
+	spin_unlock(&bfad->bfad_lock);
 
 	if (!list_empty(&doneq)) {
 		bfa_comp_process(&bfad->bfa, &doneq);
 
-		spin_lock_irqsave(&bfad->bfad_lock, flags);
+		spin_lock(&bfad->bfad_lock);
 		bfa_comp_free(&bfad->bfa, &doneq);
-		spin_unlock_irqrestore(&bfad->bfad_lock, flags);
+		spin_unlock(&bfad->bfad_lock);
 	}
 
 	return IRQ_HANDLED;
@@ -1117,20 +1116,19 @@ bfad_msix(int irq, void *dev_id)
 	struct bfad_msix_s *vec = dev_id;
 	struct bfad_s *bfad = vec->bfad;
 	struct list_head doneq;
-	unsigned long   flags;
 
-	spin_lock_irqsave(&bfad->bfad_lock, flags);
+	spin_lock(&bfad->bfad_lock);
 
 	bfa_msix(&bfad->bfa, vec->msix.entry);
 	bfa_comp_deq(&bfad->bfa, &doneq);
-	spin_unlock_irqrestore(&bfad->bfad_lock, flags);
+	spin_unlock(&bfad->bfad_lock);
 
 	if (!list_empty(&doneq)) {
 		bfa_comp_process(&bfad->bfa, &doneq);
 
-		spin_lock_irqsave(&bfad->bfad_lock, flags);
+		spin_lock(&bfad->bfad_lock);
 		bfa_comp_free(&bfad->bfa, &doneq);
-		spin_unlock_irqrestore(&bfad->bfad_lock, flags);
+		spin_unlock(&bfad->bfad_lock);
 	}
 
 	return IRQ_HANDLED;
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ