Skip to content

Commit

Permalink
mmc: sdhci: Use Auto CMD Auto Select only when v4_mode is true
Browse files Browse the repository at this point in the history
sdhci-of-dwcmshc meets an eMMC read performance regression with below
command after commit 427b651 ("mmc: sdhci: Add Auto CMD Auto
Select support"):

dd if=/dev/mmcblk0 of=/dev/null bs=8192 count=100000

Before the commit, the above command gives 120MB/s
After the commit, the above command gives 51.3 MB/s

So it looks like sdhci-of-dwcmshc expects Version 4 Mode for Auto
CMD Auto Select. Fix the performance degradation by ensuring v4_mode
is true to use Auto CMD Auto Select.

Fixes: 427b651 ("mmc: sdhci: Add Auto CMD Auto Select support")
Signed-off-by: Jisheng Zhang <[email protected]>
Acked-by: Adrian Hunter <[email protected]>
Cc: [email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Ulf Hansson <[email protected]>
  • Loading branch information
Jisheng Zhang authored and storulf committed Oct 15, 2020
1 parent 3e4fb43 commit b3e1ea1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/mmc/host/sdhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1384,9 +1384,11 @@ static inline void sdhci_auto_cmd_select(struct sdhci_host *host,
/*
* In case of Version 4.10 or later, use of 'Auto CMD Auto
* Select' is recommended rather than use of 'Auto CMD12
* Enable' or 'Auto CMD23 Enable'.
* Enable' or 'Auto CMD23 Enable'. We require Version 4 Mode
* here because some controllers (e.g sdhci-of-dwmshc) expect it.
*/
if (host->version >= SDHCI_SPEC_410 && (use_cmd12 || use_cmd23)) {
if (host->version >= SDHCI_SPEC_410 && host->v4_mode &&
(use_cmd12 || use_cmd23)) {
*mode |= SDHCI_TRNS_AUTO_SEL;

ctrl2 = sdhci_readw(host, SDHCI_HOST_CONTROL2);
Expand Down

0 comments on commit b3e1ea1

Please sign in to comment.