All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] mmc: {tmio,renesas_sdhi}: retune if SCC error detected
@ 2018-07-25 12:10 Niklas Söderlund
  2018-07-25 12:10 ` [PATCH 1/2] mmc: renesas_sdhi: skip SCC error check when retuning Niklas Söderlund
  2018-07-25 12:10 ` [PATCH 2/2] mmc: tmio: Fix SCC error detection Niklas Söderlund
  0 siblings, 2 replies; 6+ messages in thread
From: Niklas Söderlund @ 2018-07-25 12:10 UTC (permalink / raw)
  To: Wolfram Sang, Ulf Hansson, linux-mmc
  Cc: linux-renesas-soc, Niklas Söderlund

Hi,

These patches triggers a retune if a SCC error is detected. They where 
ported from the renesas BSP. Masaharu-san did all the real work I just 
ported them to upstream and did small fixups.

These patches where broken out of my retuning series as more work where 
needed to adapt them to the recent HS400 series picked-up. It's tested 
on M3-N using both HS200 and HS400 and on H3 ES2.0 using HS200.

Masaharu Hayakawa (2):
  mmc: renesas_sdhi: skip SCC error check when retuning
  mmc: tmio: Fix SCC error detection

 drivers/mmc/host/renesas_sdhi_core.c | 9 +++++++++
 drivers/mmc/host/tmio_mmc_core.c     | 4 ++--
 2 files changed, 11 insertions(+), 2 deletions(-)

-- 
2.18.0

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

* [PATCH 1/2] mmc: renesas_sdhi: skip SCC error check when retuning
  2018-07-25 12:10 [PATCH 0/2] mmc: {tmio,renesas_sdhi}: retune if SCC error detected Niklas Söderlund
@ 2018-07-25 12:10 ` Niklas Söderlund
  2018-07-25 12:21   ` Wolfram Sang
  2018-07-25 12:10 ` [PATCH 2/2] mmc: tmio: Fix SCC error detection Niklas Söderlund
  1 sibling, 1 reply; 6+ messages in thread
From: Niklas Söderlund @ 2018-07-25 12:10 UTC (permalink / raw)
  To: Wolfram Sang, Ulf Hansson, linux-mmc
  Cc: linux-renesas-soc, Masaharu Hayakawa, Niklas Söderlund

From: Masaharu Hayakawa <masaharu.hayakawa.ry@renesas.com>

Checking for SCC error during retuning is unnecessary.

Signed-off-by: Masaharu Hayakawa <masaharu.hayakawa.ry@renesas.com>
[Niklas: fix small style issue]
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

---

* Changes since v3
- Add check for 4TAP for HS400.

* Changes since v2
- Added check for HS400 as it's now merged.
- Added tags from Wolfram.
---
 drivers/mmc/host/renesas_sdhi_core.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
index 777e32b0e410e850..2e0d2eafd62ebecf 100644
--- a/drivers/mmc/host/renesas_sdhi_core.c
+++ b/drivers/mmc/host/renesas_sdhi_core.c
@@ -444,6 +444,15 @@ static bool renesas_sdhi_check_scc_error(struct tmio_mmc_host *host)
 {
 	struct renesas_sdhi *priv = host_to_priv(host);
 
+	if (!(host->mmc->ios.timing == MMC_TIMING_UHS_SDR104) &&
+	    !(host->mmc->ios.timing == MMC_TIMING_MMC_HS200) &&
+	    !(host->mmc->ios.timing == MMC_TIMING_MMC_HS400 &&
+	      !(host->pdata->flags & TMIO_MMC_HAVE_4TAP_HS400)))
+		return false;
+
+	if (host->mmc->doing_retune)
+		return false;
+
 	/* Check SCC error */
 	if (sd_scc_read32(host, priv, SH_MOBILE_SDHI_SCC_RVSCNTL) &
 	    SH_MOBILE_SDHI_SCC_RVSCNTL_RVSEN &&
-- 
2.18.0

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

* [PATCH 2/2] mmc: tmio: Fix SCC error detection
  2018-07-25 12:10 [PATCH 0/2] mmc: {tmio,renesas_sdhi}: retune if SCC error detected Niklas Söderlund
  2018-07-25 12:10 ` [PATCH 1/2] mmc: renesas_sdhi: skip SCC error check when retuning Niklas Söderlund
@ 2018-07-25 12:10 ` Niklas Söderlund
  1 sibling, 0 replies; 6+ messages in thread
From: Niklas Söderlund @ 2018-07-25 12:10 UTC (permalink / raw)
  To: Wolfram Sang, Ulf Hansson, linux-mmc
  Cc: linux-renesas-soc, Masaharu Hayakawa, Niklas Söderlund

From: Masaharu Hayakawa <masaharu.hayakawa.ry@renesas.com>

SDR104 and HS200 need to check for SCC error. If SCC error is detected,
retuning is necessary.

Signed-off-by: Masaharu Hayakawa <masaharu.hayakawa.ry@renesas.com>
[Niklas: update commit message]
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 drivers/mmc/host/tmio_mmc_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c
index 72ac806e0c762d83..81883bc08524e441 100644
--- a/drivers/mmc/host/tmio_mmc_core.c
+++ b/drivers/mmc/host/tmio_mmc_core.c
@@ -920,8 +920,8 @@ static void tmio_mmc_finish_request(struct tmio_mmc_host *host)
 	if (mrq->cmd->error || (mrq->data && mrq->data->error))
 		tmio_mmc_abort_dma(host);
 
-	if (host->check_scc_error)
-		host->check_scc_error(host);
+	if (host->check_scc_error && host->check_scc_error(host))
+		mrq->cmd->error = -EILSEQ;
 
 	/* If SET_BLOCK_COUNT, continue with main command */
 	if (host->mrq && !mrq->cmd->error) {
-- 
2.18.0

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

* Re: [PATCH 1/2] mmc: renesas_sdhi: skip SCC error check when retuning
  2018-07-25 12:10 ` [PATCH 1/2] mmc: renesas_sdhi: skip SCC error check when retuning Niklas Söderlund
