From: Stefan Agner <stefan@agner.ch>
To: adrian.hunter@intel.com, aisheng.dong@nxp.com, fabio.estevam@nxp.com
Cc: linux-mmc-owner@vger.kernel.org, linux-mmc@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: Self-detected stall on CPU when using SD card
Date: Tue, 26 Jun 2018 16:45:37 +0200 [thread overview]
Message-ID: <0f262b04fab61ec75b7e368a8f4968aa@agner.ch> (raw)
In-Reply-To: <037cbd3560a68bad0cea92f453c1b819@agner.ch>
On 26.06.2018 12:53, Stefan Agner wrote:
> Hi,
>
> On our Colibri iMX6 (arch/arm/boot/dts/imx6qdl-colibri.dtsi) we
> experience the following stack trace when a SD card is plugged in:
>
[...]
> [<c08396f4>] (esdhc_pltfm_set_clock) from [<c083622c>]
> (sdhci_set_ios+0xd8/0x584)
> r10:ffffe000 r9:c1105900 r8:00004097 r7:d818f2e8 r6:d818f480
> r5:d818f2e8
> r4:d818f000
> [<c0836154>] (sdhci_set_ios) from [<c0836070>]
> (sdhci_runtime_resume_host+0xa0/0x184)
> r9:c1105900 r8:00004097 r7:d818f2e8 r6:d818f648 r5:d818f000 r4:d818f480
[...]
>
> It used to work in v4.9, so I started a git bisect. It pointed me to
> this commit:
>
> Commit d1e4f74f911d ("mmc: sdhci: Do not use spin lock in set_ios
> paths").
>
> Reverting the commit on-top of v4.18-rc1 seems to fix the issue too.
>
> Any idea?
I figured out that the same platform had a GPIO Key which triggered all
the time. This seems to exacerbate the MMC issue such that it triggers
on very boot, about rootfs mount time.
This change seems to fix the issue as well, not sure though whether this
is a proper fix:
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -697,6 +697,7 @@ static inline void esdhc_pltfm_set_clock(struct
sdhci_host *host,
int ddr_pre_div = imx_data->is_ddr ? 2 : 1;
int pre_div = 1;
int div = 1;
+ unsigned long flags;
u32 temp, val;
if (clock == 0) {
@@ -724,6 +725,7 @@ static inline void esdhc_pltfm_set_clock(struct
sdhci_host *host,
pre_div = 2;
}
+ spin_lock_irqsave(&host->lock, flags);
temp = sdhci_readl(host, ESDHC_SYSTEM_CONTROL);
temp &= ~(ESDHC_CLOCK_IPGEN | ESDHC_CLOCK_HCKEN |
ESDHC_CLOCK_PEREN
| ESDHC_CLOCK_MASK);
@@ -754,6 +756,7 @@ static inline void esdhc_pltfm_set_clock(struct
sdhci_host *host,
writel(val | ESDHC_VENDOR_SPEC_FRC_SDCLK_ON,
host->ioaddr + ESDHC_VENDOR_SPEC);
}
+ spin_unlock_irqrestore(&host->lock, flags);
mdelay(1);
}
--
Stefan
next prev parent reply other threads:[~2018-06-26 14:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-26 10:53 Self-detected stall on CPU when using SD card Stefan Agner
2018-06-26 14:45 ` Stefan Agner [this message]
2018-07-03 13:13 ` Stefan Agner
2018-07-05 3:13 ` A.s. Dong
2018-07-05 11:10 ` Stefan Agner
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=0f262b04fab61ec75b7e368a8f4968aa@agner.ch \
--to=stefan@agner.ch \
--cc=adrian.hunter@intel.com \
--cc=aisheng.dong@nxp.com \
--cc=fabio.estevam@nxp.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mmc-owner@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
/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).