From patchwork Tue Feb 7 21:34:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9561223 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C1C9060547 for ; Tue, 7 Feb 2017 21:37:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B495228485 for ; Tue, 7 Feb 2017 21:37:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A97DB28490; Tue, 7 Feb 2017 21:37:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 767EF28485 for ; Tue, 7 Feb 2017 21:37:50 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cbDSL-0003cu-3o; Tue, 07 Feb 2017 21:37:45 +0000 Received: from mail-wm0-f65.google.com ([74.125.82.65]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cbDSF-0003Q2-GA for linux-amlogic@lists.infradead.org; Tue, 07 Feb 2017 21:37:42 +0000 Received: by mail-wm0-f65.google.com with SMTP id u63so30703556wmu.2 for ; Tue, 07 Feb 2017 13:37:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:references:cc:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=PO8lbMgZdKwbDTxiU+HFer0GRUHfh/rEXWxMCfwVuxs=; b=f8A6K01y6Lp+Cy65yUsBNrwnwvwc1wVfiK/UROhbGuO+KY5J3TiEeL96ZagUb+ebud KvcTn0i1dHWhdMYcW4+jrZ4GWiA8/17DcSURwERfdtJgKAfqsxUvBdLTlefuOs5Z7zs9 AnQ6o0sf6WBu5/lVIDnNvledVuzpX09Upf68vKhqe2IA5/5/0s2imXtfVMIfoHOq0AoV 3cBzUErcpga70WSP7LgkwgyFjIFCdruhVFcXaeDoQGIeb4uBsWeloYseQzOCLoJOqvX+ H26hSa+/0uFPidq0DlcLmqt4vCKSOZHdbJ0eBBTPLyBtGdq9SdRWqltJnQe8PFLvsTnZ ntpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:references:cc:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=PO8lbMgZdKwbDTxiU+HFer0GRUHfh/rEXWxMCfwVuxs=; b=V8dBtNGcdT21KNXZBaeoYlgRS1wXHXSf4YpKFSUJRJIFkdg7SECMqDVFlv4flpVqUF TUq2RkEhwO8+aC17tSUXE03Z+R7GoGlzLCzoQrJL1nPfSdr0NJoyH+vGaMi+Y8E9zH6N pwbhgRHOF4CqURQjR8drAzKpkNjM95tJMjW+y41p6ZQsD+OasBKfOMw+TSwJhNKdWoa3 ieTG7NUP1XV/Hc/0X5Sy1i8fijnYjpMwXPKp24WZcuCH+Nhv9W+E8b1g1zOAKNCM4wAx Mkj0eWH66QhDokYvfJtA3nIwGz2yJUkfqq7UUG5lY1MWETYrJ0NQR/NE4/4Svs35nuHr oTzQ== X-Gm-Message-State: AMke39kPTBPQ7XmRaf6/ruSw0GQuws+fhqBKRmy9gsqlCVTG1ZlpEUPCR81rxQoKvGJpSg== X-Received: by 10.28.17.133 with SMTP id 127mr14160211wmr.80.1486503377883; Tue, 07 Feb 2017 13:36:17 -0800 (PST) Received: from ?IPv6:2003:c6:ebce:1e00:cd3f:c3c7:98c5:4fec? (p200300C6EBCE1E00CD3FC3C798C54FEC.dip0.t-ipconnect.de. [2003:c6:ebce:1e00:cd3f:c3c7:98c5:4fec]) by smtp.googlemail.com with ESMTPSA id w204sm657959wmd.17.2017.02.07.13.36.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Feb 2017 13:36:17 -0800 (PST) From: Heiner Kallweit Subject: [PATCH v3 5/9] mmc: meson-gx: improve interrupt handling To: Ulf Hansson , Kevin Hilman References: <0991d40b-e05b-2fcb-9ee4-7b529448de69@gmail.com> Message-ID: Date: Tue, 7 Feb 2017 22:34:51 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <0991d40b-e05b-2fcb-9ee4-7b529448de69@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170207_133739_793096_3C9A78EA X-CRM114-Status: UNSURE ( 8.68 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Carlo Caione , linux-amlogic@lists.infradead.org, "linux-mmc@vger.kernel.org" Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Disabling and immediately re-enabling interrupts in meson_mmc_request doesn't provide a benefit. Instead enable interrupts in probe already. And disable interrupts in remove, this was missing so far. Signed-off-by: Heiner Kallweit Reviewed-by: Kevin Hilman --- v3: - in probe leave the original behavior to first disable all irqs and then clear irq status bits --- drivers/mmc/host/meson-gx-mmc.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c index dd7f936c..4c622ad2 100644 --- a/drivers/mmc/host/meson-gx-mmc.c +++ b/drivers/mmc/host/meson-gx-mmc.c @@ -542,11 +542,6 @@ static void meson_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq) /* Stop execution */ writel(0, host->regs + SD_EMMC_START); - /* clear, ack, enable all interrupts */ - writel(0, host->regs + SD_EMMC_IRQ_EN); - writel(IRQ_EN_MASK, host->regs + SD_EMMC_STATUS); - writel(IRQ_EN_MASK, host->regs + SD_EMMC_IRQ_EN); - host->mrq = mrq; if (mrq->sbc) @@ -775,6 +770,7 @@ static int meson_mmc_probe(struct platform_device *pdev) /* clear, ack, enable all interrupts */ writel(0, host->regs + SD_EMMC_IRQ_EN); writel(IRQ_EN_MASK, host->regs + SD_EMMC_STATUS); + writel(IRQ_EN_MASK, host->regs + SD_EMMC_IRQ_EN); ret = devm_request_threaded_irq(&pdev->dev, host->irq, meson_mmc_irq, meson_mmc_irq_thread, @@ -812,6 +808,9 @@ static int meson_mmc_remove(struct platform_device *pdev) if (WARN_ON(!host)) return 0; + /* disable interrupts */ + writel(0, host->regs + SD_EMMC_IRQ_EN); + if (host->bounce_buf) dma_free_coherent(host->dev, host->bounce_buf_size, host->bounce_buf, host->bounce_dma_addr);