From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Cc: "linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
"linux-renesas-soc@vger.kernel.org"
<linux-renesas-soc@vger.kernel.org>
Subject: Re: [PATCH 2/2] mmc: renesas_sdhi: keep SCC clock active when tuning
Date: Tue, 1 Sep 2020 12:24:16 +0200 [thread overview]
Message-ID: <20200901102416.GA2971@ninjato> (raw)
In-Reply-To: <TY2PR01MB3692C46B1A21109E7CC03478D8520@TY2PR01MB3692.jpnprd01.prod.outlook.com>
[-- Attachment #1: Type: text/plain, Size: 2672 bytes --]
Hi Shimoda-san,
> I got a report from a colleague about this issue. According to the report,
> this issue is related to retuning. When retuning happens, the mmc core
> calls mmc_hs400_to_hs200() and then mmc_hs400_to_hs200() will set the clock
> as 52MHz at first. So, it's possible to cause the issue.
>
> It's difficult to cause retuning in normal situation. But, according to
> the report, if we add a code which the sdhi driver reports an error
> at the first CMD18 once, we can cause retuning and then the issue happens.
I took the liberty of a different approach because I wanted to reproduce
the issue when doing the initial tuning and not a retune. Because my new
series adds (and checks) a flag for doing_initial_tune, so I really
wanted to excercise this code path. This is a real problem, too, because
I saw this with my boards earlier back then.
And halleluja, today I saw it again, once. I switched to my H3-ES2.0
board which I haven't used for weeks. And when booting that for the
first time, I got a failure including logs. Later boots just went fine.
And because of the logs, I could finally inject an error which will
reproducibly cause the boot to hang because of a stalled SCC. Tada, here
is the patch:
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
Subject: [PATCH] GOLD: simulate stalled SCC
Geez, this took ages to find...
---
drivers/mmc/core/mmc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 216bd1aed373..6b3056437b37 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1218,6 +1218,7 @@ static int mmc_select_hs400(struct mmc_card *card)
host->ops->hs400_complete(host);
err = mmc_switch_status(card, true);
+ err = -EILSEQ;
if (err)
goto out_err;
Interestingly, the other mmc_switch_status() in mmc_select_hs400() was
not stalling the SCC. Anyhow, after this failute, the MMC core switches
back to 300kHz and the SCC clock is off but for some reason SCC is still
accessed. I will investigate why. The good news is that my new patch set
fixes the hang as expected. The board will continue to boot so we
probably want to have this series. However, I have the feeling that this
SCC access which hangs the board might be a bug because of an unintended
code path. I mean, this is also one reason why the bug triggers so
rarely these days. We have been fixing a lot of things and the SCC is
only accessed when it should be accessed. We will see. I also need to
test other boards, too.
So much for now, I hope I can report more later.
Happy hacking and kind regards,
Wolfram
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2020-09-01 10:24 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-04 11:20 [PATCH 0/2] renesas_sdhi: fix hang when SCC loses its clock Wolfram Sang
2020-06-04 11:20 ` [PATCH 1/2] mmc: core: when downgrading HS400, callback into drivers earlier Wolfram Sang
2020-06-08 6:02 ` Yoshihiro Shimoda
2020-06-08 20:41 ` Wolfram Sang
2020-06-09 10:35 ` Yoshihiro Shimoda
2020-06-04 11:20 ` [PATCH 2/2] mmc: renesas_sdhi: keep SCC clock active when tuning Wolfram Sang
2020-06-08 6:35 ` Yoshihiro Shimoda
2020-06-08 21:27 ` Wolfram Sang
2020-06-09 10:41 ` Yoshihiro Shimoda
2020-08-14 7:15 ` Wolfram Sang
2020-08-28 0:51 ` Yoshihiro Shimoda
2020-09-01 10:24 ` Wolfram Sang [this message]
2020-09-01 13:39 ` 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=20200901102416.GA2971@ninjato \
--to=wsa+renesas@sang-engineering.com \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--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