Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp158530imm; Mon, 14 May 2018 23:02:56 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp1INx3GEgyPmN/Hld2xtDP+7C5gXFe7dWdwi7DesUS1C/efLrymv69a6HFtbH/t+JMdull X-Received: by 2002:a62:8785:: with SMTP id i127-v6mr13760952pfe.201.1526364176815; Mon, 14 May 2018 23:02:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526364176; cv=none; d=google.com; s=arc-20160816; b=iyEjkmg86Liv5CcbQV30Dr8b9bI40SzBLpJUg5SD+kCuvi7jZ9p3nbmWUd/Xb210QH jXx/C1hyxsUvXCFoZDCgwGx6hRlC11HdHyzKO/TjziDl80mGeaeuCmQPzS7ohEyVuv8S V/TaSfQQCUnmukLxUp94GJtg80sLFVcbRiv852PO+EBp78P3JsHVSJruKZGPNArUu34j gMTSUeFqZsg5VFlX7+Sbq8qNuscD+2jWmF2Nf+PqOdstkUL3AgSXHbXvzw+5pJj+Mdon Z+S3y0wZ8GTsUw+p1GzWLVjQrj745WUYSrr35M7mFUpS0t8aw5hCUt5OCXLztZDugq10 6CWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :arc-authentication-results; bh=pKMriApfyOyVIbgjLjkiZx0ieBjNPJyCF0yX4hi8WzI=; b=YJE0h0wUjFnn1INKHPskowfg465o6RN/8L/q6HqR15Y5knCFGOmK5kSH8SE5WjZ9Ys zdd1vYOV3n7Yj4YE6W/v/gKADgK8abV7qFaLixgnMDmpuNhep6ULeFacXrWfBzDnTi/E BT75+y9KbHLX3JoatjXqtsd8EQm8Ur61dXss4vpWhneFiiJ/jHK9r1VYsJR0lFDIwUIP eLf9eDgKWseIj65TvquMrjQEftdVpea49SloXEIv1YQaQMT3Xt97nGEL4eKnJ5qQJiYn ziuKybTyOg2V9HaLulnCO7E8QTjDT8zXIR07k8EWpJd02ZEHugOr5iVHLFzUYy32YDf0 YZBg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n125-v6si11576447pfn.352.2018.05.14.23.02.42; Mon, 14 May 2018 23:02:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752358AbeEOGAn (ORCPT + 99 others); Tue, 15 May 2018 02:00:43 -0400 Received: from mga06.intel.com ([134.134.136.31]:21976 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752256AbeEOGAl (ORCPT ); Tue, 15 May 2018 02:00:41 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 May 2018 23:00:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,402,1520924400"; d="scan'208";a="199425542" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.168]) ([10.237.72.168]) by orsmga004.jf.intel.com with ESMTP; 14 May 2018 23:00:39 -0700 Subject: Re: [PATCH] mmc: sdhci-pxav3: don't disable clocks when we might get an interrupt To: Thomas Hebb , linux-kernel@vger.kernel.org Cc: Ulf Hansson , "open list:SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI...)" References: <20180514215645.17592-1-tommyhebb@gmail.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: Date: Tue, 15 May 2018 08:59:30 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180514215645.17592-1-tommyhebb@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15/05/18 00:56, Thomas Hebb wrote: > Currently, runtime_suspend() unconditionally disables the clock gates > for the controller, which means that it's unable to receive interrupts > generated by connected SDIO cards. We currently get / put runtime pm with enable / disable of the SDIO IRQ (refer sdhci_enable_sdio_irq()) so are you sure this is needed? > > Signed-off-by: Thomas Hebb > --- > drivers/mmc/host/sdhci-pxav3.c | 16 ++++++++++------ > 1 file changed, 10 insertions(+), 6 deletions(-) > > diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c > index a34434166ca7..59760f3cc1d7 100644 > --- a/drivers/mmc/host/sdhci-pxav3.c > +++ b/drivers/mmc/host/sdhci-pxav3.c > @@ -562,9 +562,11 @@ static int sdhci_pxav3_runtime_suspend(struct device *dev) > if (host->tuning_mode != SDHCI_TUNING_MODE_3) > mmc_retune_needed(host->mmc); > > - clk_disable_unprepare(pxa->clk_io); > - if (!IS_ERR(pxa->clk_core)) > - clk_disable_unprepare(pxa->clk_core); > + if (!sdhci_sdio_irq_enabled(host)) { > + clk_disable_unprepare(pxa->clk_io); > + if (!IS_ERR(pxa->clk_core)) > + clk_disable_unprepare(pxa->clk_core); > + } > > return 0; > } > @@ -575,9 +577,11 @@ static int sdhci_pxav3_runtime_resume(struct device *dev) > struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); > struct sdhci_pxa *pxa = sdhci_pltfm_priv(pltfm_host); > > - clk_prepare_enable(pxa->clk_io); > - if (!IS_ERR(pxa->clk_core)) > - clk_prepare_enable(pxa->clk_core); > + if (!sdhci_sdio_irq_enabled(host)) { > + clk_prepare_enable(pxa->clk_io); > + if (!IS_ERR(pxa->clk_core)) > + clk_prepare_enable(pxa->clk_core); > + } > > return sdhci_runtime_resume_host(host); > } >