All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms+renesas@verge.net.au>
To: Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Ulf Hansson <ulf.hansson@linaro.org>
Cc: Magnus Damm <magnus.damm@gmail.com>,
	linux-mmc@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	Simon Horman <horms+renesas@verge.net.au>
Subject: [PATCH v4 1/4] mmc: core: select HS400 from HS200 tuning function
Date: Wed, 18 Apr 2018 11:56:57 +0200	[thread overview]
Message-ID: <20180418095700.29948-2-horms+renesas@verge.net.au> (raw)
In-Reply-To: <20180418095700.29948-1-horms+renesas@verge.net.au>

Call mmc_select_hs400() from mmc_hs200_tuning().

This should have no run-time effect as the existing call to
mmc_select_hs400() is right after a call to mmc_hs200_tuning() in
mmc_init_card() and that is the only caller of mmc_hs200_tuning().

This is in preparation for adding a new mmc_host_opp to be called
after tuning and selecting HS400 - or in other words,
after mmc_execute_tuning() and mmc_select_hs400().

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
v4
- New patch
---
 drivers/mmc/core/mmc.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 6f8ebd6caa4c..099b327e10ca 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1508,6 +1508,7 @@ static int mmc_select_timing(struct mmc_card *card)
 static int mmc_hs200_tuning(struct mmc_card *card)
 {
 	struct mmc_host *host = card->host;
+	int err;
 
 	/*
 	 * Timing should be adjusted to the HS400 target
@@ -1518,7 +1519,11 @@ static int mmc_hs200_tuning(struct mmc_card *card)
 		if (host->ops->prepare_hs400_tuning)
 			host->ops->prepare_hs400_tuning(host, &host->ios);
 
-	return mmc_execute_tuning(card);
+	err = mmc_execute_tuning(card);
+	if (err)
+		return err;
+
+	return mmc_select_hs400(card);
 }
 
 /*
@@ -1733,10 +1738,6 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
 		err = mmc_hs200_tuning(card);
 		if (err)
 			goto free_card;
-
-		err = mmc_select_hs400(card);
-		if (err)
-			goto free_card;
 	} else if (!mmc_card_hs400es(card)) {
 		/* Select the desired bus width optionally */
 		err = mmc_select_bus_width(card);
-- 
2.11.0

  reply	other threads:[~2018-04-18  9:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-18  9:56 [PATCH v4 0/4] mmc: renesas_sdhi: add eMMC HS400 mode support Simon Horman
2018-04-18  9:56 ` Simon Horman [this message]
2018-04-18  9:56 ` [PATCH v4 2/4] mmc: core: more fine-grained hooks for HS400 tuning Simon Horman
2018-05-22 14:32   ` Ulf Hansson
2018-05-28 12:39     ` Simon Horman
2018-04-18  9:56 ` [PATCH v4 3/4] mmc: tmio: add eMMC HS400 mode support Simon Horman
2018-04-18  9:57 ` [PATCH v4 4/4] mmc: renesas_sdhi: " Simon Horman
2018-05-13  8:23 ` [PATCH v4 0/4] " Simon Horman
2018-05-21 14:34   ` Ulf Hansson

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=20180418095700.29948-2-horms+renesas@verge.net.au \
    --to=horms+renesas@verge.net.au \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=ulf.hansson@linaro.org \
    --cc=wsa+renesas@sang-engineering.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.