linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: linux-mmc@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org,
	"Yoshihiro Shimoda" <yoshihiro.shimoda.uh@renesas.com>,
	"Niklas Söderlund" <niklas.soderlund@ragnatech.se>,
	"Wolfram Sang" <wsa+renesas@sang-engineering.com>
Subject: [PATCH RFT 2/3] mmc: renesas_sdhi: clarify handling of selecting TAPs
Date: Fri,  6 Mar 2020 10:31:58 +0100	[thread overview]
Message-ID: <20200306093159.6155-3-wsa+renesas@sang-engineering.com> (raw)
In-Reply-To: <20200306093159.6155-1-wsa+renesas@sang-engineering.com>

The comment and the define about how TAPs are selected were confusing to
me because the good TAP was only valid if it was bigger than a *_MAX_*
value. Rename the define and adapt the comment to what really happens.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/mmc/host/renesas_sdhi_core.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
index f3ef26e29e8f..beac70a0defb 100644
--- a/drivers/mmc/host/renesas_sdhi_core.c
+++ b/drivers/mmc/host/renesas_sdhi_core.c
@@ -422,7 +422,7 @@ static int renesas_sdhi_prepare_hs400_tuning(struct mmc_host *mmc, struct mmc_io
 	return 0;
 }
 
-#define SH_MOBILE_SDHI_MAX_TAP 3
+#define SH_MOBILE_SDHI_MIN_TAP_ROW 3
 
 static int renesas_sdhi_select_tuning(struct tmio_mmc_host *host)
 {
@@ -446,9 +446,9 @@ static int renesas_sdhi_select_tuning(struct tmio_mmc_host *host)
 	}
 
 	/*
-	 * Find the longest consecutive run of successful probes.  If that
-	 * is more than SH_MOBILE_SDHI_MAX_TAP probes long then use the
-	 * center index as the tap.
+	 * Find the longest consecutive run of successful probes. If that
+	 * is at least SH_MOBILE_SDHI_MIN_TAP_ROW probes long then use the
+	 * center index as the tap, otherwise bail out.
 	 */
 	bitmap_for_each_set_region(priv->taps, rs, re, 0, taps_size) {
 		if (re - 1 - rs > tap_cnt) {
@@ -458,7 +458,7 @@ static int renesas_sdhi_select_tuning(struct tmio_mmc_host *host)
 		}
 	}
 
-	if (tap_cnt >= SH_MOBILE_SDHI_MAX_TAP)
+	if (tap_cnt >= SH_MOBILE_SDHI_MIN_TAP_ROW)
 		priv->tap_set = (tap_start + tap_end) / 2 % priv->tap_num;
 	else
 		return -EIO;
-- 
2.20.1


  parent reply	other threads:[~2020-03-06  9:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-06  9:31 [PATCH RFT 0/3] mmc: renesas_sdhi: improve TAP selection if all TAPs are good Wolfram Sang
2020-03-06  9:31 ` [PATCH RFT 1/3] mmc: renesas_sdhi: refactor calculation of best TAP Wolfram Sang
2020-03-26  7:04   ` Yoshihiro Shimoda
2020-04-07 15:06     ` Wolfram Sang
2020-03-06  9:31 ` Wolfram Sang [this message]
2020-03-26  7:06   ` [PATCH RFT 2/3] mmc: renesas_sdhi: clarify handling of selecting TAPs Yoshihiro Shimoda
2020-03-06  9:31 ` [PATCH RFT 3/3] mmc: renesas_sdhi: improve TAP selection if all TAPs are good Wolfram Sang
2020-03-26  7:14   ` Yoshihiro Shimoda
2020-03-26  8:38 ` [PATCH RFT 0/3] " Yoshihiro Shimoda
2020-04-07 15:07   ` Wolfram Sang

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=20200306093159.6155-3-wsa+renesas@sang-engineering.com \
    --to=wsa+renesas@sang-engineering.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=niklas.soderlund@ragnatech.se \
    --cc=yoshihiro.shimoda.uh@renesas.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 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).