Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4765342pxu; Wed, 21 Oct 2020 05:01:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5QoyADV1qfmYpWLQfhQ/PzC4vxNWaWLCAIj3iFoQyY8upGF/oaRYETaVj4wdZZ9KCoENB X-Received: by 2002:a05:6402:2073:: with SMTP id bd19mr2597899edb.127.1603281682031; Wed, 21 Oct 2020 05:01:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603281682; cv=none; d=google.com; s=arc-20160816; b=rI98LZz51IkA+WjUjLPR84KpNp6xAyZuOrNcDJr7Icb5VAamkoGeBOPprjKHKvnwFo IVxyEHLhX0xnH+vuxxDcXk/YjWXzhkK4Z0W5CvKh4E9BYfBNKAyLzw+YwJAmEfbk1jSD tkKLSad09AzWFrTnSXYg9eKx4r1EPuQvmt88E1Q18YDNMPav9bEyKs1lWp35joHbmzZw GFck7qDHz4SSMLr/k1YqKbgHx9cKqz35q6Xucsj4/fKYDlhYKxcx3W5WrN2HtdgX5Vqs f57MpFdbGgZQAoJQij/cHFRFgj4kJJtKyeHHaOKayabaD0nKV2VnQE0ZmNyMO/28wDmH 8/9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:to:from; bh=39Rv4DFSp7zV2pfY5qeL8HmyNZQa/FB7QiWOyVXZAa4=; b=cgA2pqana29XGmAnqeXvw7L62VImnpKAX9gTuhCO3xY1JjMjUzbeNlk2WwjdXfD6Yi t4ooggPrLxFySUkqIPvvIsef++XZAXGeP6bZvK7vXiDOH1qimp8Xy3e0oSl/tpgwqFKo EYL5E7wBnRoXqnMHHbvBAFbVAYnE3G1Oe/UOUR3xU/T4Ib0n+Q94yjkK1WGteah9oTQA NTT/G6rYtd6g5Ekq93/KvMnyxdKXj9bR6pALtesneACrxsECDjXSvmpb72/wlsv5KXBT z04qVAfZP3JhnBTGPHXoOrPiXsaXxhlJqVg2nGlDkJ49Xjl2dl38S9Qk2fUL1CWb01rw e8Iw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e14si1156252ejt.80.2020.10.21.05.00.59; Wed, 21 Oct 2020 05:01:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2439848AbgJUBQH (ORCPT + 99 others); Tue, 20 Oct 2020 21:16:07 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:38202 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2439843AbgJUBQG (ORCPT ); Tue, 20 Oct 2020 21:16:06 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 717E8F0672CB70BCB207; Wed, 21 Oct 2020 09:16:04 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.487.0; Wed, 21 Oct 2020 09:16:03 +0800 From: Tian Tao To: , , , Subject: [PATCH] skd: replace spin_lock_irqsave by spin_lock in hard IRQ Date: Wed, 21 Oct 2020 09:16:46 +0800 Message-ID: <1603243006-9189-1-git-send-email-tiantao6@hisilicon.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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