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: str@pengutronix.de, mtr@pengutronix.de,
	Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH master 3/3] mci: core: make execute_tuning mandatory for HS200
Date: Tue, 23 Apr 2024 08:22:06 +0200	[thread overview]
Message-ID: <20240423062206.1518464-3-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20240423062206.1518464-1-a.fatoum@pengutronix.de>

We assume that any host controller that doesn't implement execute_tuning
will have no issue with HS200 operation. This is likely untrue for most
host drivers that we have and it will confuse users:

  - Enable CONFIG_MCI_TUNING, e.g. for i.MX
  - devinfo shows HS200 operation
  - Actually reading blocks will fail with EIO

Therefore, let's make execute_tuning mandatory for HS200. If some driver
doesn't need it, it can always define an empty stub for it.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/mci/mci-core.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
index af0980308866..f6565b2b64dd 100644
--- a/drivers/mci/mci-core.c
+++ b/drivers/mci/mci-core.c
@@ -1349,8 +1349,14 @@ int mci_execute_tuning(struct mci *mci)
 	struct mci_host *host = mci->host;
 	u32 opcode;
 
-	if (!host->execute_tuning)
-		return 0;
+	if (!host->execute_tuning) {
+		/*
+		 * For us, implementing ->execute_tuning is mandatory to
+		 * support higher speed modes
+		 */
+		dev_warn(&mci->dev, "tuning failed: no host diver support\n");
+		return -EOPNOTSUPP;
+	}
 
 	/* Tuning is only supported for MMC / HS200 */
 	if (mmc_card_hs200(mci))
-- 
2.39.2




  parent reply	other threads:[~2024-04-23  6:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-23  6:22 [PATCH master 1/3] mci: core: fix fallback when eMMC DDR52 is not possible Ahmad Fatoum
2024-04-23  6:22 ` [PATCH master 2/3] mci: core: fix fallback when host doesn't support HS200 Ahmad Fatoum
2024-04-23  6:22 ` Ahmad Fatoum [this message]
2024-04-23  6:44 ` [PATCH master 1/3] mci: core: fix fallback when eMMC DDR52 is not possible Sascha Hauer
2024-04-23  6:52   ` Ahmad Fatoum
2024-04-30  5:44 ` 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=20240423062206.1518464-3-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=mtr@pengutronix.de \
    --cc=str@pengutronix.de \
    /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