lkml.org 
[lkml]   [2021]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH for-next 10/32] scsi: bfa: Replace spin_lock_irqsave with spin_lock in hard IRQ
Date
It is redundant to do irqsave and irqrestore in hardIRQ context, where
it has been in a irq-disabled context.

Signed-off-by: Xiaofei Tan <tanxiaofei@huawei.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 440ef32..8c6f3eb 100644
--- a/drivers/scsi/bfa/bfad.c
+++ b/drivers/scsi/bfa/bfad.c
@@ -1089,25 +1089,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;
@@ -1120,20 +1119,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.8.1
\
 
 \ /
  Last update: 2021-02-07 12:45    [W:0.176 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site