Skip to contentSkip to conversation

mmc: sdhci-of-at91: add quirk for broken HS200

PATCH In review [email protected] 5 participants 14 messages Aug 8, 2019 – Oct 3, 2019

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

PATCH 1/2 mmc: sdhci-of-at91: add quirk for broken HS200

From: Eugen Hristev <[email protected]>

HS200 is not implemented in the driver, but the controller claims it through caps.
Remove it via quirk.
Without this quirk, the mmc core will try to enable hs200, which will fail, and the eMMC initialization will fail.

---
 drivers/mmc/host/sdhci-of-at91.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/mmc/host/sdhci-of-at91.c +3 -0
index 57fe3b2..3a8c6d8 100644
@@ -370,6 +370,9 @@ static int sdhci_at91_probe(struct platform_device *pdev)
 	pm_runtime_set_autosuspend_delay(&pdev->dev, 50);
 	pm_runtime_use_autosuspend(&pdev->dev);
 
+	/* HS200 is broken at this moment */
+	host->quirks2 = SDHCI_QUIRK2_BROKEN_HS200;
+
 	ret = sdhci_add_host(host);
 	if (ret)
 		goto pm_runtime_disable;
Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/2 ARM: dts: at91: sama5d27_som1_ek: add mmc capabilities for SDMMC0

From: Eugen Hristev <[email protected]>

Add mmc capabilities for SDMMC0 for this board. With this enabled, eMMC connected card is detected as:

mmc0: new DDR MMC card at address 0001

---
 arch/arm/boot/dts/at91-sama5d27_som1_ek.dts | 1 +
 1 file changed, 1 insertion(+)
arch/arm/boot/dts/at91-sama5d27_som1_ek.dts +1 -0
index 149e539..194b3a3 100644
@@ -54,6 +54,7 @@
 
 		sdmmc0: sdio-host@a0000000 {
 			bus-width = <8>;
+			mmc-ddr-3_3v;
 			pinctrl-names = "default";
 			pinctrl-0 = <&pinctrl_sdmmc0_default>;
 			status = "okay";
Signature · 1 line
2.7.4
Acked-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] ARM: dts: at91: sama5d27_som1_ek: add mmc capabilities for SDMMC0

Quoted 8 lines · On Thu, Aug 08, 2019 at 10:35:43AM +0200, Eugen Hristev - M18282 wrote:

From: Eugen Hristev <[email protected]>

Add mmc capabilities for SDMMC0 for this board. With this enabled, eMMC connected card is detected as:

mmc0: new DDR MMC card at address 0001

I am interested to have the some insights about the use of sd-uhs-* properties.

Our IP can't deal with 1V8 by itself. It has a 1V8SEL signal which can be used as the logic control input of a mux. So even if the IP claims to support UHS modes, it depends on the board.

Are the sd-uhs-* properties a way to deal with this? I tend to think no as sdhci_setup_host() will set the caps depending on the content of the capabilities register. Do we have to use the SDHCI_QUIRK_MISSING_CAPS quirk or sdhci-caps/sdhci-caps-mask?

Regards

Ludovic

Quoted 19 lines
---
 arch/arm/boot/dts/at91-sama5d27_som1_ek.dts | 1 +
 1 file changed, 1 insertion(+)
