From patchwork Sat Sep 26 00:16:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Song Bao Hua (Barry Song)" X-Patchwork-Id: 11801023 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1C0F1618 for ; Sat, 26 Sep 2020 00:19:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0359A206FB for ; Sat, 26 Sep 2020 00:19:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726064AbgIZATe (ORCPT ); Fri, 25 Sep 2020 20:19:34 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:48298 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725272AbgIZATe (ORCPT ); Fri, 25 Sep 2020 20:19:34 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id EAEC989080C1AC6D09FC; Sat, 26 Sep 2020 08:19:31 +0800 (CST) Received: from SWX921481.china.huawei.com (10.126.201.248) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.487.0; Sat, 26 Sep 2020 08:19:26 +0800 From: Barry Song To: , CC: Barry Song Subject: [PATCH 1/2] spi: spi-tegra20-sflash: remove redundant irqsave and irqrestore in hardIRQ Date: Sat, 26 Sep 2020 12:16:15 +1200 Message-ID: <20200926001616.21292-1-song.bao.hua@hisilicon.com> X-Mailer: git-send-email 2.21.0.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.126.201.248] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Running in hardIRQ, disabling IRQ is redundant. Signed-off-by: Barry Song --- drivers/spi/spi-tegra20-sflash.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-tegra20-sflash.c b/drivers/spi/spi-tegra20-sflash.c index 02cf5f463ba6..b59015c7c8a8 100644 --- a/drivers/spi/spi-tegra20-sflash.c +++ b/drivers/spi/spi-tegra20-sflash.c @@ -359,9 +359,8 @@ static int tegra_sflash_transfer_one_message(struct spi_master *master, static irqreturn_t handle_cpu_based_xfer(struct tegra_sflash_data *tsd) { struct spi_transfer *t = tsd->curr_xfer; - unsigned long flags; - spin_lock_irqsave(&tsd->lock, flags); + spin_lock(&tsd->lock); if (tsd->tx_status || tsd->rx_status || (tsd->status_reg & SPI_BSY)) { dev_err(tsd->dev, "CpuXfer ERROR bit set 0x%x\n", tsd->status_reg); @@ -391,7 +390,7 @@ static irqreturn_t handle_cpu_based_xfer(struct tegra_sflash_data *tsd) tegra_sflash_calculate_curr_xfer_param(tsd->cur_spi, tsd, t); tegra_sflash_start_cpu_based_transfer(tsd, t); exit: - spin_unlock_irqrestore(&tsd->lock, flags); + spin_unlock(&tsd->lock); return IRQ_HANDLED; } From patchwork Sat Sep 26 00:16:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Song Bao Hua (Barry Song)" X-Patchwork-Id: 11801025 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 95259618 for ; Sat, 26 Sep 2020 00:19:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7E44422211 for ; Sat, 26 Sep 2020 00:19:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725272AbgIZATl (ORCPT ); Fri, 25 Sep 2020 20:19:41 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:14282 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726149AbgIZATj (ORCPT ); Fri, 25 Sep 2020 20:19:39 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 0861130BBAA3FB6B0D4B; Sat, 26 Sep 2020 08:19:37 +0800 (CST) Received: from SWX921481.china.huawei.com (10.126.201.248) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.487.0; Sat, 26 Sep 2020 08:19:27 +0800 From: Barry Song To: , CC: Barry Song Subject: [PATCH 2/2] spi: spi-stm32: remove redundant irqsave and irqrestore in hardIRQ Date: Sat, 26 Sep 2020 12:16:16 +1200 Message-ID: <20200926001616.21292-2-song.bao.hua@hisilicon.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20200926001616.21292-1-song.bao.hua@hisilicon.com> References: <20200926001616.21292-1-song.bao.hua@hisilicon.com> MIME-Version: 1.0 X-Originating-IP: [10.126.201.248] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Running in hardIRQ, disabling IRQ is redundant. Signed-off-by: Barry Song --- drivers/spi/spi-stm32.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c index 3056428b09f3..caf44836f4bb 100644 --- a/drivers/spi/spi-stm32.c +++ b/drivers/spi/spi-stm32.c @@ -804,10 +804,9 @@ static irqreturn_t stm32f4_spi_irq_event(int irq, void *dev_id) struct spi_master *master = dev_id; struct stm32_spi *spi = spi_master_get_devdata(master); u32 sr, mask = 0; - unsigned long flags; bool end = false; - spin_lock_irqsave(&spi->lock, flags); + spin_lock(&spi->lock); sr = readl_relaxed(spi->base + STM32F4_SPI_SR); /* @@ -833,7 +832,7 @@ static irqreturn_t stm32f4_spi_irq_event(int irq, void *dev_id) if (!(sr & mask)) { dev_dbg(spi->dev, "spurious IT (sr=0x%08x)\n", sr); - spin_unlock_irqrestore(&spi->lock, flags); + spin_unlock(&spi->lock); return IRQ_NONE; } @@ -875,11 +874,11 @@ static irqreturn_t stm32f4_spi_irq_event(int irq, void *dev_id) STM32F4_SPI_CR2_TXEIE | STM32F4_SPI_CR2_RXNEIE | STM32F4_SPI_CR2_ERRIE); - spin_unlock_irqrestore(&spi->lock, flags); + spin_unlock(&spi->lock); return IRQ_WAKE_THREAD; } - spin_unlock_irqrestore(&spi->lock, flags); + spin_unlock(&spi->lock); return IRQ_HANDLED; }