Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752379AbdLUI6Q (ORCPT ); Thu, 21 Dec 2017 03:58:16 -0500 Received: from mga14.intel.com ([192.55.52.115]:45422 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751525AbdLUI6P (ORCPT ); Thu, 21 Dec 2017 03:58:15 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,435,1508828400"; d="scan'208";a="15440907" Subject: Re: [PATCH 01/12] mmc: sdhci-omap: Update 'power_mode' outside sdhci_omap_init_74_clocks To: Kishon Vijay Abraham I , Ulf Hansson , Rob Herring , Tony Lindgren Cc: Mark Rutland , Russell King , linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, nsekhar@ti.com References: <20171214130941.26666-1-kishon@ti.com> <20171214130941.26666-2-kishon@ti.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: Thu, 21 Dec 2017 10:57:46 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20171214130941.26666-2-kishon@ti.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2163 Lines: 60 On 14/12/17 15:09, Kishon Vijay Abraham I wrote: > Updating 'power_mode' in sdhci_omap_init_74_clocks results in > 'power_mode' never updated to MMC_POWER_OFF during card > removal. This results in initialization sequence not sent to the > card during re-insertion. > Fix it here by adding sdhci_omap_set_power_mode to update power_mode. > This function can also be used later to perform operations that > are specific to a power mode (e.g, disable tuning during power off). > > Signed-off-by: Kishon Vijay Abraham I Acked-by: Adrian Hunter > --- > drivers/mmc/host/sdhci-omap.c | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c > index 628bfe9a3d17..96985786cadf 100644 > --- a/drivers/mmc/host/sdhci-omap.c > +++ b/drivers/mmc/host/sdhci-omap.c > @@ -244,6 +244,12 @@ static int sdhci_omap_start_signal_voltage_switch(struct mmc_host *mmc, > return 0; > } > > +static void sdhci_omap_set_power_mode(struct sdhci_omap_host *omap_host, > + u8 power_mode) > +{ > + omap_host->power_mode = power_mode; > +} > + > static void sdhci_omap_set_bus_mode(struct sdhci_omap_host *omap_host, > unsigned int mode) > { > @@ -273,6 +279,7 @@ static void sdhci_omap_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) > > sdhci_omap_set_bus_mode(omap_host, ios->bus_mode); > sdhci_set_ios(mmc, ios); > + sdhci_omap_set_power_mode(omap_host, ios->power_mode); > } > > static u16 sdhci_omap_calc_divisor(struct sdhci_pltfm_host *host, > @@ -401,8 +408,6 @@ static void sdhci_omap_init_74_clocks(struct sdhci_host *host, u8 power_mode) > sdhci_omap_writel(omap_host, SDHCI_OMAP_STAT, INT_CC_EN); > > enable_irq(host->irq); > - > - omap_host->power_mode = power_mode; > } > > static struct sdhci_ops sdhci_omap_ops = { > @@ -504,6 +509,7 @@ static int sdhci_omap_probe(struct platform_device *pdev) > omap_host->host = host; > omap_host->base = host->ioaddr; > omap_host->dev = dev; > + omap_host->power_mode = MMC_POWER_UNDEFINED; > host->ioaddr += offset; > > mmc = host->mmc; >