@ 2018-07-25 12:21   ` Wolfram Sang
  2018-07-25 13:36     ` Niklas Söderlund
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfram Sang @ 2018-07-25 12:21 UTC (permalink / raw)
  To: Niklas Söderlund
  Cc: Wolfram Sang, Ulf Hansson, linux-mmc, linux-renesas-soc,
	Masaharu Hayakawa

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

Hi Niklas,

> * Changes since v3
> - Add check for 4TAP for HS400.

Is it the same in the BSP or where does this info come from?


> +	if (!(host->mmc->ios.timing == MMC_TIMING_UHS_SDR104) &&
> +	    !(host->mmc->ios.timing == MMC_TIMING_MMC_HS200) &&
> +	    !(host->mmc->ios.timing == MMC_TIMING_MMC_HS400 &&
> +	      !(host->pdata->flags & TMIO_MMC_HAVE_4TAP_HS400)))

This becomes very hard to read. We need to simplify it.

And can you bounce me your debugging mail from today again? I seem to
have lost it :(

Thanks,

   Wolfram

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

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

* Re: [PATCH 1/2] mmc: renesas_sdhi: skip SCC error check when retuning
  2018-07-25 12:21   ` Wolfram Sang
@ 2018-07-25 13:36     ` Niklas Söderlund
  2018-07-26  7:34       ` Wolfram Sang
  0 siblings, 1 reply; 6+ messages in thread
From: Niklas Söderlund @ 2018-07-25 13:36 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Wolfram Sang, Ulf Hansson, linux-mmc, linux-renesas-soc,
	Masaharu Hayakawa

Hi Wolfram,

On 2018-07-25 14:21:07 +0200, Wolfram Sang wrote:
> Hi Niklas,
> 
> > * Changes since v3
> > - Add check for 4TAP for HS400.
> 
> Is it the same in the BSP or where does this info come from?

It comes from the BSP but I had to modify it to fit with the upstream 
implementation of 4 vs 8 taps. The original code from BSP:

        if (!(host->mmc->ios.timing == MMC_TIMING_UHS_SDR104) &&
            !(host->mmc->ios.timing == MMC_TIMING_MMC_HS200) &&
            !(host->mmc->ios.timing == MMC_TIMING_MMC_HS400 &&
              !host->hs400_use_4tap))
                return false;
> 
> 
> > +	if (!(host->mmc->ios.timing == MMC_TIMING_UHS_SDR104) &&
> > +	    !(host->mmc->ios.timing == MMC_TIMING_MMC_HS200) &&
> > +	    !(host->mmc->ios.timing == MMC_TIMING_MMC_HS400 &&
> > +	      !(host->pdata->flags & TMIO_MMC_HAVE_4TAP_HS400)))
> 
> This becomes very hard to read. We need to simplify it.

I agree but I could not find a neat way of doing it. How about?

    bool use_4tap = host->pdata->flags & TMIO_MMC_HAVE_4TAP_HS400;

    if (!(host->mmc->ios.timing == MMC_TIMING_UHS_SDR104) &&
	!(host->mmc->ios.timing == MMC_TIMING_MMC_HS200) &&
	!(host->mmc->ios.timing == MMC_TIMING_MMC_HS400 && !use_4tap))
	   return false;

> 
> And can you bounce me your debugging mail from today again? I seem to
> have lost it :(

Bounced.

> 
> Thanks,
> 
>    Wolfram



-- 
Regards,
Niklas S�derlund

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

* Re: [PATCH 1/2] mmc: renesas_sdhi: skip SCC error check when retuning
  2018-07-25 13:36     ` Niklas Söderlund
@ 2018-07-26  7:34       ` Wolfram Sang
  0 siblings, 0 replies; 6+ messages in thread
From: Wolfram Sang @ 2018-07-26  7:34 UTC (permalink / raw)
  To: Niklas Söderlund
  Cc: Wolfram Sang, Ulf Hansson, linux-mmc, linux-renesas-soc,
	Masaharu Hayakawa

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


> I agree but I could not find a neat way of doing it. How about?
> 
>     bool use_4tap = host->pdata->flags & TMIO_MMC_HAVE_4TAP_HS400;
> 
>     if (!(host->mmc->ios.timing == MMC_TIMING_UHS_SDR104) &&
> 	!(host->mmc->ios.timing == MMC_TIMING_MMC_HS200) &&
> 	!(host->mmc->ios.timing == MMC_TIMING_MMC_HS400 && !use_4tap))
> 	   return false;

Yeah, it's not much but the best I could think of right now, too. But it
definately is better.


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

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

end of thread, other threads:[~2018-07-26  8:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-25 12:10 [PATCH 0/2] mmc: {tmio,renesas_sdhi}: retune if SCC error detected Niklas Söderlund
2018-07-25 12:10 ` [PATCH 1/2] mmc: renesas_sdhi: skip SCC error check when retuning Niklas Söderlund
2018-07-25 12:21   ` Wolfram Sang
2018-07-25 13:36     ` Niklas Söderlund
2018-07-26  7:34       ` Wolfram Sang
2018-07-25 12:10 ` [PATCH 2/2] mmc: tmio: Fix SCC error detection Niklas Söderlund

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.