Re: [PATCH RFC 2/3] mmc: core: Do not check CRC response for switch from HS400 to HS200

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

 



On Thu, 12 Mar 2020 at 15:25, Adrian Hunter <adrian.hunter@xxxxxxxxx> wrote:
>
> Switching from HS400 to HS200 may experience CRC errors. Do not check
> CRC response in that case.
>
> Signed-off-by: Adrian Hunter <adrian.hunter@xxxxxxxxx>
> ---

[...]

> diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c
> index 619088a94688..2baaa66e491d 100644
> --- a/drivers/mmc/core/mmc_ops.c
> +++ b/drivers/mmc/core/mmc_ops.c
> @@ -552,12 +552,13 @@ int mmc_poll_for_busy(struct mmc_card *card, unsigned int timeout_ms,
>   *     @timing: new timing to change to
>   *     @send_status: send status cmd to poll for busy
>   *     @retry_crc_err: retry when CRC errors when polling with CMD13 for busy
> + *     @no_crc_resp: do not require to check CRC response
>   *
>   *     Modifies the EXT_CSD register for selected card.
>   */
>  int __mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value,
>                 unsigned int timeout_ms, unsigned char timing,
> -               bool send_status, bool retry_crc_err)
> +               bool send_status, bool retry_crc_err, bool no_crc_resp)
>  {
>         struct mmc_host *host = card->host;
>         int err;
> @@ -594,6 +595,8 @@ int __mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value,
>         } else {
>                 cmd.flags |= MMC_RSP_SPI_R1 | MMC_RSP_R1;
>         }
> +       if (no_crc_resp)
> +               cmd.flags &= ~MMC_RSP_CRC;

So potentially this means the host driver will complete the command
successfully, even if it receives a CRC error.

As I understood it, the idea was to poll for busy, *if* we encountered
CRC errors, so then how would you know about that?

Seems like we should drop the above code and be checking for -EILSEQ
of the request instead? No?

>
>         if (index == EXT_CSD_SANITIZE_START)
>                 cmd.sanitize_busy = true;
> @@ -639,7 +642,7 @@ int mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value,
>                 unsigned int timeout_ms)
>  {
>         return __mmc_switch(card, set, index, value, timeout_ms, 0,
> -                           true, false);
> +                           true, false, false);
>  }
>  EXPORT_SYMBOL_GPL(mmc_switch);
>
> diff --git a/drivers/mmc/core/mmc_ops.h b/drivers/mmc/core/mmc_ops.h
> index 38dcfeeaf6d5..1a75c347b8a7 100644
> --- a/drivers/mmc/core/mmc_ops.h
> +++ b/drivers/mmc/core/mmc_ops.h
> @@ -40,7 +40,7 @@ int mmc_poll_for_busy(struct mmc_card *card, unsigned int timeout_ms,
>                       enum mmc_busy_cmd busy_cmd);
>  int __mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value,
>                 unsigned int timeout_ms, unsigned char timing,
> -               bool send_status, bool retry_crc_err);
> +               bool send_status, bool retry_crc_err, bool no_crc_resp);
>  int mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value,
>                 unsigned int timeout_ms);
>  void mmc_run_bkops(struct mmc_card *card);
> --
> 2.17.1
>

Kind regards
Uffe



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

  Powered by Linux