linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jaehoon Chung <jh80.chung@samsung.com>
To: Doug Anderson <dianders@chromium.org>,
	Seungwon Jeon <tgih.jun@samsung.com>,
	Ulf Hansson <ulf.hansson@linaro.org>
Cc: Alim Akhtar <alim.akhtar@samsung.com>,
	Sonny Rao <sonnyrao@chromium.org>,
	Andrew Bresticker <abrestic@chromium.org>,
	Heiko Stuebner <heiko@sntech.de>,
	Addy Ke <addy.ke@rock-chips.com>,
	Alexandru Stan <amstan@chromium.org>,
	javier.martinez@collabora.co.uk, chris@printf.net,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] mmc: dw_mmc: Give a good reset after we give power
Date: Wed, 25 Feb 2015 19:35:56 +0900	[thread overview]
Message-ID: <54EDA58C.7050605@samsung.com> (raw)
In-Reply-To: <1424458639-23330-2-git-send-email-dianders@chromium.org>

Dear, Doug.

Looks good to me. Thanks!

Acked-by: Jaehoon Chung <jh80.chung@samsung.com>

Best Regards,
Jaehoon Chung

On 02/21/2015 03:57 AM, Doug Anderson wrote:
> We should give dw_mmc a good reset after we apply power.  On some
> boards vqmmc may actually be connected to the IP block in the SoC so
> it's good to reset after power comes in.
> 
> Without this we sometimes see failures enumerating cards on rk3288.
> 
> Signed-off-by: Doug Anderson <dianders@chromium.org>
> ---
>  drivers/mmc/host/dw_mmc.c | 27 ++++++++++++++++++---------
>  1 file changed, 18 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index 43fcae1..6a712ae 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -1119,13 +1119,23 @@ static void dw_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>  		mci_writel(slot->host, PWREN, regs);
>  		break;
>  	case MMC_POWER_ON:
> -		if (!IS_ERR(mmc->supply.vqmmc) && !slot->host->vqmmc_enabled) {
> -			ret = regulator_enable(mmc->supply.vqmmc);
> -			if (ret < 0)
> -				dev_err(slot->host->dev,
> -					"failed to enable vqmmc regulator\n");
> -			else
> +		if (!slot->host->vqmmc_enabled) {
> +			if (!IS_ERR(mmc->supply.vqmmc)) {
> +				ret = regulator_enable(mmc->supply.vqmmc);
> +				if (ret < 0)
> +					dev_err(slot->host->dev,
> +						"failed to enable vqmmc\n");
> +				else
> +					slot->host->vqmmc_enabled = true;
> +
> +			} else {
> +				/* Keep track so we don't reset again */
>  				slot->host->vqmmc_enabled = true;
> +			}
> +
> +			/* Reset our state machine after powering on */
> +			dw_mci_ctrl_reset(slot->host,
> +					  SDMMC_CTRL_ALL_RESET_FLAGS);
>  		}
>  
>  		/* Adjust clock / bus width after power is up */
> @@ -1139,10 +1149,9 @@ static void dw_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
>  		if (!IS_ERR(mmc->supply.vmmc))
>  			mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0);
>  
> -		if (!IS_ERR(mmc->supply.vqmmc) && slot->host->vqmmc_enabled) {
> +		if (!IS_ERR(mmc->supply.vqmmc) && slot->host->vqmmc_enabled)
>  			regulator_disable(mmc->supply.vqmmc);
> -			slot->host->vqmmc_enabled = false;
> -		}
> +		slot->host->vqmmc_enabled = false;
>  
>  		regs = mci_readl(slot->host, PWREN);
>  		regs &= ~(1 << slot->id);
> 


  reply	other threads:[~2015-02-25 10:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-20 18:57 [PATCH 1/2] mmc: dw_mmc: Make sure we only adjust the clock when power is on Doug Anderson
2015-02-20 18:57 ` [PATCH 2/2] mmc: dw_mmc: Give a good reset after we give power Doug Anderson
2015-02-25 10:35   ` Jaehoon Chung [this message]
2015-02-25 18:26   ` Javier Martinez Canillas
2015-02-25 10:34 ` [PATCH 1/2] mmc: dw_mmc: Make sure we only adjust the clock when power is on Jaehoon Chung
2015-02-25 18:25 ` Javier Martinez Canillas

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=54EDA58C.7050605@samsung.com \
    --to=jh80.chung@samsung.com \
    --cc=abrestic@chromium.org \
    --cc=addy.ke@rock-chips.com \
    --cc=alim.akhtar@samsung.com \
    --cc=amstan@chromium.org \
    --cc=chris@printf.net \
    --cc=dianders@chromium.org \
    --cc=heiko@sntech.de \
    --cc=javier.martinez@collabora.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=sonnyrao@chromium.org \
    --cc=tgih.jun@samsung.com \
    --cc=ulf.hansson@linaro.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).