Re: [PATCH v2 2/2] mmc: core: Power cycle card on voltage switch fail

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ulf,

2012/9/25 Ulf Hansson <ulf.hansson@xxxxxxxxxx>:
> Hi Johan,
>
> An overall comment; would it be possible to include this patch as a
> piece of patch 1/2 "mmc: core: Proper signal voltage switch".
> They seems like quite tight connected.

Sure, I can do this. Let me see what comes out of the SDIO patch first though...

>> diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
>> index 74972c2..9a165451 100644
>> --- a/drivers/mmc/core/sd.c
>> +++ b/drivers/mmc/core/sd.c
>> @@ -720,6 +720,7 @@ int mmc_sd_get_cid(struct mmc_host *host, u32 ocr, u32 *cid, u32 *rocr)
>>          * state.  We wait 1ms to give cards time to
>>          * respond.
>>          */
>> +try_again:
>>         mmc_go_idle(host);
>>
>>         /*
>> @@ -748,7 +749,6 @@ int mmc_sd_get_cid(struct mmc_host *host, u32 ocr, u32 *cid, u32 *rocr)
>>         if (max_current > 150)
>>                 ocr |= SD_OCR_XPC;
>>
>> -try_again:
>>         err = mmc_send_app_op_cond(host, ocr, rocr);
>>         if (err)
>>                 return err;
>> @@ -761,7 +761,11 @@ try_again:
>>            ((*rocr & 0x41000000) == 0x41000000)) {
>>                 err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180, true);
>>                 if (err) {
>> -                       ocr &= ~SD_OCR_S18R;
>> +                       /* Power cycle card */
>> +                       pr_warning("%s: Signal voltage switch failed, "
>> +                               "power cycling card\n", mmc_hostname(host));
>> +                       mmc_power_off(host);
>> +                       mmc_power_up(host);
>
> This mean you will retry forever even if the card is not capable of
> 1.8V. I doubt this really what you want?

The card has already ACKed that it supports 1.8V, and according to the
SD spec it should be power-cycled if the voltage swich fails, but I
guess it would be more robust to bail out after a number of retries.
Our 16 GB Verbatim card that started all this has been observed to
sometimes require five power cycles until it accepts the voltage
switch, so I'll have to pick a high enough number.

Kind regards, Johan
--
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


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux