diff mbox series

mmc: core: complete HS400 before checking status

Message ID 20190611200343.12343-1-wsa+renesas@sang-engineering.com (mailing list archive)
State Accepted
Delegated to: Geert Uytterhoeven
Headers show
Series mmc: core: complete HS400 before checking status | expand

Commit Message

Wolfram Sang June 11, 2019, 8:03 p.m. UTC
We don't have a reproducible error case, yet our BSP team suggested that
the mmc_switch_status() command in mmc_select_hs400() should come after
the callback into the driver completing HS400 setup. It makes sense to
me because we want the status of a fully setup HS400, so it will
increase the reliability of the mmc_switch_status() command.

Reported-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Fixes: ba6c7ac3a2f4 ("mmc: core: more fine-grained hooks for HS400 tuning")
---

Tested on a Renesas Salvator-XS (R-Car M3N).

Simon, you implemented the callback. What do you think?

 drivers/mmc/core/mmc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Ulf Hansson June 17, 2019, 11:35 a.m. UTC | #1
On Tue, 11 Jun 2019 at 22:03, Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
>
> We don't have a reproducible error case, yet our BSP team suggested that
> the mmc_switch_status() command in mmc_select_hs400() should come after
> the callback into the driver completing HS400 setup. It makes sense to
> me because we want the status of a fully setup HS400, so it will
> increase the reliability of the mmc_switch_status() command.
>
> Reported-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> Fixes: ba6c7ac3a2f4 ("mmc: core: more fine-grained hooks for HS400 tuning")

Applied for fixes, thanks!

Kind regards
Uffe


> ---
>
> Tested on a Renesas Salvator-XS (R-Car M3N).
>
> Simon, you implemented the callback. What do you think?
>
>  drivers/mmc/core/mmc.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> index 3e786ba204c3..671bfcceea6a 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -1212,13 +1212,13 @@ static int mmc_select_hs400(struct mmc_card *card)
>         mmc_set_timing(host, MMC_TIMING_MMC_HS400);
>         mmc_set_bus_speed(card);
>
> +       if (host->ops->hs400_complete)
> +               host->ops->hs400_complete(host);
> +
>         err = mmc_switch_status(card);
>         if (err)
>                 goto out_err;
>
> -       if (host->ops->hs400_complete)
> -               host->ops->hs400_complete(host);
> -
>         return 0;
>
>  out_err:
> --
> 2.11.0
>
diff mbox series

Patch

diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 3e786ba204c3..671bfcceea6a 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1212,13 +1212,13 @@  static int mmc_select_hs400(struct mmc_card *card)
 	mmc_set_timing(host, MMC_TIMING_MMC_HS400);
 	mmc_set_bus_speed(card);
 
+	if (host->ops->hs400_complete)
+		host->ops->hs400_complete(host);
+
 	err = mmc_switch_status(card);
 	if (err)
 		goto out_err;
 
-	if (host->ops->hs400_complete)
-		host->ops->hs400_complete(host);
-
 	return 0;
 
 out_err: