linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tian Tao <tiantao6@hisilicon.com>
To: <Damien.LeMoal@wdc.com>, <axboe@kernel.dk>,
	<linux-block@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH] skd: replace spin_lock_irqsave by spin_lock in hard IRQ
Date: Wed, 21 Oct 2020 09:16:46 +0800	[thread overview]
Message-ID: <1603243006-9189-1-git-send-email-tiantao6@hisilicon.com> (raw)

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@hisilicon.com>
---
 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


             reply	other threads:[~2020-10-21  1:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-21  1:16 Tian Tao [this message]
2020-10-27  4:09 ` [PATCH] skd: replace spin_lock_irqsave by spin_lock in hard IRQ Damien Le Moal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1603243006-9189-1-git-send-email-tiantao6@hisilicon.com \
    --to=tiantao6@hisilicon.com \
    --cc=Damien.LeMoal@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).