All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: dw_mmc: fix errors to use card read/write threshold for HS400 mode
@ 2018-06-29 13:59 ` Huanlin.Ke
  0 siblings, 0 replies; 4+ messages in thread
From: Huanlin.Ke @ 2018-06-29 13:59 UTC (permalink / raw)
  Cc: kehuanlin, zhangbo_a, Jaehoon Chung, Ulf Hansson,
	open list:SYNOPSYS DESIGNWARE MMC/SD/SDIO DRIVER, open list

The card write threshold is applicable for HS400 mode only, so it should
return back except HS400 timing mode.

The card read threshold is also required for HS400 mode as the host
controller incorrectly samples the data if the card clock stops within
a block transfer.

Signed-off-by: Huanlin.Ke <kehuanlin@pinecone.net>
Signed-off-by: zhangbo_a <zhangbo_a@xiaomi.com>
---
 drivers/mmc/host/dw_mmc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 623f4d2..d4e6983 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -1065,7 +1065,7 @@ static void dw_mci_ctrl_thld(struct dw_mci *host, struct mmc_data *data)
 	 * It's used when HS400 mode is enabled.
 	 */
 	if (data->flags & MMC_DATA_WRITE &&
-		!(host->timing != MMC_TIMING_MMC_HS400))
+		(host->timing != MMC_TIMING_MMC_HS400))
 		return;
 
 	if (data->flags & MMC_DATA_WRITE)
@@ -1074,6 +1074,7 @@ static void dw_mci_ctrl_thld(struct dw_mci *host, struct mmc_data *data)
 		enable = SDMMC_CARD_RD_THR_EN;
 
 	if (host->timing != MMC_TIMING_MMC_HS200 &&
+	    host->timing != MMC_TIMING_MMC_HS400 &&
 	    host->timing != MMC_TIMING_UHS_SDR104)
 		goto disable;
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] mmc: dw_mmc: fix errors to use card read/write threshold for HS400 mode
@ 2018-06-29 13:59 ` Huanlin.Ke
  0 siblings, 0 replies; 4+ messages in thread
From: Huanlin.Ke @ 2018-06-29 13:59 UTC (permalink / raw)
  Cc: kehuanlin, zhangbo_a, Jaehoon Chung, Ulf Hansson,
	open list:SYNOPSYS DESIGNWARE MMC/SD/SDIO DRIVER, open list

The card write threshold is applicable for HS400 mode only, so it should
return back except HS400 timing mode.

The card read threshold is also required for HS400 mode as the host
controller incorrectly samples the data if the card clock stops within
a block transfer.

Signed-off-by: Huanlin.Ke <kehuanlin@pinecone.net>
Signed-off-by: zhangbo_a <zhangbo_a@xiaomi.com>
---
 drivers/mmc/host/dw_mmc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 623f4d2..d4e6983 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -1065,7 +1065,7 @@ static void dw_mci_ctrl_thld(struct dw_mci *host, struct mmc_data *data)
 	 * It's used when HS400 mode is enabled.
 	 */
 	if (data->flags & MMC_DATA_WRITE &&
-		!(host->timing != MMC_TIMING_MMC_HS400))
+		(host->timing != MMC_TIMING_MMC_HS400))
 		return;
 
 	if (data->flags & MMC_DATA_WRITE)
@@ -1074,6 +1074,7 @@ static void dw_mci_ctrl_thld(struct dw_mci *host, struct mmc_data *data)
 		enable = SDMMC_CARD_RD_THR_EN;
 
 	if (host->timing != MMC_TIMING_MMC_HS200 &&
+	    host->timing != MMC_TIMING_MMC_HS400 &&
 	    host->timing != MMC_TIMING_UHS_SDR104)
 		goto disable;
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] mmc: dw_mmc: fix errors to use card read/write threshold for HS400 mode
  2018-06-29 13:59 ` Huanlin.Ke
@ 2018-07-02 14:37   ` Ulf Hansson
  -1 siblings, 0 replies; 4+ messages in thread
From: Ulf Hansson @ 2018-07-02 14:37 UTC (permalink / raw)
  To: Huanlin.Ke
  Cc: kehuanlin, zhangbo_a, Jaehoon Chung,
	open list:SYNOPSYS DESIGNWARE MMC/SD/SDIO DRIVER, open list,
	Qing Xia

