Skip to contentSkip to conversation

mmc: core: Fix access to HS400-ES devices

PATCH In review Guenter Roeck 6 participants 8 messages Mar 1, 2017 – Jul 19, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: core: Fix access to HS400-ES devices

HS400-ES devices fail to initialize with the following error messages.

mmc1: power class selection to bus width 8 ddr 0 failed
mmc1: error -110 whilst initialising MMC card

This was seen on Samsung Chromebook Plus. Code analysis points to commit 3d4ef329757c ("mmc: core: fix multi-bit bus width without high-speed mode"), which attempts to set the bus width for all but HS200 devices unconditionally. However, for HS400-ES, the bus width is already selected.

Cc Anssi Hannula <[email protected]>
Cc Douglas Anderson <[email protected]>
Cc Brian Norris <[email protected]>
Fixes 3d4ef329757c ("mmc: core: fix multi-bit bus width ...")
---
 drivers/mmc/core/mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/core/mmc.c +1 -1
index 7fd722868875..b502601df228 100644
@@ -1730,7 +1730,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
 		err = mmc_select_hs400(card);
 		if (err)
 			goto free_card;
-	} else {
+	} else if (!mmc_card_hs400es(card)) {
 		/* Select the desired bus width optionally */
 		err = mmc_select_bus_width(card);
 		if (err > 0 && mmc_card_hs(card)) {
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw

Hi,

Quoted 25 lines · Guenter Roeck

HS400-ES devices fail to initialize with the following error messages.

mmc1: power class selection to bus width 8 ddr 0 failed
mmc1: error -110 whilst initialising MMC card

This was seen on Samsung Chromebook Plus. Code analysis points to commit 3d4ef329757c ("mmc: core: fix multi-bit bus width without high-speed mode"), which attempts to set the bus width for all but HS200 devices unconditionally. However, for HS400-ES, the bus width is already selected.

Cc Anssi Hannula <[email protected]>
Cc Douglas Anderson <[email protected]>
Cc Brian Norris <[email protected]>
Fixes 3d4ef329757c ("mmc: core: fix multi-bit bus width ...")
---
 drivers/mmc/core/mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/core/mmc.c +0 -0
index 7fd722868875..b502601df228 100644

drivers/mmc/core/mmc.c static int mmc_init_card(struct mmc_host *host, u32 ocr, · line 1736

Quoted 8 lines
drivers/mmc/core/mmc.c +1 -1
@@ -1730,7 +1730,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
                err = mmc_select_hs400(card);
                if (err)
                        goto free_card;
-       } else {
+       } else if (!mmc_card_hs400es(card)) {
                /* Select the desired bus width optionally */
                err = mmc_select_bus_width(card);
                if (err > 0 && mmc_card_hs(card)) {

Right, so the key point here is that for normal hs400 we hit the "mmc_card_hs200()" check above because hs400 transitions through hs200. ...but for hs400es we don't do that transition (we jump straight to hs400-es), so we need an extra case to avoid this problematic mmc_select_bus_width().

-Doug

Reviewed-by on v1 1/1
#2 lore raw
In reply to Guenter Roeck
Quoted 11 lines · Guenter Roeck

HS400-ES devices fail to initialize with the following error messages.

mmc1: power class selection to bus width 8 ddr 0 failed
mmc1: error -110 whilst initialising MMC card

This was seen on Samsung Chromebook Plus. Code analysis points to commit 3d4ef329757c ("mmc: core: fix multi-bit bus width without high-speed mode"), which attempts to set the bus width for all but HS200 devices unconditionally. However, for HS400-ES, the bus width is already selected.

Thanks Guenter for catching this early!

Well, I wasn't cc'ed for that patch and it was queued for just one day without fully reviewed. And Doug pointed out the key point here, so,

btw, I think kernelci need some rk3399 platforms with hs400es and CQ engine support for future test. I will try to find a way to help kernelci to get some boards if possible..

Quoted 23 lines
Cc Anssi Hannula <[email protected]>
Cc Douglas Anderson <[email protected]>
Cc Brian Norris <[email protected]>
Fixes 3d4ef329757c ("mmc: core: fix multi-bit bus width ...")
---
 drivers/mmc/core/mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/core/mmc.c +1 -1
index 7fd722868875..b502601df228 100644
@@ -1730,7 +1730,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
 		err = mmc_select_hs400(card);
 		if (err)
 			goto free_card;
-	} else {
+	} else if (!mmc_card_hs400es(card)) {
 		/* Select the desired bus width optionally */
 		err = mmc_select_bus_width(card);
 		if (err > 0 && mmc_card_hs(card)) {
Signature · 2 lines
Best Regards
Shawn Lin
#3 lore raw
In reply to Guenter Roeck

ping ...

Ulf,

I know it is early for a ping. However, the patch causing all HS400-ES devices to fail already made it into various stable releases, and I think it would be very desirable to get those back to working.

Thanks,
Guenter

Quoted 36 lines · Guenter Roeck

HS400-ES devices fail to initialize with the following error messages.

mmc1: power class selection to bus width 8 ddr 0 failed
mmc1: error -110 whilst initialising MMC card

This was seen on Samsung Chromebook Plus. Code analysis points to commit 3d4ef329757c ("mmc: core: fix multi-bit bus width without high-speed mode"), which attempts to set the bus width for all but HS200 devices unconditionally. However, for HS400-ES, the bus width is already selected.

Cc Anssi Hannula <[email protected]>
Cc Douglas Anderson <[email protected]>
Cc Brian Norris <[email protected]>
Fixes 3d4ef329757c ("mmc: core: fix multi-bit bus width ...")
---
 drivers/mmc/core/mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/core/mmc.c +1 -1
index 7fd722868875..b502601df228 100644
@@ -1730,7 +1730,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
 		err = mmc_select_hs400(card);
 		if (err)
 			goto free_card;
-	} else {
+	} else if (!mmc_card_hs400es(card)) {
 		/* Select the desired bus width optionally */
 		err = mmc_select_bus_width(card);
 		if (err > 0 && mmc_card_hs(card)) {
Signature · 1 line
2.7.4
Tested-by on v1 1/1
#4 lore raw
In reply to Guenter Roeck

Am Mittwoch, 1. März 2017, 14:11:47 CET schrieb Guenter Roeck:

Quoted 11 lines

HS400-ES devices fail to initialize with the following error messages.

mmc1: power class selection to bus width 8 ddr 0 failed
mmc1: error -110 whilst initialising MMC card

This was seen on Samsung Chromebook Plus. Code analysis points to commit 3d4ef329757c ("mmc: core: fix multi-bit bus width without high-speed mode"), which attempts to set the bus width for all but HS200 devices unconditionally. However, for HS400-ES, the bus width is already selected.

Quoted 7 lines
Cc Anssi Hannula <[email protected]>
Cc Douglas Anderson <[email protected]>
Cc Brian Norris <[email protected]>
Fixes 3d4ef329757c ("mmc: core: fix multi-bit bus width ...")

On a rk3399-kevin and the current mainline kernel from 20170309 it makes the issue go away and the emmc work again, so

#5 lore raw
In reply to Guenter Roeck
Quoted 11 lines · Guenter Roeck

HS400-ES devices fail to initialize with the following error messages.

mmc1: power class selection to bus width 8 ddr 0 failed
mmc1: error -110 whilst initialising MMC card

This was seen on Samsung Chromebook Plus. Code analysis points to commit 3d4ef329757c ("mmc: core: fix multi-bit bus width without high-speed mode"), which attempts to set the bus width for all but HS200 devices unconditionally. However, for HS400-ES, the bus width is already selected.

Quoted 5 lines
Cc Anssi Hannula <[email protected]>
Cc Douglas Anderson <[email protected]>
Cc Brian Norris <[email protected]>
Fixes 3d4ef329757c ("mmc: core: fix multi-bit bus width ...")

Sorry for the delay. Been traveling.

Applied for fixes, thanks!

Kind regards
Uffe

Quoted 20 lines
---
 drivers/mmc/core/mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/core/mmc.c +1 -2
index 7fd722868875..b502601df228 100644
@@ -1730,7 +1730,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
                err = mmc_select_hs400(card);
                if (err)
                        goto free_card;
-       } else {
+       } else if (!mmc_card_hs400es(card)) {
                /* Select the desired bus width optionally */
                err = mmc_select_bus_width(card);
                if (err > 0 && mmc_card_hs(card)) {
--

2.7.4

#6 lore raw

Hi,

Quoted 18 lines · Ulf Hansson
Quoted 11 lines · Guenter Roeck

HS400-ES devices fail to initialize with the following error messages.

mmc1: power class selection to bus width 8 ddr 0 failed
mmc1: error -110 whilst initialising MMC card

This was seen on Samsung Chromebook Plus. Code analysis points to commit 3d4ef329757c ("mmc: core: fix multi-bit bus width without high-speed mode"), which attempts to set the bus width for all but HS200 devices unconditionally. However, for HS400-ES, the bus width is already selected.

Quoted 5 lines
Cc Anssi Hannula <[email protected]>
Cc Douglas Anderson <[email protected]>
Cc Brian Norris <[email protected]>
Fixes 3d4ef329757c ("mmc: core: fix multi-bit bus width ...")
Quoted 3 lines

Sorry for the delay. Been traveling.

Applied for fixes, thanks!

+stable

The commit 3d4ef329757c ("mmc: core: fix multi-bit bus width without high-speed mode") got backported to many stable branches, so probably this commit 773dc118756b ("mmc: core: Fix access to HS400-ES devices") also needs to get picked to the same stable branches.

In the very least v4.9 and v4.4 stable includes the broken patch but not this fix.

-Doug

#7 lore raw
Quoted 27 lines · Doug Anderson

Hi,

Quoted 18 lines · Ulf Hansson
Quoted 11 lines · Guenter Roeck

HS400-ES devices fail to initialize with the following error messages.

mmc1: power class selection to bus width 8 ddr 0 failed
mmc1: error -110 whilst initialising MMC card

This was seen on Samsung Chromebook Plus. Code analysis points to commit 3d4ef329757c ("mmc: core: fix multi-bit bus width without high-speed mode"), which attempts to set the bus width for all but HS200 devices unconditionally. However, for HS400-ES, the bus width is already selected.

Quoted 5 lines
Cc Anssi Hannula <[email protected]>
Cc Douglas Anderson <[email protected]>
Cc Brian Norris <[email protected]>
Fixes 3d4ef329757c ("mmc: core: fix multi-bit bus width ...")
Quoted 3 lines

Sorry for the delay. Been traveling.

Applied for fixes, thanks!

+stable

Quoted 7 lines

The commit 3d4ef329757c ("mmc: core: fix multi-bit bus width without high-speed mode") got backported to many stable branches, so probably this commit 773dc118756b ("mmc: core: Fix access to HS400-ES devices") also needs to get picked to the same stable branches.

In the very least v4.9 and v4.4 stable includes the broken patch but not this fix.

Ah, thanks, I missed that somehow, I think I saw the fixes: field and didn't realize that that commit was already backported.

I'll queue it up after these next kernels are released in a few days.

thanks,

greg k-h