Re: [PATCH] mmc: block: Add single read for 4k sector cards

From: Christian Löhle
Date: Fri Jun 24 2022 - 09:58:52 EST


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