mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH V2] mmc: sdhci-sprd: Fix no reset data and command after voltage switch
@ 2022-11-30 12:13 Wenchao Chen
  2022-11-30 15:23 ` Adrian Hunter
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Wenchao Chen @ 2022-11-30 12:13 UTC (permalink / raw)
  To: adrian.hunter, ulf.hansson, orsonzhai, baolin.wang, zhang.lyra
  Cc: linux-mmc, linux-kernel, zhenxiong.lai, yuelin.tang, gengcixi

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>
---
Changelog:

v1 -> v2:
There is no need to wait for the state of the pin to stabilize.
---
 drivers/mmc/host/sdhci-sprd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c
index b92a408f138d..bec3f9e3cd3f 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:
@@ -498,6 +498,8 @@ static int sdhci_sprd_voltage_switch(struct mmc_host *mmc, struct mmc_ios *ios)
 
 	/* Wait for 300 ~ 500 us for pin state stable */
 	usleep_range(300, 500);
+
+reset:
 	sdhci_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA);
 
 	return 0;
-- 
2.17.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH V2] mmc: sdhci-sprd: Fix no reset data and command after voltage switch
  2022-11-30 12:13 [PATCH V2] mmc: sdhci-sprd: Fix no reset data and command after voltage switch Wenchao Chen
@ 2022-11-30 15:23 ` Adrian Hunter
  2022-12-01  1:04 ` Baolin Wang
  2022-12-01 10:48 ` Ulf Hansson
  2 siblings, 0 replies; 4+ messages in thread
From: Adrian Hunter @ 2022-11-30 15:23 UTC (permalink / raw)
  To: Wenchao Chen, ulf.hansson, orsonzhai, baolin.wang, zhang.lyra
  Cc: linux-mmc, linux-kernel, zhenxiong.lai, yuelin.tang, gengcixi

On 30/11/22 14:13, 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>

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

> ---
> Changelog:
> 
> v1 -> v2:
> There is no need to wait for the state of the pin to stabilize.
> ---
>  drivers/mmc/host/sdhci-sprd.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c
> index b92a408f138d..bec3f9e3cd3f 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:
> @@ -498,6 +498,8 @@ static int sdhci_sprd_voltage_switch(struct mmc_host *mmc, struct mmc_ios *ios)
>  
>  	/* Wait for 300 ~ 500 us for pin state stable */
>  	usleep_range(300, 500);
> +
> +reset:
>  	sdhci_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA);
>  
>  	return 0;


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH V2] mmc: sdhci-sprd: Fix no reset data and command after voltage switch
  2022-11-30 12:13 [PATCH V2] mmc: sdhci-sprd: Fix no reset data and command after voltage switch Wenchao Chen
  2022-11-30 15:23 ` Adrian Hunter
@ 2022-12-01  1:04 ` Baolin Wang
  2022-12-01 10:48 ` Ulf Hansson
  2 siblings, 0 replies; 4+ messages in thread
From: Baolin Wang @ 2022-12-01  1:04 UTC (permalink / raw)
  To: Wenchao Chen, adrian.hunter, ulf.hansson, orsonzhai, zhang.lyra
  Cc: linux-mmc, linux-kernel, zhenxiong.lai, yuelin.tang, gengcixi



On 11/30/2022 8:13 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>

LGTM. Thanks.
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>

> ---
> Changelog:
> 
> v1 -> v2:
> There is no need to wait for the state of the pin to stabilize.
> ---
>   drivers/mmc/host/sdhci-sprd.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c
> index b92a408f138d..bec3f9e3cd3f 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:
> @@ -498,6 +498,8 @@ static int sdhci_sprd_voltage_switch(struct mmc_host *mmc, struct mmc_ios *ios)
>   
>   	/* Wait for 300 ~ 500 us for pin state stable */
>   	usleep_range(300, 500);
> +
> +reset:
>   	sdhci_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA);
>   
>   	return 0;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH V2] mmc: sdhci-sprd: Fix no reset data and command after voltage switch
  2022-11-30 12:13 [PATCH V2] mmc: sdhci-sprd: Fix no reset data and command after voltage switch Wenchao Chen
  2022-11-30 15:23 ` Adrian Hunter
  2022-12-01  1:04 ` Baolin Wang
@ 2022-12-01 10:48 ` Ulf Hansson
  2 siblings, 0 replies; 4+ messages in thread
From: Ulf Hansson @ 2022-12-01 10:48 UTC (permalink / raw)
  To: Wenchao Chen
  Cc: adrian.hunter, orsonzhai, baolin.wang, zhang.lyra, linux-mmc,
	linux-kernel, zhenxiong.lai, yuelin.tang, gengcixi

On Wed, 30 Nov 2022 at 13:14, Wenchao Chen <wenchao.chen@unisoc.com> 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>

Applied for fixes and by adding a stable tag, thanks!

Kind regards
Uffe


> ---
> Changelog:
>
> v1 -> v2:
> There is no need to wait for the state of the pin to stabilize.
> ---
>  drivers/mmc/host/sdhci-sprd.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c
> index b92a408f138d..bec3f9e3cd3f 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:
> @@ -498,6 +498,8 @@ static int sdhci_sprd_voltage_switch(struct mmc_host *mmc, struct mmc_ios *ios)
>
>         /* Wait for 300 ~ 500 us for pin state stable */
>         usleep_range(300, 500);
> +
> +reset:
>         sdhci_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA);
>
>         return 0;
> --
> 2.17.1
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-12-01 10:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-30 12:13 [PATCH V2] mmc: sdhci-sprd: Fix no reset data and command after voltage switch Wenchao Chen
2022-11-30 15:23 ` Adrian Hunter
2022-12-01  1:04 ` Baolin Wang
2022-12-01 10:48 ` Ulf Hansson

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®