From: haibo.chen@nxp.com
To: adrian.hunter@intel.com, ulf.hansson@linaro.org,
linux-mmc@vger.kernel.org
Cc: linux-imx@nxp.com, haibo.chen@nxp.com
Subject: [PATCH] mmc: sdhci: correct the tuning command handle for PIO mode
Date: Fri, 13 Aug 2021 20:34:01 +0800 [thread overview]
Message-ID: <1628858041-1911-1-git-send-email-haibo.chen@nxp.com> (raw)
From: Haibo Chen <haibo.chen@nxp.com>
If sdhci use PIO mode, and use mmc_send_tuning() to send the
tuning command, system will stuck because of the storm irq
of sdhci. For PIO mode, use mmc_send_tuning(), it will trigger
buffer_read_ready interrupt and data transfer complete interrupt.
In current code logic, it will directly return in sdhci_data_irq,
can not call the sdhci_transfer_pio(). So the buffer_read_ready
interrupt storm happen. So for standard tuning method, need to
excluse this case.
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
---
drivers/mmc/host/sdhci.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index aba6e10b8605..acee54b368b0 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -3278,8 +3278,14 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask)
{
u32 command;
- /* CMD19 generates _only_ Buffer Read Ready interrupt */
- if (intmask & SDHCI_INT_DATA_AVAIL) {
+ /*
+ * CMD19 generates _only_ Buffer Read Ready interrupt if
+ * use sdhci_send_tuning.
+ * Need to exclude this case: PIO mode and use mmc_send_tuning,
+ * If not, sdhci_transfer_pio will never be called, make the
+ * SDHCI_INT_DATA_AVAIL always there, stuck in irq storm.
+ */
+ if ((intmask & SDHCI_INT_DATA_AVAIL) && (!host->data)) {
command = SDHCI_GET_CMD(sdhci_readw(host, SDHCI_COMMAND));
if (command == MMC_SEND_TUNING_BLOCK ||
command == MMC_SEND_TUNING_BLOCK_HS200) {
--
2.17.1
next reply other threads:[~2021-08-13 12:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-13 12:34 haibo.chen [this message]
2021-08-20 11:04 ` [PATCH] mmc: sdhci: correct the tuning command handle for PIO mode Adrian Hunter
2021-08-20 11:06 ` Adrian Hunter
2021-08-24 14:56 ` Ulf Hansson
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=1628858041-1911-1-git-send-email-haibo.chen@nxp.com \
--to=haibo.chen@nxp.com \
--cc=adrian.hunter@intel.com \
--cc=linux-imx@nxp.com \
--cc=linux-mmc@vger.kernel.org \
--cc=ulf.hansson@linaro.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