mmc: rpmb: do not force a retune before RPMB switch
PATCH 1/1 mmc: rpmb: do not force a retune before RPMB switch
Requesting a retune before switching to the RPMB partition has been observed to cause CRC errors on the RPMB reads (-EILSEQ).
Since RPMB reads can not be retried, the clients would be directly affected by the errors.
This commit disables the request prior to RPMB switching while allowing the pause interface to still request a retune before the pause for other use cases.
This was verified with the sdhci-of-arasan driver (ZynqMP) configured for HS200 using two separate eMMC cards (DG4064 and 064GB2). In both cases, the error was easy to reproduce triggering every few tenths of reads.
--- drivers/mmc/core/block.c | 2 +- drivers/mmc/core/host.c | 7 ++++--- drivers/mmc/core/host.h | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-)
drivers/mmc/core/block.c +1 -1
@@ -859,7 +859,7 @@ static int mmc_blk_part_switch_pre(struct mmc_card *card,if (ret)return ret; } -mmc_retune_pause (card->host); +mmc_retune_pause (card->host, false); }return ret;
drivers/mmc/core/host.c +4 -3
@@ -119,13 +119,14 @@ void mmc_retune_enable(struct mmc_host *host)/* * Pause re-tuning for a small set of operations. The pause begins after the -* next command and after first doing re-tuning. +* next command and, if retune is set, after first doing re-tuning. */ -void mmc_retune_pause (struct mmc_host *host) +void mmc_retune_pause (struct mmc_host *host,bool retune) {if (!host->retune_paused) { host->retune_paused =1 ; -mmc_retune_needed (host); +if (retune) +mmc_retune_needed (host);mmc_retune_hold (host); } }
drivers/mmc/core/host.h +1 -1
@@ -18,7 +18,7 @@ void mmc_retune_disable(struct mmc_host *host);void mmc_retune_hold (struct mmc_host *host);void mmc_retune_release (struct mmc_host *host);int mmc_retune (struct mmc_host *host); -void mmc_retune_pause (struct mmc_host *host); +void mmc_retune_pause (struct mmc_host *host,bool retune);void mmc_retune_unpause (struct mmc_host *host);static inline void mmc_retune_clear (struct mmc_host *host)
--
2.34.1
Quoted 10 lines · Jorge Ramirez-Ortiz
Requesting a retune before switching to the RPMB partition has been observed to cause CRC errors on the RPMB reads (
-EILSEQ).Since RPMB reads can not be retried, the clients would be directly affected by the errors.
This commit disables the request prior to RPMB switching while allowing the pause interface to still request a retune before the pause for other use cases.
Quoted 7 lines
This was verified with the sdhci-of-arasan driver (ZynqMP) configured for HS200 using two separate eMMC cards (DG4064 and 064GB2). In both cases, the error was easy to reproduce triggering every few tenths of reads.
Signed-off-by Jorge Ramirez-Ortiz <[email protected]>Acked-by Avri Altman <[email protected]>
Is the difference between this mail and the previous one just Avri's Ack? No need to resend for every tag you receive.
Quoted 57 lines
--- drivers/mmc/core/block.c | 2 +- drivers/mmc/core/host.c | 7 ++++--- drivers/mmc/core/host.h | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-)drivers/mmc/core/block.c +1
-1@@ -859,7 +859,7 @@ static int mmc_blk_part_switch_pre(struct mmc_card *card,if (ret)return ret; } -mmc_retune_pause (card->host); +mmc_retune_pause (card->host, false); }return ret;drivers/mmc/core/host.c +4
-3@@ -119,13 +119,14 @@ void mmc_retune_enable(struct mmc_host *host)/* * Pause re-tuning for a small set of operations. The pause begins after the -* next command and after first doing re-tuning. +* next command and, if retune is set, after first doing re-tuning. */ -void mmc_retune_pause (struct mmc_host *host) +void mmc_retune_pause (struct mmc_host *host,bool retune) {if (!host->retune_paused) { host->retune_paused =1 ; -mmc_retune_needed (host); +if (retune) +mmc_retune_needed (host);mmc_retune_hold (host); } }drivers/mmc/core/host.h +1
-2@@ -18,7 +18,7 @@ void mmc_retune_disable(struct mmc_host *host);void mmc_retune_hold (struct mmc_host *host);void mmc_retune_release (struct mmc_host *host);int mmc_retune (struct mmc_host *host); -void mmc_retune_pause (struct mmc_host *host); +void mmc_retune_pause (struct mmc_host *host,bool retune);void mmc_retune_unpause (struct mmc_host *host);static inline void mmc_retune_clear (struct mmc_host *host) --2.34.1
Quoted 16 lines · Christian Loehle
Quoted 15 lines · Jorge Ramirez-Ortiz
Requesting a retune before switching to the RPMB partition has been observed to cause CRC errors on the RPMB reads (
-EILSEQ).Since RPMB reads can not be retried, the clients would be directly affected by the errors.
This commit disables the request prior to RPMB switching while allowing the pause interface to still request a retune before the pause for other use cases.
This was verified with the sdhci-of-arasan driver (ZynqMP) configured for HS200 using two separate eMMC cards (DG4064 and 064GB2). In both cases, the error was easy to reproduce triggering every few tenths of reads.
Quoted 5 lines
Quoted 2 lines
Signed-off-by Jorge Ramirez-Ortiz <[email protected]>Acked-by Avri Altman <[email protected]>Is the difference between this mail and the previous one just Avri's Ack? No need to resend for every tag you receive.
oops, every project with its own little idiosyncrasies sometimes I get confused (u-boot, optee, ssl, tf-a..) yes, sorry about it, no differences.
Quoted 46 lines · Jorge Ramirez-Ortiz
Requesting a retune before switching to the RPMB partition has been observed to cause CRC errors on the RPMB reads (
-EILSEQ).Since RPMB reads can not be retried, the clients would be directly affected by the errors.
This commit disables the request prior to RPMB switching while allowing the pause interface to still request a retune before the pause for other use cases.
This was verified with the sdhci-of-arasan driver (ZynqMP) configured for HS200 using two separate eMMC cards (DG4064 and 064GB2). In both cases, the error was easy to reproduce triggering every few tenths of reads.
Signed-off-by Jorge Ramirez-Ortiz <[email protected]>Acked-by Avri Altman <[email protected]>--- drivers/mmc/core/block.c | 2 +- drivers/mmc/core/host.c | 7 ++++--- drivers/mmc/core/host.h | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-)drivers/mmc/core/block.c +1
-1@@ -859,7 +859,7 @@ static int mmc_blk_part_switch_pre(struct mmc_card *card,if (ret)return ret; } -mmc_retune_pause (card->host); +mmc_retune_pause (card->host, false); }return ret;drivers/mmc/core/host.c +0
-1@@ -119,13 +119,14 @@ void mmc_retune_enable(struct mmc_host *host)/* * Pause re-tuning for a small set of operations. The pause begins after the -* next command and after first doing re-tuning.
drivers/mmc/core/host.c void mmc_retune_enable(struct mmc_host *host) · line 129
Quoted 10 lines
drivers/mmc/core/host.c +4
-2+* next command and, if retune is set, after first doing re-tuning. */ -void mmc_retune_pause (struct mmc_host *host) +void mmc_retune_pause (struct mmc_host *host,bool retune) {if (!host->retune_paused) { host->retune_paused =1 ; -mmc_retune_needed (host); +if (retune) +mmc_retune_needed (host);
Better to just drop mmc_retune_needed(host);
Quoted 18 lines
drivers/mmc/core/host.c +0
-0mmc_retune_hold (host); } }drivers/mmc/core/host.h +1
-2@@ -18,7 +18,7 @@ void mmc_retune_disable(struct mmc_host *host);void mmc_retune_hold (struct mmc_host *host);void mmc_retune_release (struct mmc_host *host);int mmc_retune (struct mmc_host *host); -void mmc_retune_pause (struct mmc_host *host); +void mmc_retune_pause (struct mmc_host *host,bool retune);void mmc_retune_unpause (struct mmc_host *host);static inline void mmc_retune_clear (struct mmc_host *host) --2.34.1