All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V5] mmc: core: improve reasonableness of bus width setting for HS400es
@ 2018-07-31  2:55 ` Hongjie Fang
  0 siblings, 0 replies; 3+ messages in thread
From: Hongjie Fang @ 2018-07-31  2:55 UTC (permalink / raw)
  To: ulf.hansson
  Cc: adrian.hunter, shawn.lin, linus.walleij, horms+renesas,
	wsa+renesas, bst, chanho.min, kyle.roeschley, linux-mmc,
	linux-kernel, Hongjie Fang

mmc_select_hs400es() calls mmc_select_bus_width() which will continue
to set 4bit transfer mode if fail to set 8bit mode. The bus width
should not be set to 4bit in HS400es.

When fail to set 8bit mode, need return error directly for HS400es.

Signed-off-by: Hongjie Fang <hongjiefang@asrmicro.com>
---
 drivers/mmc/core/mmc.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 4466f5d..82af1e0 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1338,8 +1338,12 @@ static int mmc_select_hs400es(struct mmc_card *card)
 		goto out_err;
 
 	err = mmc_select_bus_width(card);
-	if (err < 0)
+	if (err != MMC_BUS_WIDTH_8) {
+		pr_err("%s: switch to 8bit bus width failed, err:%d\n",
+			mmc_hostname(host), err);
+		err = err < 0 ? err : -ENOTSUPP;
 		goto out_err;
+	}
 
 	/* Switch card to HS mode */
 	err = __mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
-- 
1.9.1


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

* [PATCH V5] mmc: core: improve reasonableness of bus width setting for HS400es
@ 2018-07-31  2:55 ` Hongjie Fang
  0 siblings, 0 replies; 3+ messages in thread
From: Hongjie Fang @ 2018-07-31  2:55 UTC (permalink / raw)
  To: ulf.hansson
  Cc: adrian.hunter, shawn.lin, linus.walleij, horms+renesas,
	wsa+renesas, bst, chanho.min, kyle.roeschley, linux-mmc,
	linux-kernel, Hongjie Fang

mmc_select_hs400es() calls mmc_select_bus_width() which will continue
to set 4bit transfer mode if fail to set 8bit mode. The bus width
should not be set to 4bit in HS400es.

When fail to set 8bit mode, need return error directly for HS400es.

Signed-off-by: Hongjie Fang <hongjiefang@asrmicro.com>
---
 drivers/mmc/core/mmc.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 4466f5d..82af1e0 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1338,8 +1338,12 @@ static int mmc_select_hs400es(struct mmc_card *card)
 		goto out_err;
 
 	err = mmc_select_bus_width(card);
-	if (err < 0)
+	if (err != MMC_BUS_WIDTH_8) {
+		pr_err("%s: switch to 8bit bus width failed, err:%d\n",
+			mmc_hostname(host), err);
+		err = err < 0 ? err : -ENOTSUPP;
 		goto out_err;
+	}
 
 	/* Switch card to HS mode */
 	err = __mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
-- 
1.9.1

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

* Re: [PATCH V5] mmc: core: improve reasonableness of bus width setting for HS400es
  2018-07-31  2:55 ` Hongjie Fang
  (?)
@ 2018-08-01 12:16 ` Ulf Hansson
  -1 siblings, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2018-08-01 12:16 UTC (permalink / raw)
  To: Hongjie Fang
  Cc: Adrian Hunter, Shawn Lin, Linus Walleij, Simon Horman,
	Wolfram Sang, Bastian Stender, Chanho Min, Kyle Roeschley,
	linux-mmc, Linux Kernel Mailing List

On 31 July 2018 at 04:55, Hongjie Fang <hongjiefang@asrmicro.com> wrote:
> mmc_select_hs400es() calls mmc_select_bus_width() which will continue
> to set 4bit transfer mode if fail to set 8bit mode. The bus width
> should not be set to 4bit in HS400es.
>
> When fail to set 8bit mode, need return error directly for HS400es.
>
> Signed-off-by: Hongjie Fang <hongjiefang@asrmicro.com>

Thanks, applied for next!

Kind regards
Uffe

> ---
>  drivers/mmc/core/mmc.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> index 4466f5d..82af1e0 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -1338,8 +1338,12 @@ static int mmc_select_hs400es(struct mmc_card *card)
>                 goto out_err;
>
>         err = mmc_select_bus_width(card);
> -       if (err < 0)
> +       if (err != MMC_BUS_WIDTH_8) {
> +               pr_err("%s: switch to 8bit bus width failed, err:%d\n",
> +                       mmc_hostname(host), err);
> +               err = err < 0 ? err : -ENOTSUPP;
>                 goto out_err;
> +       }
>
>         /* Switch card to HS mode */
>         err = __mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
> --
> 1.9.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2018-08-01 12:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-31  2:55 [PATCH V5] mmc: core: improve reasonableness of bus width setting for HS400es Hongjie Fang
2018-07-31  2:55 ` Hongjie Fang
2018-08-01 12:16 ` 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.