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>] [day] [month] [year] [list]
Message-ID: <1603243006-9189-1-git-send-email-tiantao6@hisilicon.com>
Date:   Wed, 21 Oct 2020 09:16:46 +0800
From:   Tian Tao <tiantao6@...ilicon.com>
To:     <Damien.LeMoal@....com>, <axboe@...nel.dk>,
        <linux-block@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH] skd: replace spin_lock_irqsave by spin_lock in hard IRQ

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@...ilicon.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