[PATCH for-next 16/32] scsi: megaraid: Replace spin_lock_irqsave with spin_lock in hard IRQ

Xiaofei Tan
2021-02-07T11:43:47Z

drivers/scsi/megaraid.c | 10 ++++------
drivers/scsi/megaraid/megaraid_sas_base.c | 5 ++---
2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
index 80f5469..7151752 100644
--- a/drivers/scsi/megaraid.c
+++ b/drivers/scsi/megaraid.c
@@ -1262,7 +1262,6 @@ static irqreturn_t
megaraid_isr_iomapped(int irq, void *devp)
{
adapter_t *adapter = devp;
- unsigned long flags;
u8 status;
u8 nstatus;
u8 completed[MAX_FIRMWARE_STATUS];
@@ -1273,7 +1272,7 @@ megaraid_isr_iomapped(int irq, void *devp)
/*
* loop till F/W has more commands for us to complete.
*/
- spin_lock_irqsave(&adapter->lock, flags);
+ spin_lock(&adapter->lock);

do {
/* Check if a valid interrupt is pending */
@@ -1319,7 +1318,7 @@ megaraid_isr_iomapped(int irq, void *devp)

out_unlock:

- spin_unlock_irqrestore(&adapter->lock, flags);
+ spin_unlock(&adapter->lock);

return IRQ_RETVAL(handled);
}
@@ -1338,7 +1337,6 @@ static irqreturn_t
megaraid_isr_memmapped(int irq, void *devp)
{
adapter_t *adapter = devp;
- unsigned long flags;
u8 status;
u32 dword = 0;
u8 nstatus;
@@ -1349,7 +1347,7 @@ megaraid_isr_memmapped(int irq, void *devp)
/*
* loop till F/W has more commands for us to complete.
*/
- spin_lock_irqsave(&adapter->lock, flags);
+ spin_lock(&adapter->lock);

do {
/* Check if a valid interrupt is pending */
@@ -1399,7 +1397,7 @@ megaraid_isr_memmapped(int irq, void *devp)

out_unlock:

- spin_unlock_irqrestore(&adapter->lock, flags);
+ spin_unlock(&adapter->lock);

return IRQ_RETVAL(handled);
}
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 63a4f48..5c6bf61 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -3996,15 +3996,14 @@ static irqreturn_t megasas_isr(int irq, void *devp)
{
struct megasas_irq_context *irq_context = devp;
struct megasas_instance *instance = irq_context->instance;
- unsigned long flags;
irqreturn_t rc;

if (atomic_read(&instance->fw_reset_no_pci_access))
return IRQ_HANDLED;

- spin_lock_irqsave(&instance->hba_lock, flags);
+ spin_lock(&instance->hba_lock);
rc = megasas_deplete_reply_queue(instance, DID_OK);
- spin_unlock_irqrestore(&instance->hba_lock, flags);
+ spin_unlock(&instance->hba_lock);

return rc;
}
--
2.8.1