diff mbox

MMC: tmio: fix a recent regression: restore .set_ios(MMC_POWER_UP) handling

Message ID Pine.LNX.4.64.1104210903250.6893@axis700.grange (mailing list archive)
State Superseded
Headers show

Commit Message

Guennadi Liakhovetski April 21, 2011, 7:09 a.m. UTC
The aggressive clock gating for TMIO MMC patch has broken switching
interface power on, using MFD or platform callbacks. Restore the
ios->power_mode == MMC_POWER_UP && ios->clock == 0 case handling.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---

This one should go in 2.6.39

 drivers/mmc/host/tmio_mmc_pio.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

Comments

Chris Ball April 21, 2011, 3:35 p.m. UTC | #1
Hi,

On Thu, Apr 21 2011, Guennadi Liakhovetski wrote:
> The aggressive clock gating for TMIO MMC patch has broken switching
> interface power on, using MFD or platform callbacks. Restore the
> ios->power_mode == MMC_POWER_UP && ios->clock == 0 case handling.
>
> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> ---
>
> This one should go in 2.6.39
>
>  drivers/mmc/host/tmio_mmc_pio.c |   10 +++++-----
>  1 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
> index 6e3271d..f4fac9f 100644
> --- a/drivers/mmc/host/tmio_mmc_pio.c
> +++ b/drivers/mmc/host/tmio_mmc_pio.c
> @@ -772,15 +772,15 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>  		tmio_mmc_set_clock(host, ios->clock);
>  
>  	/* Power sequence - OFF -> UP -> ON */
> -	if (ios->power_mode == MMC_POWER_OFF || !ios->clock) {
> +	if (ios->power_mode == MMC_POWER_UP) {
> +		/* power up SD bus */
> +		if (host->set_pwr)
> +			host->set_pwr(host->pdev, 1);
> +	} else if (ios->power_mode == MMC_POWER_OFF || !ios->clock) {
>  		/* power down SD bus */
>  		if (ios->power_mode == MMC_POWER_OFF && host->set_pwr)
>  			host->set_pwr(host->pdev, 0);
>  		tmio_mmc_clk_stop(host);
> -	} else if (ios->power_mode == MMC_POWER_UP) {
> -		/* power up SD bus */
> -		if (host->set_pwr)
> -			host->set_pwr(host->pdev, 1);
>  	} else {
>  		/* start bus clock */
>  		tmio_mmc_clk_start(host);

Thanks, pushed to mmc-next for .39.

Paul Parsons (CC'd) submitted a similar patch to fix the same regression.
Paul, please could you check that Guennadi's patch fixes your problem?

- Chris.
Paul Parsons April 22, 2011, 4:24 a.m. UTC | #2
Yes, Guennadi's patch fixes my problem.

As far as I can see the expression

(ios->clock == 0 && ios->power_mode == MMC_POWER_ON)

will only be true if host->f_init == 0 at the time MMC_POWER_ON is invoked in mmc_power_up(). Presumably that case is intentional.

--- On Thu, 21/4/11, Chris Ball <cjb@laptop.org> wrote:
> Paul Parsons (CC'd) submitted a similar patch to fix the
> same regression.
> Paul, please could you check that Guennadi's patch fixes
> your problem?

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Paul Parsons April 22, 2011, 11:13 a.m. UTC | #3
--- On Fri, 22/4/11, Paul Parsons <lost.distance@yahoo.com> wrote:
> As far as I can see the expression
> 
> (ios->clock == 0 && ios->power_mode ==
> MMC_POWER_ON)
> 
> will only be true if host->f_init == 0 at the time
> MMC_POWER_ON is invoked in mmc_power_up(). Presumably that
> case is intentional.

Sorry, ignore this; I missed the case where mmc_gate_clock() sets ios->clock = 0 before calling mmc_set_ios().
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index 6e3271d..f4fac9f 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -772,15 +772,15 @@  static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 		tmio_mmc_set_clock(host, ios->clock);
 
 	/* Power sequence - OFF -> UP -> ON */
-	if (ios->power_mode == MMC_POWER_OFF || !ios->clock) {
+	if (ios->power_mode == MMC_POWER_UP) {
+		/* power up SD bus */
+		if (host->set_pwr)
+			host->set_pwr(host->pdev, 1);
+	} else if (ios->power_mode == MMC_POWER_OFF || !ios->clock) {
 		/* power down SD bus */
 		if (ios->power_mode == MMC_POWER_OFF && host->set_pwr)
 			host->set_pwr(host->pdev, 0);
 		tmio_mmc_clk_stop(host);
-	} else if (ios->power_mode == MMC_POWER_UP) {
-		/* power up SD bus */
-		if (host->set_pwr)
-			host->set_pwr(host->pdev, 1);
 	} else {
 		/* start bus clock */
 		tmio_mmc_clk_start(host);