From: Lee Jones <lee@kernel.org>
To: lee@kernel.org, Wolfram Sang <wsa+renesas@sang-engineering.com>,
Ulf Hansson <ulfh@kernel.org>, Josua Mayer <josua@solid-run.com>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Phil Blundell <pb@handhelds.org>,
Samuel Ortiz <sameo@openedhand.com>,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
linux-mmc@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org
Subject: [PATCH 12/13] mmc: renesas_sdhi: Fix SDIO manual tap correction in SDR104 mode
Date: Mon, 23 Nov 2026 19:15:56 +0000 [thread overview]
Message-ID: <20261123191703.179283-13-lee@kernel.org> (raw)
In-Reply-To: <20261123191703.179283-1-lee@kernel.org>
Commit 30fa7d53afd4 ("mmc: host: renesas_sdhi: Fix incorrect auto
retuning for an SDIO card") switched SDIO cards from automatic to manual
SCC tap correction so that DAT1 SDIO interrupts would not spuriously
shift the sampling tap, but exposed two logic errors in the manual
correction path:
1. renesas_sdhi_manual_correction() checks !priv->card_is_sdio instead
of priv->card_is_sdio before ignoring DAT1 mismatches, so the SDIO
DAT1 check never executes for SDIO cards.
2. renesas_sdhi_check_scc_error() already returns early when running in
4-tap HS400 mode, yet still passes the hs400_4taps quirk flag as
use_4tap to renesas_sdhi_manual_correction(), halving the 8-tap
SDR104 and HS200 tap index when writing SH_MOBILE_SDHI_SCC_TAPSET on
SoCs with hs400_4taps.
Check priv->card_is_sdio without negation and drop the unused 4-tap
division from renesas_sdhi_manual_correction().
Fixes: 30fa7d53afd4 ("mmc: host: renesas_sdhi: Fix incorrect auto retuning for an SDIO card")
Closes: https://sashiko.dev/#/bug/linux-735317da-fe00-4630-b954-5dcc1052aaa8
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/mmc/host/renesas_sdhi_core.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
index cb35360239bf..497c7c75f966 100644
--- a/drivers/mmc/host/renesas_sdhi_core.c
+++ b/drivers/mmc/host/renesas_sdhi_core.c
@@ -741,7 +741,7 @@ static int renesas_sdhi_execute_tuning(struct mmc_host *mmc, u32 opcode)
return ret;
}
-static bool renesas_sdhi_manual_correction(struct tmio_mmc_host *host, bool use_4tap)
+static bool renesas_sdhi_manual_correction(struct tmio_mmc_host *host)
{
struct renesas_sdhi *priv = host_to_priv(host);
unsigned int new_tap = priv->tap_set, error_tap = priv->tap_set;
@@ -783,7 +783,7 @@ static bool renesas_sdhi_manual_correction(struct tmio_mmc_host *host, bool use_
if (bad_taps & BIT(new_tap % priv->tap_num))
return test_bit(error_tap % priv->tap_num, priv->smpcmp);
} else {
- if (!priv->card_is_sdio &&
+ if (priv->card_is_sdio &&
!(val & SH_MOBILE_SDHI_SCC_RVSREQ_RVSERR)) {
u32 smpcmp = sd_scc_read32(host, priv, SH_MOBILE_SDHI_SCC_SMPCMP);
@@ -802,8 +802,7 @@ static bool renesas_sdhi_manual_correction(struct tmio_mmc_host *host, bool use_
}
priv->tap_set = (new_tap % priv->tap_num);
- sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_TAPSET,
- priv->tap_set / (use_4tap ? 2 : 1));
+ sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_TAPSET, priv->tap_set);
return false;
}
@@ -854,7 +853,7 @@ static bool renesas_sdhi_check_scc_error(struct tmio_mmc_host *host,
SH_MOBILE_SDHI_SCC_RVSCNTL_RVSEN)
ret |= renesas_sdhi_auto_correction(host);
else
- ret |= renesas_sdhi_manual_correction(host, use_4tap);
+ ret |= renesas_sdhi_manual_correction(host);
return ret;
}
--
2.56.1.750.gf70dc682cf-goog
next prev parent reply other threads:[~2026-11-23 19:18 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 19:15 [PATCH 00/13] mmc: Assorted bug fixes across MMC host drivers Lee Jones
2026-11-23 19:15 ` [PATCH 01/13] mmc: cavium: Remove MMC slots before destroying slot platform devices Lee Jones
2026-11-23 19:15 ` [PATCH 02/13] mmc: cavium: Prevent slot_pdev[] out-of-bounds write during probe Lee Jones
2026-11-23 19:15 ` [PATCH 03/13] mmc: sdhci-msm: Resume runtime PM before accessing registers on remove Lee Jones
2026-11-23 19:15 ` [PATCH 04/13] mmc: meson-gx: Fail request when descriptor chain DMA mapping fails Lee Jones
2026-11-23 19:15 ` [PATCH 05/13] mmc: jz4740: Skip DMA cleanup in PIO mode during post_req Lee Jones
2026-11-23 19:15 ` [PATCH 06/13] mmc: renesas_sdhi: Guard host->cmd access in internal DMAC issue work Lee Jones
2026-11-23 19:15 ` [PATCH 07/13] mmc: tifm_sd: Synchronise timeout handler with request completion Lee Jones
2026-11-23 19:15 ` [PATCH 08/13] mmc: omap: Shut down cover timer before disabling cover BH work Lee Jones
2026-11-23 19:15 ` [PATCH 09/13] mmc: renesas_sdhi: Disable internal DMAC BH work items on release Lee Jones
2026-11-23 19:15 ` [PATCH 10/13] mmc: jz4740: Apply DMA max_seg_size limit to unified tx-rx channel Lee Jones
2026-11-23 19:15 ` [PATCH 11/13] mmc: dw_mmc: Disarm central watchdog when ending a request Lee Jones
2026-11-23 19:15 ` Lee Jones [this message]
2026-11-23 19:15 ` [PATCH 13/13] mmc: sdhci-brcmstb: Handle absent optional sdio_freq clock in probe Lee Jones
2026-11-23 19:31 ` Florian Fainelli
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=20261123191703.179283-13-lee@kernel.org \
--to=lee@kernel.org \
--cc=geert+renesas@glider.be \
--cc=josua@solid-run.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=pb@handhelds.org \
--cc=sameo@openedhand.com \
--cc=stable@vger.kernel.org \
--cc=ulfh@kernel.org \
--cc=wsa+renesas@sang-engineering.com \
--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