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: 9561245 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 E15836047A for ; Tue, 7 Feb 2017 21:43:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D3AD42521E for ; Tue, 7 Feb 2017 21:43:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C843128490; Tue, 7 Feb 2017 21:43:30 +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=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 668092521E for ; Tue, 7 Feb 2017 21:43:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932379AbdBGVn3 (ORCPT ); Tue, 7 Feb 2017 16:43:29 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:34851 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932313AbdBGVn2 (ORCPT ); Tue, 7 Feb 2017 16:43:28 -0500 Received: by mail-wm0-f66.google.com with SMTP id u63so30732630wmu.2 for ; Tue, 07 Feb 2017 13:43:28 -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=ukYJzTo1dqA10mn9eiYM/MK2Q9WJHDsq6QoUaALRwt3Cc6N68AzuyovgsElX5Q1+H4 Y5XtROdPcOVH9rDoCfmcBkxEJmDGcTLoKvPpU2Jgxh6KKIDSS5XY7AHmGEITYnKPnJzv 1H181kM1/3dq5b+xIwagLVu5LQWAu/Ga2zcc05opESuOIVTUTzF0fPh3mYnHySX7VIfC lENVef1tKoS+jFhxld6b3bySRv4O0e4q02Qq1348qOgtRdhzE9KkzYL2wecKTsKRk2hS 0mUaRonpm+P0BP7Pzvm8HM9zOFFmPzSBExxn2BQ1S4G5lbiEfStNLzvc0OOczpiocdIS 0C3w== X-Gm-Message-State: AMke39nNavNg91odU2o/qkKCvN39yGfdksZh3CL/teZmyKh0QAX4sw53tqka43t32NhZEA== 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> Cc: Carlo Caione , "linux-mmc@vger.kernel.org" , linux-amlogic@lists.infradead.org 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> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.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);