* [PATCH] mmc: core: clear 'doing_init_tune' also after failures
@ 2020-09-14 11:28 Wolfram Sang
2020-09-14 11:54 ` Niklas Söderlund
2020-09-14 11:58 ` Ulf Hansson
0 siblings, 2 replies; 3+ messages in thread
From: Wolfram Sang @ 2020-09-14 11:28 UTC (permalink / raw)
To: linux-mmc; +Cc: linux-renesas-soc, Ulf Hansson, Wolfram Sang
Reorganize the code, so that the flag is always cleared independently of
a good or bad case.
Fixes: 97a7d87e96b0 ("mmc: core: add a 'doing_init_tune' flag and a 'mmc_doing_tune' helper")
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
Sorry for overlooking this :(
drivers/mmc/core/mmc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 67e95eba0e82..ff3063ce2acd 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1766,14 +1766,14 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
host->doing_init_tune = 1;
err = mmc_hs200_tuning(card);
- if (err)
- goto free_card;
+ if (!err)
+ err = mmc_select_hs400(card);
+
+ host->doing_init_tune = 0;
- err = mmc_select_hs400(card);
if (err)
goto free_card;
- host->doing_init_tune = 0;
} else if (!mmc_card_hs400es(card)) {
/* Select the desired bus width optionally */
err = mmc_select_bus_width(card);
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mmc: core: clear 'doing_init_tune' also after failures
2020-09-14 11:28 [PATCH] mmc: core: clear 'doing_init_tune' also after failures Wolfram Sang
@ 2020-09-14 11:54 ` Niklas Söderlund
2020-09-14 11:58 ` Ulf Hansson
1 sibling, 0 replies; 3+ messages in thread
From: Niklas Söderlund @ 2020-09-14 11:54 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-mmc, linux-renesas-soc, Ulf Hansson
Hi Wolfram,
Thanks for your work.
On 2020-09-14 13:28:45 +0200, Wolfram Sang wrote:
> Reorganize the code, so that the flag is always cleared independently of
> a good or bad case.
>
> Fixes: 97a7d87e96b0 ("mmc: core: add a 'doing_init_tune' flag and a 'mmc_doing_tune' helper")
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> ---
>
> Sorry for overlooking this :(
>
> drivers/mmc/core/mmc.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> index 67e95eba0e82..ff3063ce2acd 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -1766,14 +1766,14 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
> host->doing_init_tune = 1;
>
> err = mmc_hs200_tuning(card);
> - if (err)
> - goto free_card;
> + if (!err)
> + err = mmc_select_hs400(card);
> +
> + host->doing_init_tune = 0;
>
> - err = mmc_select_hs400(card);
> if (err)
> goto free_card;
>
> - host->doing_init_tune = 0;
> } else if (!mmc_card_hs400es(card)) {
> /* Select the desired bus width optionally */
> err = mmc_select_bus_width(card);
> --
> 2.20.1
>
--
Regards,
Niklas Söderlund
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mmc: core: clear 'doing_init_tune' also after failures
2020-09-14 11:28 [PATCH] mmc: core: clear 'doing_init_tune' also after failures Wolfram Sang
2020-09-14 11:54 ` Niklas Söderlund
@ 2020-09-14 11:58 ` Ulf Hansson
1 sibling, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2020-09-14 11:58 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-mmc, Linux-Renesas
On Mon, 14 Sep 2020 at 13:28, Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
>
> Reorganize the code, so that the flag is always cleared independently of
> a good or bad case.
>
> Fixes: 97a7d87e96b0 ("mmc: core: add a 'doing_init_tune' flag and a 'mmc_doing_tune' helper")
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Applied for next, thanks!
Kind regards
Uffe
> ---
>
> Sorry for overlooking this :(
>
> drivers/mmc/core/mmc.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> index 67e95eba0e82..ff3063ce2acd 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -1766,14 +1766,14 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
> host->doing_init_tune = 1;
>
> err = mmc_hs200_tuning(card);
> - if (err)
> - goto free_card;
> + if (!err)
> + err = mmc_select_hs400(card);
> +
> + host->doing_init_tune = 0;
>
> - err = mmc_select_hs400(card);
> if (err)
> goto free_card;
>
> - host->doing_init_tune = 0;
> } else if (!mmc_card_hs400es(card)) {
> /* Select the desired bus width optionally */
> err = mmc_select_bus_width(card);
> --
> 2.20.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-09-14 17:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-14 11:28 [PATCH] mmc: core: clear 'doing_init_tune' also after failures Wolfram Sang
2020-09-14 11:54 ` Niklas Söderlund
2020-09-14 11:58 ` Ulf Hansson
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).