mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Baolin Wang <baolin.wang@linux.alibaba.com>
To: Wenchao Chen <wenchao.chen@unisoc.com>,
	adrian.hunter@intel.com, ulf.hansson@linaro.org,
	orsonzhai@gmail.com, zhang.lyra@gmail.com
Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
	zhenxiong.lai@unisoc.com, yuelin.tang@unisoc.com,
	gengcixi@gmail.com
Subject: Re: [PATCH] mmc: sdhci-sprd: Fix no reset data and command after voltage switch
Date: Wed, 30 Nov 2022 18:42:20 +0800	[thread overview]
Message-ID: <9c93dd3e-f80d-7421-05b8-9f692d33d2f2@linux.alibaba.com> (raw)
In-Reply-To: <20221130080224.12831-1-wenchao.chen@unisoc.com>



On 11/30/2022 4:02 PM, Wenchao Chen wrote:
> After switching the voltage, no reset data and command will cause
> CMD2 timeout.
> 
> Fixes: 29ca763fc26f ("mmc: sdhci-sprd: Add pin control support for voltage switch")
> Signed-off-by: Wenchao Chen <wenchao.chen@unisoc.com>
> ---
>   drivers/mmc/host/sdhci-sprd.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c
> index b92a408f138d..464508be8ec8 100644
> --- a/drivers/mmc/host/sdhci-sprd.c
> +++ b/drivers/mmc/host/sdhci-sprd.c
> @@ -470,7 +470,7 @@ static int sdhci_sprd_voltage_switch(struct mmc_host *mmc, struct mmc_ios *ios)
>   	}
>   
>   	if (IS_ERR(sprd_host->pinctrl))
> -		return 0;
> +		goto reset;
>   
>   	switch (ios->signal_voltage) {
>   	case MMC_SIGNAL_VOLTAGE_180:
> @@ -496,6 +496,7 @@ static int sdhci_sprd_voltage_switch(struct mmc_host *mmc, struct mmc_ios *ios)
>   		break;
>   	}
>   
> +reset:
>   	/* Wait for 300 ~ 500 us for pin state stable */
>   	usleep_range(300, 500);

If no pin state switching, still need stable time? Otherwise looks good 
to me.

>   	sdhci_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA);

  parent reply	other threads:[~2022-11-30 10:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-30  8:02 Wenchao Chen
2022-11-30  9:58 ` Adrian Hunter
2022-11-30 10:42 ` Baolin Wang [this message]
2022-11-30 11:58   ` Wenchao Chen

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=9c93dd3e-f80d-7421-05b8-9f692d33d2f2@linux.alibaba.com \
    --to=baolin.wang@linux.alibaba.com \
    --cc=adrian.hunter@intel.com \
    --cc=gengcixi@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=orsonzhai@gmail.com \
    --cc=ulf.hansson@linaro.org \
    --cc=wenchao.chen@unisoc.com \
    --cc=yuelin.tang@unisoc.com \
    --cc=zhang.lyra@gmail.com \
    --cc=zhenxiong.lai@unisoc.com \
    /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

all inboxes | Powered by JetHome®