Re: [PATCH 08/10] mmc: card: Use R1 response for the stop cmd at recovery path

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

 



On 23 January 2014 11:09, Adrian Hunter <adrian.hunter@xxxxxxxxx> wrote:
> On 22/01/14 17:00, Ulf Hansson wrote:
>> Hosts supporting MMC_CAP_WAIT_WHILE_BUSY shall not be waiting for busy
>> detection completion in the recovery path, which were the case when
>> using R1B response.
>>
>> Start using R1 as response instead to align behavior, no matter if
>> MMC_CAP_WAIT_WHILE_BUSY is supported or not.
>
> This does not make sense to me.  If you are sending a STOP command you
> should use the correct response type.  R1B should be OK here because the
> card should release the busy signal in any case except failure.

For those hosts not supporting MMC_CAP_WAIT_WHILE_BUSY a R1B is
assumed to be treated same as an R1, which means there are no busy
detection handled in the host.

mmc_blk_cmd_recovery() is the only caller of the send_stop() function.
Additionally it does not care about to handle busy detection with
CDM13 polling.

Now, since most hosts don't support MMC_CAP_WAIT_WHILE_BUSY which
means there no busy detection done, I wanted to align to this
behaviour - no matter if the host can do HW busy detection or not.

I am not saying this is how it must be done, just trying to provide
you with some more reasons to why I wanted to change.

If we instead decide keep the R1B for send_stop(), we should implement
CMD 13 polling to meet the same behaviour for hosts not supporting
MMC_CAP_WAIT_WHILE_BUSY. In this scenario, we need to set a select a
busy timeout, do you have any suggestion of what would be a reasonable
value for it?

Kind regards
Ulf Hansson

>
>>
>> Signed-off-by: Ulf Hansson <ulf.hansson@xxxxxxxxxx>
>> ---
>>  drivers/mmc/card/block.c |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
>> index 87cd2b0..74169fa 100644
>> --- a/drivers/mmc/card/block.c
>> +++ b/drivers/mmc/card/block.c
>> @@ -728,7 +728,7 @@ static int send_stop(struct mmc_card *card, u32 *status)
>>       int err;
>>
>>       cmd.opcode = MMC_STOP_TRANSMISSION;
>> -     cmd.flags = MMC_RSP_SPI_R1B | MMC_RSP_R1B | MMC_CMD_AC;
>> +     cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_AC;
>>       err = mmc_wait_for_cmd(card->host, &cmd, 5);
>>       if (err == 0)
>>               *status = cmd.resp[0];
>>
>
--
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