On 29 June 2018 at 15:59, Huanlin.Ke <chgokhl@gmail.com> wrote:
> The card write threshold is applicable for HS400 mode only, so it should
> return back except HS400 timing mode.
>
> The card read threshold is also required for HS400 mode as the host
> controller incorrectly samples the data if the card clock stops within
> a block transfer.
>
> Signed-off-by: Huanlin.Ke <kehuanlin@pinecone.net>
> Signed-off-by: zhangbo_a <zhangbo_a@xiaomi.com>

Thanks for your patch!

I have just applied an earlier version of the patch, posted by Qing
Xia from Hisilicon.
https://patchwork.kernel.org/patch/10434913/

If it works for you as well, I can add your tested by tags for it.

Also, can you perhaps point me to a commit which introduced the problem?

Kind regards
Uffe

> ---
>  drivers/mmc/host/dw_mmc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index 623f4d2..d4e6983 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -1065,7 +1065,7 @@ static void dw_mci_ctrl_thld(struct dw_mci *host, struct mmc_data *data)
>          * It's used when HS400 mode is enabled.
>          */
>         if (data->flags & MMC_DATA_WRITE &&
> -               !(host->timing != MMC_TIMING_MMC_HS400))
> +               (host->timing != MMC_TIMING_MMC_HS400))
>                 return;
>
>         if (data->flags & MMC_DATA_WRITE)
> @@ -1074,6 +1074,7 @@ static void dw_mci_ctrl_thld(struct dw_mci *host, struct mmc_data *data)
>                 enable = SDMMC_CARD_RD_THR_EN;
>
>         if (host->timing != MMC_TIMING_MMC_HS200 &&
> +           host->timing != MMC_TIMING_MMC_HS400 &&
>             host->timing != MMC_TIMING_UHS_SDR104)
>                 goto disable;
>
> --
> 2.7.4
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mmc: dw_mmc: fix errors to use card read/write threshold for HS400 mode
@ 2018-07-02 14:37   ` Ulf Hansson
  0 siblings, 0 replies; 4+ messages in thread
From: Ulf Hansson @ 2018-07-02 14:37 UTC (permalink / raw)
  To: Huanlin.Ke
  Cc: kehuanlin, zhangbo_a, Jaehoon Chung,
	open list:SYNOPSYS DESIGNWARE MMC/SD/SDIO DRIVER, open list,
	Qing Xia

On 29 June 2018 at 15:59, Huanlin.Ke <chgokhl@gmail.com> wrote:
> The card write threshold is applicable for HS400 mode only, so it should
> return back except HS400 timing mode.
>
> The card read threshold is also required for HS400 mode as the host
> controller incorrectly samples the data if the card clock stops within
> a block transfer.
>
> Signed-off-by: Huanlin.Ke <kehuanlin@pinecone.net>
> Signed-off-by: zhangbo_a <zhangbo_a@xiaomi.com>

Thanks for your patch!

I have just applied an earlier version of the patch, posted by Qing
Xia from Hisilicon.
https://patchwork.kernel.org/patch/10434913/

If it works for you as well, I can add your tested by tags for it.

Also, can you perhaps point me to a commit which introduced the problem?

Kind regards
Uffe

> ---
>  drivers/mmc/host/dw_mmc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index 623f4d2..d4e6983 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -1065,7 +1065,7 @@ static void dw_mci_ctrl_thld(struct dw_mci *host, struct mmc_data *data)
>          * It's used when HS400 mode is enabled.
>          */
>         if (data->flags & MMC_DATA_WRITE &&
> -               !(host->timing != MMC_TIMING_MMC_HS400))
> +               (host->timing != MMC_TIMING_MMC_HS400))
>                 return;
>
>         if (data->flags & MMC_DATA_WRITE)
> @@ -1074,6 +1074,7 @@ static void dw_mci_ctrl_thld(struct dw_mci *host, struct mmc_data *data)
>                 enable = SDMMC_CARD_RD_THR_EN;
>
>         if (host->timing != MMC_TIMING_MMC_HS200 &&
> +           host->timing != MMC_TIMING_MMC_HS400 &&
>             host->timing != MMC_TIMING_UHS_SDR104)
>                 goto disable;
>
> --
> 2.7.4
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-07-02 14:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-29 13:59 [PATCH] mmc: dw_mmc: fix errors to use card read/write threshold for HS400 mode Huanlin.Ke
2018-06-29 13:59 ` Huanlin.Ke
2018-07-02 14:37 ` Ulf Hansson
2018-07-02 14:37   ` Ulf Hansson

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.