CIP-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4.19.y-cip] mmc: renesas_sdhi: abort tuning when timeout detected
@ 2026-10-29 12:14 Lad Prabhakar
  2026-11-09  2:22 ` nobuhiro.iwamatsu.x90
  0 siblings, 1 reply; 4+ messages in thread
From: Lad Prabhakar @ 2026-10-29 12:14 UTC (permalink / raw)
  To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek; +Cc: Biju Das

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

commit 2c9017d0b5d3fbf17e69577a42d9e610ca122810 upstream.

We have to bring the eMMC from sending-data state back to transfer state
once we detected a CRC error (timeout) during tuning. So, send a stop
command via mmc_abort_tuning().

Fixes: 4f11997773b6 ("mmc: tmio: Add tuning support")
Reported-by Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Tested-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Link: https://lore.kernel.org/r/20210602073435.5955-1-wsa+renesas@sang-engineering.com
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
[PL: manually applied the changes]
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
 drivers/mmc/host/tmio_mmc_core.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c
index 72ac12eb89b0d..caefbacf56f5d 100644
--- a/drivers/mmc/host/tmio_mmc_core.c
+++ b/drivers/mmc/host/tmio_mmc_core.c
@@ -745,13 +745,18 @@ static int tmio_mmc_execute_tuning(struct mmc_host *mmc, u32 opcode)
 
 	/* Issue CMD19 twice for each tap */
 	for (i = 0; i < 2 * host->tap_num; i++) {
+		int cmd_error = 0;
+
 		if (host->prepare_tuning)
 			host->prepare_tuning(host, i % host->tap_num);
 
-		ret = mmc_send_tuning(mmc, opcode, NULL);
+		ret = mmc_send_tuning(mmc, opcode, &cmd_error);
 		if (ret == 0)
 			set_bit(i, host->taps);
 
+		if (cmd_error)
+			mmc_abort_tuning(mmc, opcode);
+
 		usleep_range(1000, 1200);
 	}
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [PATCH 4.19.y-cip] mmc: renesas_sdhi: abort tuning when timeout detected
  2026-10-29 12:14 [PATCH 4.19.y-cip] mmc: renesas_sdhi: abort tuning when timeout detected Lad Prabhakar
@ 2026-11-09  2:22 ` nobuhiro.iwamatsu.x90
  2026-11-09  9:51   ` [cip-dev] " Pavel Machek
  0 siblings, 1 reply; 4+ messages in thread
From: nobuhiro.iwamatsu.x90 @ 2026-11-09  2:22 UTC (permalink / raw)
  To: prabhakar.mahadev-lad.rj, cip-dev, pavel, uli; +Cc: biju.das.jz

Hi all,

> -----Original Message-----
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> Sent: Thursday, October 29, 2026 9:15 PM
> To: cip-dev@lists.cip-project.org; iwamatsu nobuhiro(岩松 信洋 □DITC○
> CPT) <nobuhiro.iwamatsu.x90@mail.toshiba>; Pavel Machek
> <pavel@nabladev.com>
> Cc: Biju Das <biju.das.jz@bp.renesas.com>
> Subject: [PATCH 4.19.y-cip] mmc: renesas_sdhi: abort tuning when timeout
> detected
> 
> From: Wolfram Sang <wsa+renesas@sang-engineering.com>
> 
> commit 2c9017d0b5d3fbf17e69577a42d9e610ca122810 upstream.
> 
> We have to bring the eMMC from sending-data state back to transfer state once
> we detected a CRC error (timeout) during tuning. So, send a stop command via
> mmc_abort_tuning().
> 
> Fixes: 4f11997773b6 ("mmc: tmio: Add tuning support") Reported-by Yoshihiro
> Shimoda <yoshihiro.shimoda.uh@renesas.com>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> Tested-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> Link:
> https://lore.kernel.org/r/20210602073435.5955-1-wsa+renesas@sang-engine
> ering.com
> Cc: stable@vger.kernel.org
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> [PL: manually applied the changes]
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> ---
>  drivers/mmc/host/tmio_mmc_core.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)

I reviewed this series, looks good to me.

Reviewed-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.x90@mail.toshiba>

Best regards,
  Nobuhiro

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [cip-dev] [PATCH 4.19.y-cip] mmc: renesas_sdhi: abort tuning when timeout detected
  2026-11-09  2:22 ` nobuhiro.iwamatsu.x90
@ 2026-11-09  9:51   ` Pavel Machek
  2026-11-09 16:49     ` Ulrich Hecht
  0 siblings, 1 reply; 4+ messages in thread
From: Pavel Machek @ 2026-11-09  9:51 UTC (permalink / raw)
  To: nobuhiro.iwamatsu.x90, uli
  Cc: prabhakar.mahadev-lad.rj, cip-dev, pavel, uli, biju.das.jz

[-- Attachment #1: Type: text/plain, Size: 1320 bytes --]

Hi!

> > From: Wolfram Sang <wsa+renesas@sang-engineering.com>
> > 
> > commit 2c9017d0b5d3fbf17e69577a42d9e610ca122810 upstream.
> > 
> > We have to bring the eMMC from sending-data state back to transfer state once
> > we detected a CRC error (timeout) during tuning. So, send a stop command via
> > mmc_abort_tuning().
> > 
> > Fixes: 4f11997773b6 ("mmc: tmio: Add tuning support") Reported-by Yoshihiro
> > Shimoda <yoshihiro.shimoda.uh@renesas.com>
> > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> > Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> > Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> > Tested-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> > Link:
> > https://lore.kernel.org/r/20210602073435.5955-1-wsa+renesas@sang-engine
> > ering.com
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> > [PL: manually applied the changes]
> > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> 
> I reviewed this series, looks good to me.
> 
> Reviewed-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.x90@mail.toshiba>

Patch looks okay to me, too. Adding Ulrich to the cc.

Reviewed-by: Pavel Machek <pavel@nabladev.com>

Best regards,
								Pavel

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [cip-dev] [PATCH 4.19.y-cip] mmc: renesas_sdhi: abort tuning when timeout detected
  2026-11-09  9:51   ` [cip-dev] " Pavel Machek
@ 2026-11-09 16:49     ` Ulrich Hecht
  0 siblings, 0 replies; 4+ messages in thread
From: Ulrich Hecht @ 2026-11-09 16:49 UTC (permalink / raw)
  To: pavel, nobuhiro.iwamatsu.x90
  Cc: prabhakar.mahadev-lad.rj, cip-dev, biju.das.jz

Hi!

> On 11/09/2026 10:51 AM CET Pavel Machek via cip-dev <pavel=nabladev.com@lists.cip-project.org> wrote:
> > > From: Wolfram Sang <wsa+renesas@sang-engineering.com>
> > > 
> > > commit 2c9017d0b5d3fbf17e69577a42d9e610ca122810 upstream.
> > > 
> > > We have to bring the eMMC from sending-data state back to transfer state once
> > > we detected a CRC error (timeout) during tuning. So, send a stop command via
> > > mmc_abort_tuning().
> > > 
> > > Fixes: 4f11997773b6 ("mmc: tmio: Add tuning support") Reported-by Yoshihiro
> > > Shimoda <yoshihiro.shimoda.uh@renesas.com>
> > > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> > > Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> > > Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> > > Tested-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> > > Link:
> > > https://lore.kernel.org/r/20210602073435.5955-1-wsa+renesas@sang-engine
> > > ering.com
> > > Cc: stable@vger.kernel.org
> > > Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> > > [PL: manually applied the changes]
> > > Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> > 
> > I reviewed this series, looks good to me.
> > 
> > Reviewed-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.x90@mail.toshiba>
> 
> Patch looks okay to me, too. Adding Ulrich to the cc.
> 
> Reviewed-by: Pavel Machek <pavel@nabladev.com>

Applied, thanks.

CU
Uli

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-09 16:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-29 12:14 [PATCH 4.19.y-cip] mmc: renesas_sdhi: abort tuning when timeout detected Lad Prabhakar
2026-11-09  2:22 ` nobuhiro.iwamatsu.x90
2026-11-09  9:51   ` [cip-dev] " Pavel Machek
2026-11-09 16:49     ` Ulrich Hecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox