[PATCH] skd: replace spin_lock_irqsave by spin_lock in hard IRQ

From: Tian Tao
Date: Tue Oct 20 2020 - 21:16:10 EST


The code has been in a irq-disabled context since it is hard IRQ. There
is no necessity to do it again.

Signed-off-by: Tian Tao <tiantao6@xxxxxxxxxxxxx>
---
drivers/block/skd_main.c | 25 ++++++++++---------------
1 file changed, 10 insertions(+), 15 deletions(-)

diff --git a/drivers/block/skd_main.c b/drivers/block/skd_main.c
index ae6454c..e80b670 100644
--- a/drivers/block/skd_main.c
+++ b/drivers/block/skd_main.c
@@ -2368,40 +2368,37 @@ static int skd_unquiesce_dev(struct skd_device *skdev)
static irqreturn_t skd_reserved_isr(int irq, void *skd_host_data)
{
struct skd_device *skdev = skd_host_data;
- unsigned long flags;

- spin_lock_irqsave(&skdev->lock, flags);
+ spin_lock(&skdev->lock);
dev_dbg(&skdev->pdev->dev, "MSIX = 0x%x\n",
SKD_READL(skdev, FIT_INT_STATUS_HOST));
dev_err(&skdev->pdev->dev, "MSIX reserved irq %d = 0x%x\n", irq,
SKD_READL(skdev, FIT_INT_STATUS_HOST));
SKD_WRITEL(skdev, FIT_INT_RESERVED_MASK, FIT_INT_STATUS_HOST);
- spin_unlock_irqrestore(&skdev->lock, flags);
+ spin_unlock(&skdev->lock);
return IRQ_HANDLED;
}

static irqreturn_t skd_statec_isr(int irq, void *skd_host_data)
{
struct skd_device *skdev = skd_host_data;
- unsigned long flags;

- spin_lock_irqsave(&skdev->lock, flags);
+ spin_lock(&skdev->lock);
dev_dbg(&skdev->pdev->dev, "MSIX = 0x%x\n",
SKD_READL(skdev, FIT_INT_STATUS_HOST));
SKD_WRITEL(skdev, FIT_ISH_FW_STATE_CHANGE, FIT_INT_STATUS_HOST);
skd_isr_fwstate(skdev);
- spin_unlock_irqrestore(&skdev->lock, flags);
+ spin_unlock(&skdev->lock);
return IRQ_HANDLED;
}

static irqreturn_t skd_comp_q(int irq, void *skd_host_data)
{
struct skd_device *skdev = skd_host_data;
- unsigned long flags;
int flush_enqueued = 0;
int deferred;

- spin_lock_irqsave(&skdev->lock, flags);
+ spin_lock(&skdev->lock);
dev_dbg(&skdev->pdev->dev, "MSIX = 0x%x\n",
SKD_READL(skdev, FIT_INT_STATUS_HOST));
SKD_WRITEL(skdev, FIT_ISH_COMPLETION_POSTED, FIT_INT_STATUS_HOST);
@@ -2415,7 +2412,7 @@ static irqreturn_t skd_comp_q(int irq, void *skd_host_data)
else if (!flush_enqueued)
schedule_work(&skdev->start_queue);

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

return IRQ_HANDLED;
}
@@ -2423,27 +2420,25 @@ static irqreturn_t skd_comp_q(int irq, void *skd_host_data)
static irqreturn_t skd_msg_isr(int irq, void *skd_host_data)
{
struct skd_device *skdev = skd_host_data;
- unsigned long flags;

- spin_lock_irqsave(&skdev->lock, flags);
+ spin_lock(&skdev->lock);
dev_dbg(&skdev->pdev->dev, "MSIX = 0x%x\n",
SKD_READL(skdev, FIT_INT_STATUS_HOST));
SKD_WRITEL(skdev, FIT_ISH_MSG_FROM_DEV, FIT_INT_STATUS_HOST);
skd_isr_msg_from_dev(skdev);
- spin_unlock_irqrestore(&skdev->lock, flags);
+ spin_unlock(&skdev->lock);
return IRQ_HANDLED;
}

static irqreturn_t skd_qfull_isr(int irq, void *skd_host_data)
{
struct skd_device *skdev = skd_host_data;
- unsigned long flags;

- spin_lock_irqsave(&skdev->lock, flags);
+ spin_lock(&skdev->lock);
dev_dbg(&skdev->pdev->dev, "MSIX = 0x%x\n",
SKD_READL(skdev, FIT_INT_STATUS_HOST));
SKD_WRITEL(skdev, FIT_INT_QUEUE_FULL, FIT_INT_STATUS_HOST);
- spin_unlock_irqrestore(&skdev->lock, flags);
+ spin_unlock(&skdev->lock);
return IRQ_HANDLED;
}

--
2.7.4