On 14 December 2012 11:53, Kevin Liu <kliu5@xxxxxxxxxxx> wrote: > Cycle power the card is a MUST step when voltage switch sequence failed. > So move this operation to function mmc_set_signal_voltage. > > Signed-off-by: Kevin Liu <kliu5@xxxxxxxxxxx> > --- > drivers/mmc/core/sd.c | 16 +++++----------- > 1 files changed, 5 insertions(+), 11 deletions(-) > > diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c > index c1a700d..53ba4d9 100644 > --- a/drivers/mmc/core/sd.c > +++ b/drivers/mmc/core/sd.c > @@ -757,7 +757,6 @@ try_again: > if (max_current > 150) > ocr |= SD_OCR_XPC; > > -try_again: > err = mmc_send_app_op_cond(host, ocr, rocr); > if (err) > return err; > @@ -769,16 +768,11 @@ try_again: > if (!mmc_host_is_spi(host) && rocr && > ((*rocr & 0x41000000) == 0x41000000)) { > err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180, true); > - if (err == -EAGAIN) { > - /* Power cycle card */ > - pr_debug("%s: Signal voltage switch failed, " > - "power cycling card (retries = %d)\n", > - mmc_hostname(host), retries); > - mmc_power_cycle(host); > - retries--; > - goto try_again; > - } else if (err) { > - retries = 0; > + if (err) { > + if (err == -EAGAIN) > + retries--; > + else > + retries = 0; > goto try_again; > } > } > -- > 1.7.0.4 > This looks good to me. I suggest Johan includes this in his patch. Maybe add Kevins signed off? Kind regards Ulf Hansson -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html