Re: [PATCH 1/2] mmc: core: Add capability for 1.8V-only controllers

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

 



On 29 March 2018 at 19:44, Jennifer Dahm <jennifer.dahm@xxxxxx> wrote:
> From: Kyle Roeschley <kyle.roeschley@xxxxxx>
>
> On some SD host controllers, 1.8V signaling is required for reliable
> operation of the part. Add a capability which says that we must switch
> to 1.8V signaling during card initialization.

As I said, please clarify the use case for this. The above is too hand
wavy for me to understand.

>
> Signed-off-by: Kyle Roeschley <kyle.roeschley@xxxxxx>
> Signed-off-by: Jennifer Dahm <jennifer.dahm@xxxxxx>
> ---
>  drivers/mmc/core/sd.c    | 7 +++++++
>  include/linux/mmc/host.h | 1 +
>  2 files changed, 8 insertions(+)
>
> diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
> index baf3d5d..b259671 100644
> --- a/drivers/mmc/core/sd.c
> +++ b/drivers/mmc/core/sd.c
> @@ -782,6 +782,13 @@ int mmc_sd_get_cid(struct mmc_host *host, u32 ocr, u32 *cid, u32 *rocr)
>                 }
>         }
>
> +       if (host->caps2 & MMC_CAP2_REQUIRE_1_8V &&
> +           host->ios.signal_voltage != MMC_SIGNAL_VOLTAGE_180) {
> +               pr_err("%s: Host requires UHS-capable card\n",
> +                      mmc_hostname(host));
> +               return -EINVAL;
> +       }

This doesn't seem like the correct place to check for the negotiated
I/O voltage level. I would rather move this check to the end of
mmc_sd_init_card().

Moreover I suggest to rename the cap to something along the lines of
MMC_CAP_AVOID_3_3V, to make its purpose more clear. I also think
changing the if statement to:
"(host->caps & MMC_CAP_AVOID_3_3V && host->ios.signal_voltage ==
MMC_SIGNAL_VOLTAGE_330)" is better, as that prevents using 3.3V but
allows the other signal voltage levels.

Finally, it seems like you also need to add the similar check for MMC
and SDIO, right!?

> +
>         err = mmc_send_cid(host, cid);
>         return err;
>  }
> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
> index 8514623..4d58c10 100644
> --- a/include/linux/mmc/host.h
> +++ b/include/linux/mmc/host.h
> @@ -354,6 +354,7 @@ struct mmc_host {
>  #define MMC_CAP2_NO_MMC                (1 << 22)       /* Do not send (e)MMC commands during initialization */
>  #define MMC_CAP2_CQE           (1 << 23)       /* Has eMMC command queue engine */
>  #define MMC_CAP2_CQE_DCMD      (1 << 24)       /* CQE can issue a direct command */
> +#define MMC_CAP2_REQUIRE_1_8V  (1 << 25)       /* Host requires 1.8V signalling */
>
>         int                     fixed_drv_type; /* fixed driver type for non-removable media */
>
> --
> 2.7.4
>

Kind regards
Uffe
--
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