Re: mmc: core: Add check for card type before mmc_hw_reset_for_init

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

 



On 12 August 2013 09:02, Prasanna NAVARATNA
<prasanna.navaratna@xxxxxxxxx> wrote:
> Almost all the places, before calling hw_reset ops, the card type is checked
> to make sure it is eMMC but missed during mmc_rescan_try_freq.
> The below patch adds the check for card type before calling hardware reset
> for init as double safety measure.
>
> From e7941c5b3b4999318feb59fa83b78c15c13493b3 Mon Sep 17 00:00:00 2001
> From: Prasanna NAVARATNA <prasanna.navaratna@xxxxxxxxxxxx>
> Date: Mon, 12 Aug 2013 12:26:57 +0530
> Subject: [PATCH] mmc: core: add check for card type before
>  mmc_hw_reset_for_init
>
> During mmc_hw_reset_for_init, the card type is not checked before
> calling hw_reset ops.
> Add check for the card type as emmc before issuing hw_reset during init.
>
> Signed-off-by: Prasanna NAVARATNA <prasanna.navaratna@xxxxxxxxxxxx>
> ---
>  drivers/mmc/core/core.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index 49a5bca..2dad69a 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -2196,7 +2196,8 @@ EXPORT_SYMBOL(mmc_set_blockcount);
>
>  static void mmc_hw_reset_for_init(struct mmc_host *host)
>  {
> -       if (!(host->caps & MMC_CAP_HW_RESET) || !host->ops->hw_reset)
> +       if (!(host->caps & MMC_CAP_HW_RESET) || !host->ops->hw_reset ||
> +                       !mmc_card_mmc(host->card))

No, this does not work.

At this point we don't know the card type yet since we have not
initialized it. We can only trust the host->ops is performing what we
expect.

Kind regards
Ulf Hansson

>                 return;
>         mmc_host_clk_hold(host);
>         host->ops->hw_reset(host);
> --
> 1.7.6
>
>
>
>
> --
> 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
--
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