All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian Löhle" <CLoehle@hyperstone.com>
To: "ulf.hansson@linaro.org" <ulf.hansson@linaro.org>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: Avri Altman <Avri.Altman@wdc.com>,
	"adrian.hunter@intel.com" <adrian.hunter@intel.com>
Subject: Re: [PATCH] mmc: block: Add single read for 4k sector cards
Date: Fri, 24 Jun 2022 13:58:44 +0000	[thread overview]
Message-ID: <9e171c7ba27b4377872379f7e211715c@hyperstone.com> (raw)

Anyone wanting to test this and does not have a way to disturb eMMC signals,
use mmc-utils to disable 512B emulation and something along the lines of:

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 4b70cbfc6d5d..bc0b9241a00f 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -32,6 +32,8 @@
 #include <linux/mmc/sd.h>
 #include <linux/mmc/slot-gpio.h>
 
+#include <linux/sched/clock.h>
+
 #define CREATE_TRACE_POINTS
 #include <trace/events/mmc.h>
 
@@ -141,6 +143,12 @@ void mmc_request_done(struct mmc_host *host, struct mmc_request *mrq)
 	struct mmc_command *cmd = mrq->cmd;
 	int err = cmd->error;
 
+	if (mrq->data && !mrq->data->error && mrq->data->flags & MMC_DATA_READ)
+		if ((sched_clock() % 1000) == 0) {
+			mrq->data->bytes_xfered = 0;
+			mrq->data->error = -EILSEQ;
+		}
+
 	/* Flag re-tuning needed on CRC errors */
 	if (cmd->opcode != MMC_SEND_TUNING_BLOCK &&
 	    cmd->opcode != MMC_SEND_TUNING_BLOCK_HS200 &&
Hyperstone GmbH | Reichenaustr. 39a  | 78467 Konstanz
Managing Director: Dr. Jan Peter Berns.
Commercial register of local courts: Freiburg HRB381782


             reply	other threads:[~2022-06-24 13:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-24 13:58 Christian Löhle [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-06-24 14:32 [PATCH] mmc: block: Add single read for 4k sector cards Christian Löhle
2022-06-24 12:40 Christian Löhle
2022-06-24 14:14 ` Avri Altman

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=9e171c7ba27b4377872379f7e211715c@hyperstone.com \
    --to=cloehle@hyperstone.com \
    --cc=Avri.Altman@wdc.com \
    --cc=adrian.hunter@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.