From patchwork Tue Feb 4 15:58:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 3577641 Return-Path: X-Original-To: patchwork-linux-spi@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 71295C02DC for ; Tue, 4 Feb 2014 16:05:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9D672201B4 for ; Tue, 4 Feb 2014 16:05:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B372520170 for ; Tue, 4 Feb 2014 16:05:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754840AbaBDQEm (ORCPT ); Tue, 4 Feb 2014 11:04:42 -0500 Received: from mail-la0-f45.google.com ([209.85.215.45]:43490 "EHLO mail-la0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754620AbaBDP71 (ORCPT ); Tue, 4 Feb 2014 10:59:27 -0500 Received: by mail-la0-f45.google.com with SMTP id b8so6733606lan.32 for ; Tue, 04 Feb 2014 07:59:25 -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=ItiBobyI5BjZXWyLs78VnLRZTVHg9C0Co7Mp4B5U9nygJmW0pmI7mJsuzI2bCDN92r grwUdE6uqtEVf5Qo+N23tx8XpEBu0gJe7igcNB4EOKu/fm5oIz14WxnZq96G3cuRILUY fzgnM7iK6YCAtsDYvmoE/vvE1GwMQDbthWBMIpVpjTSiLRsRMA9zNi9qabHaxP1C1faz 5ymfAW6bX/tnCZZjRtsFRMt2cYW6JWGA7NnoZ6/7FjYkKGqCKJwwG6y9gO+aVj9uANOM HjJp4cJJnKyNYPpWjXpp9XaJ/DOSGDUfWpCJ/3FcpaG0yddCH9dGznoPMDCD0QvpstQx ePfQ== X-Gm-Message-State: ALoCoQnbBp4Dpws6J+u1PXeOFvjK7LsZyn9fJ3rVK6fPXySCqABDBDagfJvPkOZHyTR6xQgDBsnB X-Received: by 10.112.173.6 with SMTP id bg6mr17542658lbc.17.1391529565884; Tue, 04 Feb 2014 07:59:25 -0800 (PST) Received: from localhost.localdomain (host-95-199-220-119.mobileonline.telia.com. [95.199.220.119]) by mx.google.com with ESMTPSA id dm8sm35906603lad.7.2014.02.04.07.59.23 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Feb 2014 07:59:25 -0800 (PST) From: Ulf Hansson To: Russell King , linux-arm-kernel@lists.infradead.org Cc: Alessandro Rubini , Linus Walleij , Wolfram Sang , Chris Ball , Mark Brown , linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-spi@vger.kernel.org, linux-mmc@vger.kernel.org, Ulf Hansson Subject: [PATCH 03/17] mmc: mmci: Mask IRQs for all variants during runtime suspend Date: Tue, 4 Feb 2014 16:58:44 +0100 Message-Id: <1391529538-21685-4-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1391529538-21685-1-git-send-email-ulf.hansson@linaro.org> References: <1391529538-21685-1-git-send-email-ulf.hansson@linaro.org> Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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)