From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933281AbcH2OUa (ORCPT ); Mon, 29 Aug 2016 10:20:30 -0400 Received: from mail-wm0-f42.google.com ([74.125.82.42]:36632 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757379AbcH2OU2 (ORCPT ); Mon, 29 Aug 2016 10:20:28 -0400 MIME-Version: 1.0 In-Reply-To: <1466080509-24015-1-git-send-email-pramod.gurav@linaro.org> References: <1466080509-24015-1-git-send-email-pramod.gurav@linaro.org> From: Ulf Hansson Date: Mon, 29 Aug 2016 16:20:25 +0200 Message-ID: Subject: Re: [PATCH] mmc: sdhci-msm: Add pm_runtime and system PM support To: Pramod Gurav Cc: Adrian Hunter , linux-mmc , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16 June 2016 at 14:35, Pramod Gurav wrote: > Provides runtime PM callbacks to enable and disable clock resources > when idle. Also support system PM callbacks to be called during system > suspend and resume. > > Signed-off-by: Pramod Gurav > --- > drivers/mmc/host/sdhci-msm.c | 57 ++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 57 insertions(+) > > diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c > index 0653fe7..f4394c8 100644 > --- a/drivers/mmc/host/sdhci-msm.c > +++ b/drivers/mmc/host/sdhci-msm.c > @@ -18,6 +18,7 @@ > #include > #include > #include > +#include > #include > > #include "sdhci-pltfm.h" > @@ -549,6 +550,11 @@ static int sdhci_msm_probe(struct platform_device *pdev) > if (ret) > goto clk_disable; > > + platform_set_drvdata(pdev, msm_host); > + > + pm_runtime_set_active(&pdev->dev); > + pm_runtime_enable(&pdev->dev); I think you need to move these a bit earlier, before calling sdhci_add_host(). Maybe it's just easier if you look at the sdhci-of-at91.c driver, which behaves nicely around runtime PM deployment. You can probably use the very similar code, except the ->runtime_suspend|resume() callbacks. And don't forget to deploy runtime PM support in the ->remove() callback as well, again sdhci-of-at91 is a good reference. [...] Kind regards Uffe