diff mbox series

mmc: core: Move calls to ->prepare_hs400_tuning() closer to mmc code

Message ID 1526999186-20128-1-git-send-email-ulf.hansson@linaro.org
State New
Headers show
Series mmc: core: Move calls to ->prepare_hs400_tuning() closer to mmc code | expand

Commit Message

Ulf Hansson May 22, 2018, 2:26 p.m. UTC
Move the calls to ->prepare_hs400_tuning(), from mmc_retune() into
mmc_hs400_to_hs200(), as it better belongs there, rather than being generic
to all type of cards.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

---
 drivers/mmc/core/host.c | 3 ---
 drivers/mmc/core/mmc.c  | 4 ++++
 2 files changed, 4 insertions(+), 3 deletions(-)

-- 
2.7.4

Comments

Simon Horman May 28, 2018, 12:41 p.m. UTC | #1
On Tue, May 22, 2018 at 04:26:26PM +0200, Ulf Hansson wrote:
> Move the calls to ->prepare_hs400_tuning(), from mmc_retune() into

> mmc_hs400_to_hs200(), as it better belongs there, rather than being generic

> to all type of cards.

> 

> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>


Thanks Ulf,

this looks good to me. Do you want me to carry it in my hs400 for SDHI
series, which would allow me to exercise it there before it is applied,
or will you go ahead and apply it?

In any case:

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>


> ---

>  drivers/mmc/core/host.c | 3 ---

>  drivers/mmc/core/mmc.c  | 4 ++++

>  2 files changed, 4 insertions(+), 3 deletions(-)

> 

> diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c

> index c57ffff..abf9e88 100644

> --- a/drivers/mmc/core/host.c

> +++ b/drivers/mmc/core/host.c

> @@ -143,9 +143,6 @@ int mmc_retune(struct mmc_host *host)

>  			goto out;

>  

>  		return_to_hs400 = true;

> -

> -		if (host->ops->prepare_hs400_tuning)

> -			host->ops->prepare_hs400_tuning(host, &host->ios);

>  	}

>  

>  	err = mmc_execute_tuning(host->card);

> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c

> index 57a8bd3..4466f5d 100644

> --- a/drivers/mmc/core/mmc.c

> +++ b/drivers/mmc/core/mmc.c

> @@ -1282,6 +1282,10 @@ int mmc_hs400_to_hs200(struct mmc_card *card)

>  

>  	mmc_set_bus_speed(card);

>  

> +	/* Prepare tuning for HS400 mode. */

> +	if (host->ops->prepare_hs400_tuning)

> +		host->ops->prepare_hs400_tuning(host, &host->ios);

> +

>  	return 0;

>  

>  out_err:

> -- 

> 2.7.4

> 

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Simon Horman May 28, 2018, 12:45 p.m. UTC | #2
On Mon, May 28, 2018 at 02:41:15PM +0200, Simon Horman wrote:
> On Tue, May 22, 2018 at 04:26:26PM +0200, Ulf Hansson wrote:

> > Move the calls to ->prepare_hs400_tuning(), from mmc_retune() into

> > mmc_hs400_to_hs200(), as it better belongs there, rather than being generic

> > to all type of cards.

> > 

> > Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

> 

> Thanks Ulf,

> 

> this looks good to me. Do you want me to carry it in my hs400 for SDHI

> series, which would allow me to exercise it there before it is applied,

> or will you go ahead and apply it?


I now see its already present in mmc/next :)

> In any case:

> 

> Reviewed-by: Simon Horman <horms+renesas@verge.net.au>

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ulf Hansson May 29, 2018, 10:23 a.m. UTC | #3
On 28 May 2018 at 14:45, Simon Horman <horms@verge.net.au> wrote:
> On Mon, May 28, 2018 at 02:41:15PM +0200, Simon Horman wrote:

>> On Tue, May 22, 2018 at 04:26:26PM +0200, Ulf Hansson wrote:

>> > Move the calls to ->prepare_hs400_tuning(), from mmc_retune() into

>> > mmc_hs400_to_hs200(), as it better belongs there, rather than being generic

>> > to all type of cards.

>> >

>> > Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

>>

>> Thanks Ulf,

>>

>> this looks good to me. Do you want me to carry it in my hs400 for SDHI

>> series, which would allow me to exercise it there before it is applied,

>> or will you go ahead and apply it?

>

> I now see its already present in mmc/next :)

>

>> In any case:

>>

>> Reviewed-by: Simon Horman <horms+renesas@verge.net.au>


Thanks, added your tag to the commit.

Kind regards
Uffe
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox series

Patch

diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index c57ffff..abf9e88 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -143,9 +143,6 @@  int mmc_retune(struct mmc_host *host)
 			goto out;
 
 		return_to_hs400 = true;
-
-		if (host->ops->prepare_hs400_tuning)
-			host->ops->prepare_hs400_tuning(host, &host->ios);
 	}
 
 	err = mmc_execute_tuning(host->card);
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 57a8bd3..4466f5d 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1282,6 +1282,10 @@  int mmc_hs400_to_hs200(struct mmc_card *card)
 
 	mmc_set_bus_speed(card);
 
+	/* Prepare tuning for HS400 mode. */
+	if (host->ops->prepare_hs400_tuning)
+		host->ops->prepare_hs400_tuning(host, &host->ios);
+
 	return 0;
 
 out_err: