From patchwork Sat Mar 1 10:56:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 3746791 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8C4CEBF13A for ; Sat, 1 Mar 2014 11:00:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B18A920328 for ; Sat, 1 Mar 2014 11:00:29 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AEE2A20259 for ; Sat, 1 Mar 2014 11:00:28 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WJhcJ-0006TV-KY; Sat, 01 Mar 2014 10:58:05 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WJhbm-0007XV-Le; Sat, 01 Mar 2014 10:57:30 +0000 Received: from mail-lb0-f177.google.com ([209.85.217.177]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WJhbC-0007Qh-I5 for linux-arm-kernel@lists.infradead.org; Sat, 01 Mar 2014 10:56:55 +0000 Received: by mail-lb0-f177.google.com with SMTP id z11so3352658lbi.8 for ; Sat, 01 Mar 2014 02:56:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qye4Q2MNVzyCwKWVfvdlt7B5QfmU4KPvw/097sbewXE=; b=Q5zVRSuXgzVArI2nedrEr2czWwZ80ATWIwJ+X94hTQLz27HwGb6oWcC+hXi8dMqbes 2lA+ki2Fr8SwCXL4QoypsEYltX63U9xaNyW3qEFphfBBDoklK6MWeW73w041MIqaZr2a cu5z+WXa10lrULus/Mg57wctdapTbBl+tIBJSST/DZ838kkpAt489esIecKkWss6NRkd tfJiqh9esH+6WdCtTHbvn6oQEMvHUsjDHO8i9i3qfMXKyiDVIFzwddNic3zVvNcLUp8/ LPhKe7Wg7snSY3dmw/VPW0blRZ+QcPDHJZB8ROE1VgjYFz+QxwQpEj1jAz51wugmd6pQ 7urg== X-Gm-Message-State: ALoCoQluvB2w3R9eCW2uWcoUNyUBhysPGsxhJSyqyFSILdyestQyK9c5/SRHlGKcTscrCtRBWNke X-Received: by 10.153.7.137 with SMTP id dc9mr15427944lad.25.1393671391406; Sat, 01 Mar 2014 02:56:31 -0800 (PST) Received: from linaro-ulf.lan (90-231-160-185-no158.tbcn.telia.com. [90.231.160.185]) by mx.google.com with ESMTPSA id qf1sm4532484lbc.8.2014.03.01.02.56.29 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 01 Mar 2014 02:56:30 -0800 (PST) From: Ulf Hansson To: "Rafael J. Wysocki" , Len Brown , Pavel Machek , linux-pm@vger.kernel.org Subject: [PATCH 6/8] mmc: mmci: Mask IRQs for all variants during runtime suspend Date: Sat, 1 Mar 2014 11:56:09 +0100 Message-Id: <1393671371-2398-7-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1393671371-2398-1-git-send-email-ulf.hansson@linaro.org> References: <1393671371-2398-1-git-send-email-ulf.hansson@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140301_055654_806700_38E5BA2C X-CRM114-Status: UNSURE ( 9.64 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.5 (/) Cc: Ulf Hansson , Kevin Hilman , Russell King , Wolfram Sang , Greg Kroah-Hartman , Linus Walleij , Mark Brown , Alan Stern , Josh Cartwright , linux-arm-kernel@lists.infradead.org, Alessandro Rubini X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,KHOP_BIG_TO_CC, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 b931226..178868a 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -1758,35 +1758,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)