Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp936277pxb; Thu, 5 Nov 2020 17:58:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJyX98BtT2kVD7PfKqAyAMfwRFJ0tD9xuyamrW4Fti/NtnWPEBtsGrvzDin7XvIJUxnnJI3n X-Received: by 2002:a17:906:8282:: with SMTP id h2mr5590718ejx.50.1604627888958; Thu, 05 Nov 2020 17:58:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604627888; cv=none; d=google.com; s=arc-20160816; b=AxnBeMamx3DdV7b8ZEQMEgLxE8zM/LYVZrNond/S78mBnk+zJ/qob05A1X+1C74AG+ 4PAX7JDEkD9S2HTj4vCyPpc2q5r2nO2etXKn0SHKaXN24t/ZKX6M40KZZrKvvYQ0GeA+ gNk7UjPCdXdmZdB3a37EW7ihw1SKfJoshPL3H/yvh122pLPjDryv4SsbyM7OeApgJ4dw H/6k5ZH4CO45G5UtwhZyp9cL1bznwhMyaspuelOZ8w53FcrnUmARo4yHSvtzXmBl14yG QBNCls9TUi1CNmx5G/iEL2LmcQ568PsAA4GUr9qSgRQc/3KBvw/DMIUemtTLilRk1/bY gerw== 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=McT3YhLMzFeCMh7Sxyspw9RMCy+0gY6OkiCRHtLLlRc=; b=zR+nMKShv2/YdoS4WzQqmc/wWJGhPkCAa/kl2y4gqYeWMSrpBwCiYKJkaDxxj1PB/z RsH1h1+GIQEtBTRW4HxE04Z+SxumOkDjGnzQlrdShFaj6xfTsvTb1cwFhGi7y9nyE3BC k4RmWuBYGFQbsbGDIHmQdEade0Me1NgPPPWhJj+V4824rVglt7GsTesQWumtRs2t1dOR 0OdddS5iSO26NFrQnwWwK3J7WANCPPJlTNx1JFWvg7xhwVs6zpMSr5oJRX4lnflgXf28 qzd61iN3uUR87aw9A1bklbZkMyI64LVjcXebTVromJ7tksOuCsRTnrB1X0iPd+Lq/lq9 uoWQ== 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 gr18si2375883ejb.201.2020.11.05.17.57.46; Thu, 05 Nov 2020 17:58:08 -0800 (PST) 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 S1732603AbgKFB4Y (ORCPT + 99 others); Thu, 5 Nov 2020 20:56:24 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:7149 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730414AbgKFB4X (ORCPT ); Thu, 5 Nov 2020 20:56:23 -0500 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4CS3QT1NFcz15QQg; Fri, 6 Nov 2020 09:56:17 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.487.0; Fri, 6 Nov 2020 09:56:19 +0800 From: Tian Tao To: , , , , Subject: [PATCH] mmc: dw_mmc: replace spin_lock_irqsave by spin_lock in hard IRQ Date: Fri, 6 Nov 2020 09:56:53 +0800 Message-ID: <1604627813-59785-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/mmc/host/dw_mmc.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 43c5795..a524443 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -2617,7 +2617,6 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id) struct dw_mci *host = dev_id; u32 pending; struct dw_mci_slot *slot = host->slot; - unsigned long irqflags; pending = mci_readl(host, MINTSTS); /* read-only mask reg */ @@ -2632,15 +2631,15 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id) * Hold the lock; we know cmd11_timer can't be kicked * off after the lock is released, so safe to delete. */ - spin_lock_irqsave(&host->irq_lock, irqflags); + spin_lock(&host->irq_lock); dw_mci_cmd_interrupt(host, pending); - spin_unlock_irqrestore(&host->irq_lock, irqflags); + spin_unlock(&host->irq_lock); del_timer(&host->cmd11_timer); } if (pending & DW_MCI_CMD_ERROR_FLAGS) { - spin_lock_irqsave(&host->irq_lock, irqflags); + spin_lock(&host->irq_lock); del_timer(&host->cto_timer); mci_writel(host, RINTSTS, DW_MCI_CMD_ERROR_FLAGS); @@ -2648,7 +2647,7 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id) smp_wmb(); /* drain writebuffer */ set_bit(EVENT_CMD_COMPLETE, &host->pending_events); - spin_unlock_irqrestore(&host->irq_lock, irqflags); + spin_unlock(&host->irq_lock); } if (pending & DW_MCI_DATA_ERROR_FLAGS) { @@ -2661,7 +2660,7 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id) } if (pending & SDMMC_INT_DATA_OVER) { - spin_lock_irqsave(&host->irq_lock, irqflags); + spin_lock(&host->irq_lock); del_timer(&host->dto_timer); @@ -2676,7 +2675,7 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id) set_bit(EVENT_DATA_COMPLETE, &host->pending_events); tasklet_schedule(&host->tasklet); - spin_unlock_irqrestore(&host->irq_lock, irqflags); + spin_unlock(&host->irq_lock); } if (pending & SDMMC_INT_RXDR) { @@ -2692,12 +2691,12 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id) } if (pending & SDMMC_INT_CMD_DONE) { - spin_lock_irqsave(&host->irq_lock, irqflags); + spin_lock(&host->irq_lock); mci_writel(host, RINTSTS, SDMMC_INT_CMD_DONE); dw_mci_cmd_interrupt(host, pending); - spin_unlock_irqrestore(&host->irq_lock, irqflags); + spin_unlock(&host->irq_lock); } if (pending & SDMMC_INT_CD) { -- 2.7.4