mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 3/5] mci: core: don't test 4-bit-buswidth support if MMC host lacks capability
Date: Thu, 30 Jan 2020 18:04:47 +0100	[thread overview]
Message-ID: <20200130170449.9761-4-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20200130170449.9761-1-a.fatoum@pengutronix.de>

We already check for MMC_CAP_8_BIT_DATA before trying if buswidth=8
yields legible data. For consistency, don't test whether buswidth=4
works if the MMC host doesn't indicated MMC_CAP_4_BIT_DATA.

Fixes: 68db956d ("mci: Fix 8 bit mmc cards")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/mci/mci-core.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
index 67257bcd186c..dd163c3d1652 100644
--- a/drivers/mci/mci-core.c
+++ b/drivers/mci/mci-core.c
@@ -1025,6 +1025,9 @@ static int mci_startup_mmc(struct mci *mci)
 
 	mci_set_clock(mci, mci->tran_speed);
 
+	if (!(host->host_caps & (MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA)))
+		return 0;
+
 	/*
 	 * Unlike SD, MMC cards dont have a configuration register to notify
 	 * supported bus width. So bus test command should be run to identify
-- 
2.25.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2020-01-30 17:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-30 17:04 [PATCH 0/4] mci: stm32_sdmmc2: timeout and bus-width bug fixes Ahmad Fatoum
2020-01-30 17:04 ` [PATCH 1/5] mci: stm32_sdmmc2: use correct card power cycle sequence Ahmad Fatoum
2020-01-30 17:04 ` [PATCH 2/5] mci: stm32_sdmmc2: don't reset before retrying failed operations Ahmad Fatoum
2020-01-30 17:04 ` Ahmad Fatoum [this message]
2020-01-30 17:04 ` [PATCH 4/5] mci: stm32_sdmmc2: compare ios ->bus_width with correct constants Ahmad Fatoum
2020-01-30 17:04 ` [PATCH 5/5] mci: stm32_sdmmc2: fix typo in debug string Ahmad Fatoum
2020-02-03  8:16 ` [PATCH 0/4] mci: stm32_sdmmc2: timeout and bus-width bug fixes Sascha Hauer

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=20200130170449.9761-4-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.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