* [PATCH v2] mmc: sdhci: Use Auto CMD Auto Select only when v4_mode is true
@ 2020-10-15 9:41 Jisheng Zhang
2020-10-15 10:14 ` Adrian Hunter
2020-10-15 10:31 ` Ulf Hansson
0 siblings, 2 replies; 3+ messages in thread
From: Jisheng Zhang @ 2020-10-15 9:41 UTC (permalink / raw)
To: Adrian Hunter, Ulf Hansson, Chunyan Zhang; +Cc: linux-mmc, linux-kernel
sdhci-of-dwcmshc meets an eMMC read performance regression with below
command after commit 427b6514d095 ("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: 427b6514d095 ("mmc: sdhci: Add Auto CMD Auto Select support")
Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
---
Since v1:
- add the performance degradation on sdhci-of-dwcmshc explanation in
commit msg
- add a comment in the code explaining we require Version 4 Mode because some
controllers(e.g sdhci-of-dwcmshc) expect it that way.
drivers/mmc/host/sdhci.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 592a55a34b58..3561ae8a481a 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -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);
--
2.28.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] mmc: sdhci: Use Auto CMD Auto Select only when v4_mode is true
2020-10-15 9:41 [PATCH v2] mmc: sdhci: Use Auto CMD Auto Select only when v4_mode is true Jisheng Zhang
@ 2020-10-15 10:14 ` Adrian Hunter
2020-10-15 10:31 ` Ulf Hansson
1 sibling, 0 replies; 3+ messages in thread
From: Adrian Hunter @ 2020-10-15 10:14 UTC (permalink / raw)
To: Jisheng Zhang, Ulf Hansson, Chunyan Zhang; +Cc: linux-mmc, linux-kernel
On 15/10/20 12:41 pm, Jisheng Zhang wrote:
> sdhci-of-dwcmshc meets an eMMC read performance regression with below
> command after commit 427b6514d095 ("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: 427b6514d095 ("mmc: sdhci: Add Auto CMD Auto Select support")
> Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
> ---
> Since v1:
> - add the performance degradation on sdhci-of-dwcmshc explanation in
> commit msg
> - add a comment in the code explaining we require Version 4 Mode because some
> controllers(e.g sdhci-of-dwcmshc) expect it that way.
>
> drivers/mmc/host/sdhci.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 592a55a34b58..3561ae8a481a 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -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);
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] mmc: sdhci: Use Auto CMD Auto Select only when v4_mode is true
2020-10-15 9:41 [PATCH v2] mmc: sdhci: Use Auto CMD Auto Select only when v4_mode is true Jisheng Zhang
2020-10-15 10:14 ` Adrian Hunter
@ 2020-10-15 10:31 ` Ulf Hansson
1 sibling, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2020-10-15 10:31 UTC (permalink / raw)
To: Jisheng Zhang
Cc: Adrian Hunter, Chunyan Zhang, linux-mmc@vger.kernel.org,
Linux Kernel Mailing List
On Thu, 15 Oct 2020 at 11:41, Jisheng Zhang <Jisheng.Zhang@synaptics.com> wrote:
>
> sdhci-of-dwcmshc meets an eMMC read performance regression with below
> command after commit 427b6514d095 ("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: 427b6514d095 ("mmc: sdhci: Add Auto CMD Auto Select support")
> Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Applied for fixes and by adding a stable tag, thanks!
Kind regards
Uffe
> ---
> Since v1:
> - add the performance degradation on sdhci-of-dwcmshc explanation in
> commit msg
> - add a comment in the code explaining we require Version 4 Mode because some
> controllers(e.g sdhci-of-dwcmshc) expect it that way.
>
> drivers/mmc/host/sdhci.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 592a55a34b58..3561ae8a481a 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -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);
> --
> 2.28.0
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-10-15 10:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-15 9:41 [PATCH v2] mmc: sdhci: Use Auto CMD Auto Select only when v4_mode is true Jisheng Zhang
2020-10-15 10:14 ` Adrian Hunter
2020-10-15 10:31 ` Ulf Hansson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox