linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Chen-Yu Tsai <wens@csie.org>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>,
	Hans de Goede <hdegoede@redhat.com>,
	linux-mmc <linux-mmc@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	linux-sunxi@googlegroups.com
Subject: Re: [PATCH RFC 03/15] mmc: sunxi: Block signal voltage switching (CMD11)
Date: Fri, 29 Jan 2016 11:42:13 +0100	[thread overview]
Message-ID: <CAPDyKFrG8cXChSRuAx-a++iNHUHU_GuUApDhxfPSJZb1Oo1fsg@mail.gmail.com> (raw)
In-Reply-To: <1453354002-28366-4-git-send-email-wens@csie.org>

On 21 January 2016 at 06:26, Chen-Yu Tsai <wens@csie.org> wrote:
> Allwinner's mmc controller supports signal voltage switching. This is
> supported in code in Allwinner's kernel. However, publicly available
> boards all tie it to a fixed 3.0/3.3V regulator, with options to tie
> it to 1.8V for eMMC on some.
>
> Since Allwinner's kernel is an ancient 3.4, it is hard to say whether
> adapting it's code to a modern mainline kernel would work. Block signal
> voltage switching until someone has proper hardware to implement and
> test this.
>
> This only affects SD UHS-1 modes, as eMMC switches the voltage directly
> without any signaling.
>
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---
>  drivers/mmc/host/sunxi-mmc.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
> index 790f01662b4e..0495ae7da6d6 100644
> --- a/drivers/mmc/host/sunxi-mmc.c
> +++ b/drivers/mmc/host/sunxi-mmc.c
> @@ -816,6 +816,20 @@ static void sunxi_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq)
>                 }
>         }
>
> +       /*
> +        * TODO Support signal voltage switching
> +        *
> +        * Compared to Allwinner's kernel, recent updates in the mmc core
> +        * mean this should be as easy as setting the flags in cmd_val and
> +        * imask, and waiting for it to finish. However no boards support
> +        * this so this cannot be tested. Block it for now.
> +        */
> +       if (cmd->opcode == SD_SWITCH_VOLTAGE) {
> +               mrq->cmd->error = -EPERM;
> +               mmc_request_done(mmc, mrq);
> +               return;
> +       }

Unless some of the MMC_CAP_UHS* mode is set, this command shouldn't be sent.

So, if you *really* want to protect from this, I think it's better to
clear these caps in the ->probe() function, after mmc_of_parse() has
been called.

> +
>         if (cmd->opcode == MMC_GO_IDLE_STATE) {
>                 cmd_val |= SDXC_SEND_INIT_SEQUENCE;
>                 imask |= SDXC_COMMAND_DONE;
> --
> 2.7.0.rc3
>

Kind regards
Uffe

  reply	other threads:[~2016-01-29 10:42 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-21  5:26 [PATCH RFC 00/15] mmc: sunxi: Support vqmmc regulator and eMMC DDR modes Chen-Yu Tsai
2016-01-21  5:26 ` [PATCH RFC 01/15] mmc: sunxi: Document host init sequence Chen-Yu Tsai
2016-01-29 11:39   ` Ulf Hansson
2016-01-21  5:26 ` [PATCH RFC 02/15] mmc: sunxi: Return error on mmc_regulator_set_ocr() fail in .set_ios op Chen-Yu Tsai
2016-01-29 11:40   ` Ulf Hansson
2016-01-21  5:26 ` [PATCH RFC 03/15] mmc: sunxi: Block signal voltage switching (CMD11) Chen-Yu Tsai
2016-01-29 10:42   ` Ulf Hansson [this message]
2016-01-29 14:44     ` Chen-Yu Tsai
2016-01-21  5:26 ` [PATCH RFC 04/15] mmc: sunxi: Support vqmmc regulator Chen-Yu Tsai
2016-01-29 11:40   ` Ulf Hansson
2016-01-21  5:26 ` [PATCH RFC 05/15] mmc: sunxi: Support MMC_DDR52 timing modes Chen-Yu Tsai
2016-01-21 11:14   ` Hans de Goede
2016-01-21 11:55     ` Chen-Yu Tsai
2016-01-21 12:26       ` Hans de Goede
2016-01-21  5:26 ` [PATCH RFC 06/15] mmc: sunxi: Support 8 bit eMMC DDR transfer modes Chen-Yu Tsai
2016-01-21  5:26 ` [PATCH RFC 07/15] mmc: sunxi: Enable eMMC HS-DDR (MMC_CAP_1_8V_DDR) support Chen-Yu Tsai
2016-01-21  5:26 ` [PATCH RFC 08/15] ARM: dts: sun6i: Add mmc3 pins for 8 bit emmc Chen-Yu Tsai
2016-01-22 20:31   ` Maxime Ripard
2016-01-23 11:04     ` Chen-Yu Tsai
2016-01-24 16:54       ` Maxime Ripard
2016-01-21  5:26 ` [PATCH RFC 09/15] ARM: dts: sun6i: sina31s: Switch to mmc3 for onboard eMMC Chen-Yu Tsai
2016-01-21 11:16   ` Hans de Goede
2016-01-21 12:23     ` Chen-Yu Tsai
2016-01-21 12:25       ` Hans de Goede
2016-01-21 12:28         ` Chen-Yu Tsai
2016-01-21 12:38           ` Hans de Goede
2016-01-22 20:39   ` Maxime Ripard
2016-01-23  4:21     ` Chen-Yu Tsai
2016-01-24 16:56       ` Maxime Ripard
2016-01-21  5:26 ` [PATCH RFC 10/15] ARM: dts: sun8i: Include SDC2_RST pin in mmc2_8bit_pins Chen-Yu Tsai
2016-01-24 16:58   ` Maxime Ripard
2016-01-21  5:26 ` [PATCH RFC 11/15] ARM: dts: sun8i: sina33: Enable hardware reset and HS-DDR for eMMC Chen-Yu Tsai
2016-01-22 20:42   ` Maxime Ripard
2016-01-21  5:26 ` [PATCH RFC 12/15] ARM: dts: sun9i: Use sun9i specific mmc compatible Chen-Yu Tsai
2016-01-22 20:44   ` Maxime Ripard
2016-01-23 10:50     ` Chen-Yu Tsai
2016-01-21  5:26 ` [PATCH RFC 13/15] ARM: dts: sun9i: Include SDC2_RST pin in mmc2_8bit_pins Chen-Yu Tsai
2016-01-24 16:58   ` Maxime Ripard
2016-01-21  5:26 ` [PATCH RFC 14/15] ARM: dts: sun9i: a80-optimus: Enable hardware reset and HS-DDR for eMMC Chen-Yu Tsai
2016-01-24 16:59   ` Maxime Ripard
2016-01-21  5:26 ` [PATCH RFC 15/15] ARM: dts: sun9i: cubieboard4: " Chen-Yu Tsai
2016-01-24 16:59   ` Maxime Ripard
2016-01-21 11:19 ` [PATCH RFC 00/15] mmc: sunxi: Support vqmmc regulator and eMMC DDR modes Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPDyKFrG8cXChSRuAx-a++iNHUHU_GuUApDhxfPSJZb1Oo1fsg@mail.gmail.com \
    --to=ulf.hansson@linaro.org \
    --cc=hdegoede@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-sunxi@googlegroups.com \
    --cc=maxime.ripard@free-electrons.com \
    --cc=wens@csie.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).