From patchwork Thu Apr 10 13:01:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 28185 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f197.google.com (mail-ig0-f197.google.com [209.85.213.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4C876212DC for ; Thu, 10 Apr 2014 13:01:40 +0000 (UTC) Received: by mail-ig0-f197.google.com with SMTP id hn18sf10425277igb.4 for ; Thu, 10 Apr 2014 06:01:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=Y/Y8QuRS+QRgqgRu/ibs+UxdoL5H+IeCxRzPBwbHLw0=; b=enIzM0DNF1rTpWkQ+WDuGcjMg7tnVN5ssOzuTj7Y/O6GK1/lbNJlwgedPJXTqYg2gf eOoeHeF7Dkocw2JmyqfpxCwl9I1MpektKdfXZT+hr240eMDkBNJmxQFe09p9nPlyK6fS 9A7k2ws/0zlPAVyDOfTMHs+TPoWp2x7pJU1mnSfLDik2yTcsXo/8g4Y4C7ThtKH0/6ix BrSsUb4kttrG/TUf5fWiq1xYnGFJjE1wA/mSvjY3Gul4gcbGmGTVXOj3IyK3DlA9TjbK dHpaO8PBcvOn7qWS3+dhvr+lbTN/K0UY5+qSDe+Zccnn7EPUvSaT8pSgkJFE7zuMWsrD pBJg== X-Gm-Message-State: ALoCoQnz5cRXUm/wfSRKcYxe70NSIqg1hFJuWOOx2wkRxMYf8BlZnR74lgwUeN/QqEMu8+GNuruc X-Received: by 10.42.85.142 with SMTP id q14mr7510146icl.11.1397134899626; Thu, 10 Apr 2014 06:01:39 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.90.11 with SMTP id w11ls1102055qgd.43.gmail; Thu, 10 Apr 2014 06:01:39 -0700 (PDT) X-Received: by 10.52.120.6 with SMTP id ky6mr34623vdb.38.1397134899502; Thu, 10 Apr 2014 06:01:39 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id i7si673938vei.193.2014.04.10.06.01.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 10 Apr 2014 06:01:39 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.177; Received: by mail-vc0-f177.google.com with SMTP id if17so3278253vcb.22 for ; Thu, 10 Apr 2014 06:01:39 -0700 (PDT) X-Received: by 10.220.162.6 with SMTP id t6mr14633320vcx.12.1397134899428; Thu, 10 Apr 2014 06:01:39 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp57313vcb; Thu, 10 Apr 2014 06:01:39 -0700 (PDT) X-Received: by 10.14.221.1 with SMTP id q1mr20728683eep.24.1397134898567; Thu, 10 Apr 2014 06:01:38 -0700 (PDT) Received: from mail-we0-f174.google.com (mail-we0-f174.google.com [74.125.82.174]) by mx.google.com with ESMTPS id bi1si2670133wib.48.2014.04.10.06.01.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 10 Apr 2014 06:01:38 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.174 is neither permitted nor denied by best guess record for domain of ulf.hansson@linaro.org) client-ip=74.125.82.174; Received: by mail-we0-f174.google.com with SMTP id t60so3900934wes.19 for ; Thu, 10 Apr 2014 06:01:38 -0700 (PDT) X-Received: by 10.194.192.132 with SMTP id hg4mr15150362wjc.28.1397134897959; Thu, 10 Apr 2014 06:01:37 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id lb4sm6500371wjb.14.2014.04.10.06.01.36 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 10 Apr 2014 06:01:37 -0700 (PDT) From: Ulf Hansson To: linux-arm-kernel@lists.infradead.org, Russell King Cc: Linus Walleij , Kevin Hilman , Daniel Lezcano , Ulf Hansson Subject: [PATCH 1/3] mmc: mmci: Mask IRQs for all variants during runtime suspend Date: Thu, 10 Apr 2014 15:01:30 +0200 Message-Id: <1397134892-20840-2-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1397134892-20840-1-git-send-email-ulf.hansson@linaro.org> References: <1397134892-20840-1-git-send-email-ulf.hansson@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ulf.hansson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , In runtime suspended state, we are not expecting IRQs and thus we can safely mask them, not only for pwrreg_nopower variants but for all. Obviously we then also need to make sure we restore the IRQ mask while becoming runtime resumed. Cc: Russell King Signed-off-by: Ulf Hansson --- drivers/mmc/host/mmci.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 771c60a..0f10e3c 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -1794,35 +1794,34 @@ static void mmci_save(struct mmci_host *host) { unsigned long flags; - if (host->variant->pwrreg_nopower) { - spin_lock_irqsave(&host->lock, flags); + spin_lock_irqsave(&host->lock, flags); - writel(0, host->base + MMCIMASK0); + writel(0, host->base + MMCIMASK0); + if (host->variant->pwrreg_nopower) { writel(0, host->base + MMCIDATACTRL); writel(0, host->base + MMCIPOWER); writel(0, host->base + MMCICLOCK); - mmci_reg_delay(host); - - spin_unlock_irqrestore(&host->lock, flags); } + mmci_reg_delay(host); + spin_unlock_irqrestore(&host->lock, flags); } static void mmci_restore(struct mmci_host *host) { unsigned long flags; - if (host->variant->pwrreg_nopower) { - spin_lock_irqsave(&host->lock, flags); + spin_lock_irqsave(&host->lock, flags); + if (host->variant->pwrreg_nopower) { writel(host->clk_reg, host->base + MMCICLOCK); writel(host->datactrl_reg, host->base + MMCIDATACTRL); writel(host->pwr_reg, host->base + MMCIPOWER); - writel(MCI_IRQENABLE, host->base + MMCIMASK0); - mmci_reg_delay(host); - - spin_unlock_irqrestore(&host->lock, flags); } + writel(MCI_IRQENABLE, host->base + MMCIMASK0); + mmci_reg_delay(host); + + spin_unlock_irqrestore(&host->lock, flags); } static int mmci_runtime_suspend(struct device *dev)