arch/arm/boot/dts/at91-sama5d27_som1_ek.dts +1 -0
index 149e539..194b3a3 100644
@@ -54,6 +54,7 @@
 
 		sdmmc0: sdio-host@a0000000 {
 			bus-width = <8>;
+			mmc-ddr-3_3v;
 			pinctrl-names = "default";
 			pinctrl-0 = <&pinctrl_sdmmc0_default>;
 			status = "okay";
Signature · 1 line
2.7.4
Acked-by on v1 1/2
#9 lore raw
In reply to [email protected]
Quoted 9 lines · On Thu, Aug 08, 2019 at 10:35:40AM +0200, Eugen Hristev - M18282 wrote:

From: Eugen Hristev <[email protected]>

HS200 is not implemented in the driver, but the controller claims it through caps.
Remove it via quirk.
Without this quirk, the mmc core will try to enable hs200, which will fail, and the eMMC initialization will fail.

Thanks

Ludovic

Quoted 21 lines
---
 drivers/mmc/host/sdhci-of-at91.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/mmc/host/sdhci-of-at91.c +3 -0
index 57fe3b2..3a8c6d8 100644
@@ -370,6 +370,9 @@ static int sdhci_at91_probe(struct platform_device *pdev)
 	pm_runtime_set_autosuspend_delay(&pdev->dev, 50);
 	pm_runtime_use_autosuspend(&pdev->dev);
 
+	/* HS200 is broken at this moment */
+	host->quirks2 = SDHCI_QUIRK2_BROKEN_HS200;
+
 	ret = sdhci_add_host(host);
 	if (ret)
 		goto pm_runtime_disable;
Signature · 1 line
2.7.4
maintainer
#3 lore raw

Re: [PATCH 2/2] ARM: dts: at91: sama5d27_som1_ek: add mmc capabilities for SDMMC0

In reply to Ludovic Desroches
Quoted 14 lines · Ludovic Desroches
Quoted 8 lines · On Thu, Aug 08, 2019 at 10:35:43AM +0200, Eugen Hristev - M18282 wrote:

From: Eugen Hristev <[email protected]>

Add mmc capabilities for SDMMC0 for this board. With this enabled, eMMC connected card is detected as:

mmc0: new DDR MMC card at address 0001

I am interested to have the some insights about the use of sd-uhs-* properties.

Quoted 8 lines

Our IP can't deal with 1V8 by itself. It has a 1V8SEL signal which can be used as the logic control input of a mux. So even if the IP claims to support UHS modes, it depends on the board.

Are the sd-uhs-* properties a way to deal with this? I tend to think no as sdhci_setup_host() will set the caps depending on the content of the capabilities register. Do we have to use the SDHCI_QUIRK_MISSING_CAPS quirk or sdhci-caps/sdhci-caps-mask?

There is "no-1-8-v" which it looks like sdhci-of-at91.c already supports:

sdhci_at91_probe() -> sdhci_get_of_property() -> sdhci_get_property()

    	if (device_property_present(dev, "no-1-8-v"))
		host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V;
Quoted 25 lines

Regards

Ludovic

Quoted 19 lines
---
 arch/arm/boot/dts/at91-sama5d27_som1_ek.dts | 1 +
 1 file changed, 1 insertion(+)
arch/arm/boot/dts/at91-sama5d27_som1_ek.dts +1 -0
index 149e539..194b3a3 100644
@@ -54,6 +54,7 @@
 
 		sdmmc0: sdio-host@a0000000 {
 			bus-width = <8>;
+			mmc-ddr-3_3v;
 			pinctrl-names = "default";
 			pinctrl-0 = <&pinctrl_sdmmc0_default>;
 			status = "okay";
Signature · 1 line
2.7.4
maintainer Acked-by on v1 1/2
#10 lore raw
In reply to [email protected]
Quoted 9 lines · On 8/08/19 11:35 AM, [email protected] wrote:

From: Eugen Hristev <[email protected]>

HS200 is not implemented in the driver, but the controller claims it through caps.
Remove it via quirk.
Without this quirk, the mmc core will try to enable hs200, which will fail, and the eMMC initialization will fail.

Quoted 19 lines
---
 drivers/mmc/host/sdhci-of-at91.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/mmc/host/sdhci-of-at91.c +3 -0
index 57fe3b2..3a8c6d8 100644
@@ -370,6 +370,9 @@ static int sdhci_at91_probe(struct platform_device *pdev)
 	pm_runtime_set_autosuspend_delay(&pdev->dev, 50);
 	pm_runtime_use_autosuspend(&pdev->dev);
 
+	/* HS200 is broken at this moment */
+	host->quirks2 = SDHCI_QUIRK2_BROKEN_HS200;
+
 	ret = sdhci_add_host(host);
 	if (ret)
 		goto pm_runtime_disable;
#11 lore raw
In reply to [email protected]
Quoted 10 lines · On Thu, 8 Aug 2019 at 10:35, <[email protected]> wrote:

From: Eugen Hristev <[email protected]>

HS200 is not implemented in the driver, but the controller claims it through caps.
Remove it via quirk.
Without this quirk, the mmc core will try to enable hs200, which will fail, and the eMMC initialization will fail.

Should this be applied as a fix and possibly tagged for stable?

In such case, do you have a specific commit that it fixes?

Kind regards
Uffe

Quoted 21 lines
---
 drivers/mmc/host/sdhci-of-at91.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/mmc/host/sdhci-of-at91.c +3 -1
index 57fe3b2..3a8c6d8 100644
@@ -370,6 +370,9 @@ static int sdhci_at91_probe(struct platform_device *pdev)
        pm_runtime_set_autosuspend_delay(&pdev->dev, 50);
        pm_runtime_use_autosuspend(&pdev->dev);
 
+       /* HS200 is broken at this moment */
+       host->quirks2 = SDHCI_QUIRK2_BROKEN_HS200;
+
        ret = sdhci_add_host(host);
        if (ret)
                goto pm_runtime_disable;
--

2.7.4

#4 lore raw

Re: [PATCH 2/2] ARM: dts: at91: sama5d27_som1_ek: add mmc capabilities for SDMMC0

In reply to Adrian Hunter
Quoted 24 lines · Adrian Hunter
Quoted 14 lines · Ludovic Desroches
Quoted 8 lines · On Thu, Aug 08, 2019 at 10:35:43AM +0200, Eugen Hristev - M18282 wrote:

From: Eugen Hristev <[email protected]>

Add mmc capabilities for SDMMC0 for this board. With this enabled, eMMC connected card is detected as:

mmc0: new DDR MMC card at address 0001

I am interested to have the some insights about the use of sd-uhs-* properties.

Quoted 8 lines

Our IP can't deal with 1V8 by itself. It has a 1V8SEL signal which can be used as the logic control input of a mux. So even if the IP claims to support UHS modes, it depends on the board.

Are the sd-uhs-* properties a way to deal with this? I tend to think no as sdhci_setup_host() will set the caps depending on the content of the capabilities register. Do we have to use the SDHCI_QUIRK_MISSING_CAPS quirk or sdhci-caps/sdhci-caps-mask?

Quoted 7 lines

There is "no-1-8-v" which it looks like sdhci-of-at91.c already supports:

sdhci_at91_probe() -> sdhci_get_of_property() -> sdhci_get_property()

    	if (device_property_present(dev, "no-1-8-v"))
		host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V;

Right, I forgot this property. Thanks.

Eugen, do you see cases we can't cover with this property?

Regards

Ludovic

Quoted 27 lines
Quoted 26 lines

Regards

Ludovic

Quoted 19 lines
---
 arch/arm/boot/dts/at91-sama5d27_som1_ek.dts | 1 +
 1 file changed, 1 insertion(+)
arch/arm/boot/dts/at91-sama5d27_som1_ek.dts +1 -0
index 149e539..194b3a3 100644
@@ -54,6 +54,7 @@
 
 		sdmmc0: sdio-host@a0000000 {
 			bus-width = <8>;
+			mmc-ddr-3_3v;
 			pinctrl-names = "default";
 			pinctrl-0 = <&pinctrl_sdmmc0_default>;
 			status = "okay";
Signature · 1 line
2.7.4
#12 lore raw
In reply to Ulf Hansson
Quoted 10 lines · Ulf Hansson
Quoted 9 lines · On Thu, 8 Aug 2019 at 10:35, <[email protected]> wrote:

From: Eugen Hristev <[email protected]>

HS200 is not implemented in the driver, but the controller claims it through caps.
Remove it via quirk.
Without this quirk, the mmc core will try to enable hs200, which will fail, and the eMMC initialization will fail.

Quoted 5 lines
Quoted 1 line

Should this be applied as a fix and possibly tagged for stable?

In such case, do you have a specific commit that it fixes?

I think so, I would say:

Fixes bb5f8ea4d514 ("mmc: sdhci-of-at91: introduce driver for the Atmel SDMMC")
Cc [email protected] #v4.4 and later

It doesn't apply on 4.4 but resolution is trivial.

Regards

Ludovic

Quoted 25 lines

Kind regards
Uffe

Quoted 21 lines
---
 drivers/mmc/host/sdhci-of-at91.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/mmc/host/sdhci-of-at91.c +3 -1
index 57fe3b2..3a8c6d8 100644
@@ -370,6 +370,9 @@ static int sdhci_at91_probe(struct platform_device *pdev)
        pm_runtime_set_autosuspend_delay(&pdev->dev, 50);
        pm_runtime_use_autosuspend(&pdev->dev);
 
+       /* HS200 is broken at this moment */
+       host->quirks2 = SDHCI_QUIRK2_BROKEN_HS200;
+
        ret = sdhci_add_host(host);
        if (ret)
                goto pm_runtime_disable;
--

2.7.4

#5 lore raw

Re: [PATCH 2/2] ARM: dts: at91: sama5d27_som1_ek: add mmc capabilities for SDMMC0

In reply to Ludovic Desroches
Quoted 29 lines · Ludovic Desroches
Quoted 28 lines · Adrian Hunter
Quoted 14 lines · Ludovic Desroches
Quoted 8 lines · On Thu, Aug 08, 2019 at 10:35:43AM +0200, Eugen Hristev - M18282 wrote:

From: Eugen Hristev <[email protected]>

Add mmc capabilities for SDMMC0 for this board. With this enabled, eMMC connected card is detected as:

mmc0: new DDR MMC card at address 0001

I am interested to have the some insights about the use of sd-uhs-* properties.

Quoted 8 lines

Our IP can't deal with 1V8 by itself. It has a 1V8SEL signal which can be used as the logic control input of a mux. So even if the IP claims to support UHS modes, it depends on the board.

Are the sd-uhs-* properties a way to deal with this? I tend to think no as sdhci_setup_host() will set the caps depending on the content of the capabilities register. Do we have to use the SDHCI_QUIRK_MISSING_CAPS quirk or sdhci-caps/sdhci-caps-mask?

There is "no-1-8-v" which it looks like sdhci-of-at91.c already supports:

   sdhci_at91_probe() -> sdhci_get_of_property() -> sdhci_get_property()
Quoted 7 lines
Quoted 3 lines
     	if (device_property_present(dev, "no-1-8-v"))
		host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V;

Right, I forgot this property. Thanks.

Eugen, do you see cases we can't cover with this property?

Hi,

For current requirements and driver support, this should be enough.

I noticed one thing regarding SD-Cards, if I add property sd-uhs-sdr104 the class 10 uhs1 cards are detected as SDR104 . Without this property they are detected as DDR50. Any idea why the difference ? The controller does not claim to have SDR104 support ? We should add it ?

Eugen

Quoted 33 lines

Regards

Ludovic

Quoted 27 lines
Quoted 26 lines

Regards

Ludovic

Quoted 19 lines
---
  arch/arm/boot/dts/at91-sama5d27_som1_ek.dts | 1 +
  1 file changed, 1 insertion(+)
arch/arm/boot/dts/at91-sama5d27_som1_ek.dts +1 -0
index 149e539..194b3a3 100644
@@ -54,6 +54,7 @@
 
  		sdmmc0: sdio-host@a0000000 {
  			bus-width = <8>;
+			mmc-ddr-3_3v;
  			pinctrl-names = "default";
  			pinctrl-0 = <&pinctrl_sdmmc0_default>;
  			status = "okay";
Signature · 1 line
2.7.4
#6 lore raw

Re: [PATCH 2/2] ARM: dts: at91: sama5d27_som1_ek: add mmc capabilities for SDMMC0

Quoted 38 lines · On Mon, Aug 12, 2019 at 03:38:34PM +0000, [email protected] wrote:
Quoted 29 lines · Ludovic Desroches
Quoted 28 lines · Adrian Hunter
Quoted 14 lines · Ludovic Desroches
Quoted 8 lines · On Thu, Aug 08, 2019 at 10:35:43AM +0200, Eugen Hristev - M18282 wrote:

From: Eugen Hristev <[email protected]>

Add mmc capabilities for SDMMC0 for this board. With this enabled, eMMC connected card is detected as:

mmc0: new DDR MMC card at address 0001

I am interested to have the some insights about the use of sd-uhs-* properties.

Quoted 8 lines

Our IP can't deal with 1V8 by itself. It has a 1V8SEL signal which can be used as the logic control input of a mux. So even if the IP claims to support UHS modes, it depends on the board.

Are the sd-uhs-* properties a way to deal with this? I tend to think no as sdhci_setup_host() will set the caps depending on the content of the capabilities register. Do we have to use the SDHCI_QUIRK_MISSING_CAPS quirk or sdhci-caps/sdhci-caps-mask?

There is "no-1-8-v" which it looks like sdhci-of-at91.c already supports:

   sdhci_at91_probe() -> sdhci_get_of_property() -> sdhci_get_property()
Quoted 7 lines
Quoted 3 lines
     	if (device_property_present(dev, "no-1-8-v"))
		host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V;

Right, I forgot this property. Thanks.

Eugen, do you see cases we can't cover with this property?

Quoted 8 lines

Hi,

For current requirements and driver support, this should be enough.

I noticed one thing regarding SD-Cards, if I add property sd-uhs-sdr104 the class 10 uhs1 cards are detected as SDR104 . Without this property they are detected as DDR50. Any idea why the difference ? The controller does not claim to have SDR104 support ? We should add it ?

With the mainline, our tree or both? In our tree, SDR104 is removed from the capabilities.

Ludovic

#13 lore raw
In reply to Ludovic Desroches
Quoted 19 lines · Ludovic Desroches
Quoted 10 lines · Ulf Hansson
Quoted 9 lines · On Thu, 8 Aug 2019 at 10:35, <[email protected]> wrote:

From: Eugen Hristev <[email protected]>

HS200 is not implemented in the driver, but the controller claims it through caps.
Remove it via quirk.
Without this quirk, the mmc core will try to enable hs200, which will fail, and the eMMC initialization will fail.

Quoted 5 lines
Quoted 1 line

Should this be applied as a fix and possibly tagged for stable?

In such case, do you have a specific commit that it fixes?

I think so, I would say:

Quoted 9 lines
Fixes bb5f8ea4d514 ("mmc: sdhci-of-at91: introduce driver for the Atmel SDMMC")
Cc [email protected] #v4.4 and later

It doesn't apply on 4.4 but resolution is trivial.

Regards

Ludovic

[...]

Applied for fixes, by adding the above tags, thanks!

Kind regards
Uffe

#7 lore raw

Re: [PATCH 2/2] ARM: dts: at91: sama5d27_som1_ek: add mmc capabilities for SDMMC0

In reply to Ludovic Desroches
Quoted 48 lines · Ludovic Desroches
Quoted 38 lines · On Mon, Aug 12, 2019 at 03:38:34PM +0000, [email protected] wrote:
Quoted 29 lines · Ludovic Desroches
Quoted 28 lines · Adrian Hunter
Quoted 14 lines · Ludovic Desroches
Quoted 8 lines · On Thu, Aug 08, 2019 at 10:35:43AM +0200, Eugen Hristev - M18282 wrote:

From: Eugen Hristev <[email protected]>

Add mmc capabilities for SDMMC0 for this board. With this enabled, eMMC connected card is detected as:

mmc0: new DDR MMC card at address 0001

I am interested to have the some insights about the use of sd-uhs-* properties.

Quoted 8 lines

Our IP can't deal with 1V8 by itself. It has a 1V8SEL signal which can be used as the logic control input of a mux. So even if the IP claims to support UHS modes, it depends on the board.

Are the sd-uhs-* properties a way to deal with this? I tend to think no as sdhci_setup_host() will set the caps depending on the content of the capabilities register. Do we have to use the SDHCI_QUIRK_MISSING_CAPS quirk or sdhci-caps/sdhci-caps-mask?

There is "no-1-8-v" which it looks like sdhci-of-at91.c already supports:

    sdhci_at91_probe() -> sdhci_get_of_property() -> sdhci_get_property()
Quoted 7 lines
Quoted 3 lines
      	if (device_property_present(dev, "no-1-8-v"))
		host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V;

Right, I forgot this property. Thanks.

Eugen, do you see cases we can't cover with this property?

Quoted 8 lines

Hi,

For current requirements and driver support, this should be enough.

I noticed one thing regarding SD-Cards, if I add property sd-uhs-sdr104 the class 10 uhs1 cards are detected as SDR104 . Without this property they are detected as DDR50. Any idea why the difference ? The controller does not claim to have SDR104 support ? We should add it ?

Quoted 5 lines

With the mainline, our tree or both? In our tree, SDR104 is removed from the capabilities.

Ludovic

Hello Alexandre,

Anything more needed regarding this patch ?

Thanks,
Eugen

#8 lore raw

Re: [PATCH 2/2] ARM: dts: at91: sama5d27_som1_ek: add mmc capabilities for SDMMC0

Quoted 54 lines · On 03/10/2019 10:24:52+0000, [email protected] wrote:
Quoted 51 lines · Ludovic Desroches
Quoted 38 lines · On Mon, Aug 12, 2019 at 03:38:34PM +0000, [email protected] wrote:
Quoted 29 lines · Ludovic Desroches
Quoted 28 lines · Adrian Hunter
Quoted 14 lines · Ludovic Desroches
Quoted 8 lines · On Thu, Aug 08, 2019 at 10:35:43AM +0200, Eugen Hristev - M18282 wrote:

From: Eugen Hristev <[email protected]>

Add mmc capabilities for SDMMC0 for this board. With this enabled, eMMC connected card is detected as:

mmc0: new DDR MMC card at address 0001

I am interested to have the some insights about the use of sd-uhs-* properties.

Quoted 8 lines

Our IP can't deal with 1V8 by itself. It has a 1V8SEL signal which can be used as the logic control input of a mux. So even if the IP claims to support UHS modes, it depends on the board.

Are the sd-uhs-* properties a way to deal with this? I tend to think no as sdhci_setup_host() will set the caps depending on the content of the capabilities register. Do we have to use the SDHCI_QUIRK_MISSING_CAPS quirk or sdhci-caps/sdhci-caps-mask?

There is "no-1-8-v" which it looks like sdhci-of-at91.c already supports:

    sdhci_at91_probe() -> sdhci_get_of_property() -> sdhci_get_property()
Quoted 7 lines
Quoted 3 lines
      	if (device_property_present(dev, "no-1-8-v"))
		host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V;

Right, I forgot this property. Thanks.

Eugen, do you see cases we can't cover with this property?

Quoted 8 lines

Hi,

For current requirements and driver support, this should be enough.

I noticed one thing regarding SD-Cards, if I add property sd-uhs-sdr104 the class 10 uhs1 cards are detected as SDR104 . Without this property they are detected as DDR50. Any idea why the difference ? The controller does not claim to have SDR104 support ? We should add it ?

With the mainline, our tree or both? In our tree, SDR104 is removed from the capabilities.

Quoted 8 lines
Quoted 2 lines

Ludovic

Hello Alexandre,

Anything more needed regarding this patch ?

I was not sure it was applicable, seeing the discussion. I'll apply it now.

Signature · 3 lines
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com