Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752706AbbKZQHX (ORCPT ); Thu, 26 Nov 2015 11:07:23 -0500 Received: from eusmtp01.atmel.com ([212.144.249.242]:10067 "EHLO eusmtp01.atmel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751270AbbKZQHU (ORCPT ); Thu, 26 Nov 2015 11:07:20 -0500 Date: Thu, 26 Nov 2015 17:07:18 +0100 From: Ludovic Desroches To: Ulf Hansson CC: Ludovic Desroches , linux-mmc , "linux-kernel@vger.kernel.org" , Nicolas Ferre , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH v2] mmc: sdhci at91: add PM support Message-ID: <20151126160718.GE8908@odux.rfo.atmel.com> Mail-Followup-To: Ulf Hansson , linux-mmc , "linux-kernel@vger.kernel.org" , Nicolas Ferre , "linux-arm-kernel@lists.infradead.org" References: <1447151810-21864-1-git-send-email-ludovic.desroches@atmel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1706 Lines: 49 On Tue, Nov 10, 2015 at 12:12:30PM +0100, Ulf Hansson wrote: > On 10 November 2015 at 11:36, Ludovic Desroches > wrote: > > Add runtime PM support and use runtime_force_suspend|resume() for system > > PM. > > [...] > > static int sdhci_at91_probe(struct platform_device *pdev) > > { > > const struct of_device_id *match; > > @@ -148,6 +206,11 @@ static int sdhci_at91_probe(struct platform_device *pdev) > > if (ret) > > goto clocks_disable_unprepare; > > > > + pm_runtime_set_active(&pdev->dev); > > + pm_runtime_enable(&pdev->dev); > > + pm_runtime_set_autosuspend_delay(&pdev->dev, 50); > > + pm_runtime_use_autosuspend(&pdev->dev); > > Move these four runtime PM calls above sdhci_add_host(), as after that > point the host is used and thus runtime PM operations starts. Sadly I have discovered a bit late it is not working when doing this because the controller has been suspended before doing the sdhci_add_host(). What is the right way to fix it? Calling pm_runtime_get_noresume() before sdhci_add_host() and calling pm_runtime_put_autosuspend() after? > > > + > > return 0; > > > > clocks_disable_unprepare: > > @@ -165,6 +228,7 @@ static int sdhci_at91_remove(struct platform_device *pdev) > > struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); > > struct sdhci_at91_priv *priv = pltfm_host->priv; > > Regards Ludovic -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/