Skip to contentSkip to conversation

mmc: tegra: prevent HS200 on Tegra 3

PATCH Applied Stefan Agner 5 participants 16 messages Jul 12, 2018 – Jul 28, 2018

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

PATCH 1/3 mmc: tegra: prevent HS200 on Tegra 3

The stack assumes that SDHC controller which support SD3.0 (SDR104) do support HS200. This is not the case for Tegra 3, which does support SD 3.0
but only supports eMMC spec 4.41.

Use SDHCI_QUIRK2_BROKEN_HS200 to indicate that the controller does not support HS200.

Note that commit 156e14b126ff ("mmc: sdhci: fix caps2 for HS200") added the tie between SD3.0 (SDR104) and HS200. I don't think that this is necessarly true. It is fully legitimate to support SD3.0 and not support HS200. The quirk naming suggests something is broken in the controller, but this is not the case: The controller simply does not support HS200.

Fixes 7ad2ed1dfcbe ("mmc: tegra: enable UHS-I modes")
---
 drivers/mmc/host/sdhci-tegra.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mmc/host/sdhci-tegra.c +2 -1
index 970d38f68939..137df06b9b6e 100644
@@ -334,7 +334,8 @@ static const struct sdhci_pltfm_data sdhci_tegra30_pdata = {
 		  SDHCI_QUIRK_NO_HISPD_BIT |
 		  SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC |
 		  SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
-	.quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN,
+	.quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN |
+		   SDHCI_QUIRK2_BROKEN_HS200,
 	.ops  = &tegra_sdhci_ops,
 };
 
Signature · 1 line
2.18.0
#1 lore raw

PATCH 2/3 mmc: tegra: fix eMMC DDR52 mode

Make sure the clock is doubled when using eMMC DDR52 mode.

---
 drivers/mmc/host/sdhci-tegra.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mmc/host/sdhci-tegra.c +2 -1
index 137df06b9b6e..888a1ad511db 100644
@@ -228,7 +228,8 @@ static void tegra_sdhci_set_uhs_signaling(struct sdhci_host *host,
 	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
 	struct sdhci_tegra *tegra_host = sdhci_pltfm_priv(pltfm_host);
 
-	if (timing == MMC_TIMING_UHS_DDR50)
+	if (timing == MMC_TIMING_UHS_DDR50 ||
+	    timing == MMC_TIMING_MMC_DDR52)
 		tegra_host->ddr_signaling = true;
 
 	sdhci_set_uhs_signaling(host, timing);
Signature · 1 line
2.18.0
#2 lore raw

PATCH 3/3 mmc: tegra: prevent ACMD23 on Tegra 3

In reply to Stefan Agner

It seems that SD3.0 advertisement needs to be set for higher eMMC speed modes (namely DDR52) as well. The TRM states that the SD3.0 advertisement bit should be set for all controller instances, even for those not supporting UHS-I mode...

When specifying vqmmc-supply as a fixed 1.8V regulator on a Tegra
SD/MMC instance which is connected to a eMMC device, the stack
enables SD3.0. However, enabling it has consequences: If SDHCI 3.0
support is advertised the stack enables Auto-CMD23. Unfortunately Auto-CMD23 seems not to work well with Tegra 3 currently. It leads
to regular warnings:
mmc2: Got command interrupt 0x00010000 even though no command operation was in progress.

It is not entirely clear why those errors happens. It seems that a Linux 3.1 based downstream kernel which has Auto-CMD23 support does not show those warnings.

Use quirk SDHCI_QUIRK2_ACMD23_BROKEN to prevent Auto-CMD23 being used for now. With this the eMMC works stable on high-speed mode while still announcing SD3.0.

This allows to use mmc-ddr-1_8v to enables DDR52 mode. In DDR52 mode read speed improves from about 42MiB/s to 72MiB/s on an Apalis T30.

---
 drivers/mmc/host/sdhci-tegra.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/mmc/host/sdhci-tegra.c +9 -1
index 888a1ad511db..11c0b2069c7c 100644
@@ -336,7 +336,15 @@ static const struct sdhci_pltfm_data sdhci_tegra30_pdata = {
 		  SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC |
 		  SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
 	.quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN |
-		   SDHCI_QUIRK2_BROKEN_HS200,
+		   SDHCI_QUIRK2_BROKEN_HS200 |
+		   /*
+		    * Auto-CMD23 leads to "Got command interrupt 0x00010000 even
+		    * though no command operation was in progress."
+		    *
+		    * The exact reason is unknown, as the same hardware seems
+		    * to support Auto CMD23 on a downstream 3.1 kernel.
+		    */
+		   SDHCI_QUIRK2_ACMD23_BROKEN,
 	.ops  = &tegra_sdhci_ops,
 };
 
Signature · 1 line
2.18.0
#3 lore raw

Re: [PATCH 3/3] mmc: tegra: prevent ACMD23 on Tegra 3

Quoted 41 lines · Stefan Agner

It seems that SD3.0 advertisement needs to be set for higher eMMC speed modes (namely DDR52) as well. The TRM states that the SD3.0 advertisement bit should be set for all controller instances, even for those not supporting UHS-I mode...

When specifying vqmmc-supply as a fixed 1.8V regulator on a Tegra
SD/MMC instance which is connected to a eMMC device, the stack
enables SD3.0. However, enabling it has consequences: If SDHCI 3.0
support is advertised the stack enables Auto-CMD23. Unfortunately
Auto-CMD23 seems not to work well with Tegra 3 currently. It leads
to regular warnings:
mmc2: Got command interrupt 0x00010000 even though no command operation was in progress.

It is not entirely clear why those errors happens. It seems that a Linux 3.1 based downstream kernel which has Auto-CMD23 support does not show those warnings.

Use quirk SDHCI_QUIRK2_ACMD23_BROKEN to prevent Auto-CMD23 being used for now. With this the eMMC works stable on high-speed mode while still announcing SD3.0.

This allows to use mmc-ddr-1_8v to enables DDR52 mode. In DDR52 mode read speed improves from about 42MiB/s to 72MiB/s on an Apalis T30.

---
  drivers/mmc/host/sdhci-tegra.c | 10 +++++++++-
  1 file changed, 9 insertions(+), 1 deletion(-)
drivers/mmc/host/sdhci-tegra.c +2 -1
index 888a1ad511db..11c0b2069c7c 100644
@@ -336,7 +336,15 @@ static const struct sdhci_pltfm_data sdhci_tegra30_pdata = {
  		  SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC |
  		  SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
  	.quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN |
-		   SDHCI_QUIRK2_BROKEN_HS200,
+		   SDHCI_QUIRK2_BROKEN_HS200 |
+		   /*

drivers/mmc/host/sdhci-tegra.c static const struct sdhci_pltfm_data sdhci_tegra30_pdata = { · line 350

Quoted 10 lines
drivers/mmc/host/sdhci-tegra.c +7 -0
+		    * Auto-CMD23 leads to "Got command interrupt 0x00010000 even
+		    * though no command operation was in progress."
+		    *
+		    * The exact reason is unknown, as the same hardware seems
+		    * to support Auto CMD23 on a downstream 3.1 kernel.
+		    */
+		   SDHCI_QUIRK2_ACMD23_BROKEN,
  	.ops  = &tegra_sdhci_ops,
  };
 

I finally got around to testing this on the Ouya (Tegra 3).

I found that the "Got command interrupt 0x00010000 even though no command operation was in progress." error occurred when the interface is unstable.
I've had a lot of problems with sdmmc4 stability on the Ouya above 34 Mhz, probably due to the fact that they are using the internal cmd and clock pull-up resistors, against the TRM's instruction. At 39Mhz, I saw the error this patch corrects.
With the patch, the error went away, but the interface is still unstable under load.

Lowering down to 32Mhz, without the patch there are no errors.

#4 lore raw

Re: [PATCH 3/3] mmc: tegra: prevent ACMD23 on Tegra 3

Quoted 46 lines · Peter Geis
Quoted 45 lines · Stefan Agner

It seems that SD3.0 advertisement needs to be set for higher eMMC speed modes (namely DDR52) as well. The TRM states that the SD3.0 advertisement bit should be set for all controller instances, even for those not supporting UHS-I mode...

When specifying vqmmc-supply as a fixed 1.8V regulator on a Tegra
SD/MMC instance which is connected to a eMMC device, the stack
enables SD3.0. However, enabling it has consequences: If SDHCI 3.0
support is advertised the stack enables Auto-CMD23. Unfortunately
Auto-CMD23 seems not to work well with Tegra 3 currently. It leads
to regular warnings:
mmc2: Got command interrupt 0x00010000 even though no command operation was in progress.

It is not entirely clear why those errors happens. It seems that a Linux 3.1 based downstream kernel which has Auto-CMD23 support does not show those warnings.

Use quirk SDHCI_QUIRK2_ACMD23_BROKEN to prevent Auto-CMD23 being used for now. With this the eMMC works stable on high-speed mode while still announcing SD3.0.

This allows to use mmc-ddr-1_8v to enables DDR52 mode. In DDR52 mode read speed improves from about 42MiB/s to 72MiB/s on an Apalis T30.

---
  drivers/mmc/host/sdhci-tegra.c | 10 +++++++++-
  1 file changed, 9 insertions(+), 1 deletion(-)
drivers/mmc/host/sdhci-tegra.c +6 -1
index 888a1ad511db..11c0b2069c7c 100644
@@ -336,7 +336,15 @@ static const struct sdhci_pltfm_data sdhci_tegra30_pdata = {
  		  SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC |
  		  SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
  	.quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN |
-		   SDHCI_QUIRK2_BROKEN_HS200,
+		   SDHCI_QUIRK2_BROKEN_HS200 |
+		   /*
+		    * Auto-CMD23 leads to "Got command interrupt 0x00010000 even
+		    * though no command operation was in progress."
+		    *
+		    * The exact reason is unknown, as the same hardware seems
Quoted 8 lines

drivers/mmc/host/sdhci-tegra.c static const struct sdhci_pltfm_data sdhci_tegra30_pdata = { · line 350

Quoted 6 lines
drivers/mmc/host/sdhci-tegra.c +3 -0
+		    * to support Auto CMD23 on a downstream 3.1 kernel.
+		    */
+		   SDHCI_QUIRK2_ACMD23_BROKEN,
  	.ops  = &tegra_sdhci_ops,
  };
 

I finally got around to testing this on the Ouya (Tegra 3).

Thanks for testing!

Quoted 10 lines

I found that the "Got command interrupt 0x00010000 even though no command operation was in progress." error occurred when the interface is unstable.
I've had a lot of problems with sdmmc4 stability on the Ouya above 34 Mhz, probably due to the fact that they are using the internal cmd and clock pull-up resistors, against the TRM's instruction.
At 39Mhz, I saw the error this patch corrects.
With the patch, the error went away, but the interface is still unstable under load.

How does this instability manifest exactly?

Quoted 2 lines

Lowering down to 32Mhz, without the patch there are no errors.

So the patch does not make it less stable right?

--
Stefan

#5 lore raw

Re: [PATCH 3/3] mmc: tegra: prevent ACMD23 on Tegra 3

Quoted 69 lines · Stefan Agner
Quoted 46 lines · Peter Geis
Quoted 45 lines · Stefan Agner

It seems that SD3.0 advertisement needs to be set for higher eMMC speed modes (namely DDR52) as well. The TRM states that the SD3.0 advertisement bit should be set for all controller instances, even for those not supporting UHS-I mode...

When specifying vqmmc-supply as a fixed 1.8V regulator on a Tegra SD/MMC instance which is connected to a eMMC device, the stack enables SD3.0. However, enabling it has consequences: If SDHCI 3.0 support is advertised the stack enables Auto-CMD23. Unfortunately Auto-CMD23 seems not to work well with Tegra 3 currently. It leads to regular warnings:

    mmc2: Got command interrupt 0x00010000 even though no command operation was in progress.

It is not entirely clear why those errors happens. It seems that a Linux 3.1 based downstream kernel which has Auto-CMD23 support does not show those warnings.

Use quirk SDHCI_QUIRK2_ACMD23_BROKEN to prevent Auto-CMD23 being used for now. With this the eMMC works stable on high-speed mode while still announcing SD3.0.

This allows to use mmc-ddr-1_8v to enables DDR52 mode. In DDR52 mode read speed improves from about 42MiB/s to 72MiB/s on an Apalis T30.

---
   drivers/mmc/host/sdhci-tegra.c | 10 +++++++++-
   1 file changed, 9 insertions(+), 1 deletion(-)
drivers/mmc/host/sdhci-tegra.c +6 -1
index 888a1ad511db..11c0b2069c7c 100644
@@ -336,7 +336,15 @@ static const struct sdhci_pltfm_data sdhci_tegra30_pdata = {
   		  SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC |
   		  SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
   	.quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN |
-		   SDHCI_QUIRK2_BROKEN_HS200,
+		   SDHCI_QUIRK2_BROKEN_HS200 |
+		   /*
+		    * Auto-CMD23 leads to "Got command interrupt 0x00010000 even
+		    * though no command operation was in progress."
+		    *
+		    * The exact reason is unknown, as the same hardware seems
Quoted 8 lines

drivers/mmc/host/sdhci-tegra.c static const struct sdhci_pltfm_data sdhci_tegra30_pdata = { · line 350

Quoted 6 lines
drivers/mmc/host/sdhci-tegra.c +3 -0
+		    * to support Auto CMD23 on a downstream 3.1 kernel.
+		    */
+		   SDHCI_QUIRK2_ACMD23_BROKEN,
   	.ops  = &tegra_sdhci_ops,
   };
 

I finally got around to testing this on the Ouya (Tegra 3).

Thanks for testing!

Quoted 10 lines

I found that the "Got command interrupt 0x00010000 even though no command operation was in progress." error occurred when the interface is unstable.
I've had a lot of problems with sdmmc4 stability on the Ouya above 34 Mhz, probably due to the fact that they are using the internal cmd and clock pull-up resistors, against the TRM's instruction.
At 39Mhz, I saw the error this patch corrects.
With the patch, the error went away, but the interface is still unstable under load.

Quoted 2 lines

How does this instability manifest exactly?

At the very edge of stability, you see write errors under heavy load. As clock rate increases, the write errors occur more frequently. At a certain point, you start getting read errors. Following that you get constant io errors during card probing. Eventually the emmc will fail to initialize, with errors 87 or 110.

I've been tweaking the pull up/down values to try and improve the stability, but without access to anything but the TRM it's a lot of trial and error.

Quoted 5 lines
Quoted 2 lines

Lowering down to 32Mhz, without the patch there are no errors.

So the patch does not make it less stable right?

No, it did not affect stability.
Although I'd conduct some performance testing to check for degradation.
Of course I'm nowhere near the limits of the controller, so it is doubtful I'd see a hit.

Quoted 3 lines

--
Stefan

#6 lore raw

Re: [PATCH 3/3] mmc: tegra: prevent ACMD23 on Tegra 3

Quoted 70 lines · Peter Geis
Quoted 69 lines · Stefan Agner
Quoted 46 lines · Peter Geis
Quoted 45 lines · Stefan Agner

It seems that SD3.0 advertisement needs to be set for higher eMMC speed modes (namely DDR52) as well. The TRM states that the SD3.0 advertisement bit should be set for all controller instances, even for those not supporting UHS-I mode...

When specifying vqmmc-supply as a fixed 1.8V regulator on a Tegra SD/MMC instance which is connected to a eMMC device, the stack enables SD3.0. However, enabling it has consequences: If SDHCI 3.0 support is advertised the stack enables Auto-CMD23. Unfortunately Auto-CMD23 seems not to work well with Tegra 3 currently. It leads to regular warnings:

    mmc2: Got command interrupt 0x00010000 even though no command operation was in progress.

It is not entirely clear why those errors happens. It seems that a Linux 3.1 based downstream kernel which has Auto-CMD23 support does not show those warnings.

Use quirk SDHCI_QUIRK2_ACMD23_BROKEN to prevent Auto-CMD23 being used for now. With this the eMMC works stable on high-speed mode while still announcing SD3.0.

This allows to use mmc-ddr-1_8v to enables DDR52 mode. In DDR52 mode read speed improves from about 42MiB/s to 72MiB/s on an Apalis T30.

---
   drivers/mmc/host/sdhci-tegra.c | 10 +++++++++-
   1 file changed, 9 insertions(+), 1 deletion(-)
drivers/mmc/host/sdhci-tegra.c +6 -1
index 888a1ad511db..11c0b2069c7c 100644
@@ -336,7 +336,15 @@ static const struct sdhci_pltfm_data sdhci_tegra30_pdata = {
   		  SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC |
   		  SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
   	.quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN |
-		   SDHCI_QUIRK2_BROKEN_HS200,
+		   SDHCI_QUIRK2_BROKEN_HS200 |
+		   /*
+		    * Auto-CMD23 leads to "Got command interrupt 0x00010000 even
+		    * though no command operation was in progress."
+		    *
+		    * The exact reason is unknown, as the same hardware seems
Quoted 8 lines

drivers/mmc/host/sdhci-tegra.c static const struct sdhci_pltfm_data sdhci_tegra30_pdata = { · line 350

Quoted 6 lines
drivers/mmc/host/sdhci-tegra.c +3 -0
+		    * to support Auto CMD23 on a downstream 3.1 kernel.
+		    */
+		   SDHCI_QUIRK2_ACMD23_BROKEN,
   	.ops  = &tegra_sdhci_ops,
   };
 

I finally got around to testing this on the Ouya (Tegra 3).

Thanks for testing!

Quoted 10 lines

I found that the "Got command interrupt 0x00010000 even though no command operation was in progress." error occurred when the interface is unstable.
I've had a lot of problems with sdmmc4 stability on the Ouya above 34 Mhz, probably due to the fact that they are using the internal cmd and clock pull-up resistors, against the TRM's instruction.
At 39Mhz, I saw the error this patch corrects.
With the patch, the error went away, but the interface is still unstable under load.

Quoted 8 lines
Quoted 2 lines

How does this instability manifest exactly?

At the very edge of stability, you see write errors under heavy load. As clock rate increases, the write errors occur more frequently. At a certain point, you start getting read errors. Following that you get constant io errors during card probing. Eventually the emmc will fail to initialize, with errors 87 or 110.

What mode are you running at actually? E.g. what is the ios file saying? cat /sys/kernel/debug/mmcX/ios

Quoted 5 lines

I've been tweaking the pull up/down values to try and improve the stability, but without access to anything but the TRM it's a lot of trial and error.

Hm, maybe Marcel's recent fixes in our device tree are helpful?
https://lkml.org/lkml/2018/7/22/165

Also make sure to have a complete pinmux such that alternative pins for sdmmc4 are *not* muxed as sdmmc4.

Quoted 10 lines
Quoted 5 lines
Quoted 2 lines

Lowering down to 32Mhz, without the patch there are no errors.

So the patch does not make it less stable right?

No, it did not affect stability.
Although I'd conduct some performance testing to check for degradation. Of course I'm nowhere near the limits of the controller, so it is doubtful I'd see a hit.

Ok, and this is with the complete patchset applied correct?

Btw, what device tree are you using? Ouya is not upstream as far as I can tell?

--
Stefan

Quoted 8 lines
Quoted 4 lines

--
Stefan

--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#7 lore raw

Re: [PATCH 3/3] mmc: tegra: prevent ACMD23 on Tegra 3

Quoted 18 lines
Quoted 18 lines
Quoted 17 lines
Quoted 1 line

I finally got around to testing this on the Ouya (Tegra 3).

Thanks for testing!

Quoted 10 lines

I found that the "Got command interrupt 0x00010000 even though no command operation was in progress." error occurred when the interface is unstable.
I've had a lot of problems with sdmmc4 stability on the Ouya above 34 Mhz, probably due to the fact that they are using the internal cmd and clock pull-up resistors, against the TRM's instruction.
At 39Mhz, I saw the error this patch corrects.
With the patch, the error went away, but the interface is still unstable under load.

How does this instability manifest exactly?

Quoted 8 lines
Quoted 5 lines

At the very edge of stability, you see write errors under heavy load. As clock rate increases, the write errors occur more frequently. At a certain point, you start getting read errors. Following that you get constant io errors during card probing. Eventually the emmc will fail to initialize, with errors 87 or 110.

What mode are you running at actually? E.g. what is the ios file saying? cat /sys/kernel/debug/mmcX/ios

This is the best functionality I've been able to get prior to the patches:

root@ouya:~# cat /sys/kernel/debug/mmc0/ios
clock:          30000000 Hz
actual clock:   29142858 Hz
vdd:            21 (3.3 ~ 3.4 V)
bus mode:       2 (push-pull)
chip select:    0 (don't care)
power mode:     2 (on)
bus width:      3 (8 bits)
timing spec:    9 (mmc HS200)
signal voltage: 1 (1.80 V)
driver type:    0 (driver type B)

Now I am trying DDR, but even with the patches I'm not able to remain stable above 17Mhz (34Mhz clock).

I've also tried just straight mmc-hs mode, but even that makes no difference.

Quoted 7 lines
Quoted 6 lines

I've been tweaking the pull up/down values to try and improve the stability, but without access to anything but the TRM it's a lot of trial and error.

Quoted 5 lines

Hm, maybe Marcel's recent fixes in our device tree are helpful?
https://lkml.org/lkml/2018/7/22/165

Also make sure to have a complete pinmux such that alternative pins for sdmmc4 are *not* muxed as sdmmc4.

That was my first issue, which was preventing sdmmc4 from working at all. Just double checked all of the spare function pins, they are all assigned elsewhere.

Quoted 12 lines
Quoted 11 lines
Quoted 6 lines
Quoted 3 lines

Lowering down to 32Mhz, without the patch there are no errors.

So the patch does not make it less stable right?

No, it did not affect stability.
Although I'd conduct some performance testing to check for degradation. Of course I'm nowhere near the limits of the controller, so it is doubtful I'd see a hit.

Quoted 4 lines

Ok, and this is with the complete patchset applied correct?

Btw, what device tree are you using? Ouya is not upstream as far as I can tell?

Indeed, I have the full patchset.

Ouya is an old android game console that I've been working on getting mainline working on. I've written most of the device tree, with contributions from Matt Merhar.
It's almost bit for bit a cardhu dev board, but with everything not necessary to function removed. They cut a lot of corners with the board design.
Last stable kernel was 3.2, but it ran fine at 52mhz, mind you it reported it was running mode 5.

To get this speed, I have the pins all driven down at 4, and up at 24.
Default is 2 down and 18 up from driver init.
The pin pull ups are exactly as the original kernel, all pins pulled up except reset, which is pulled down.

Quoted 12 lines

--
Stefan

Quoted 8 lines
Quoted 4 lines

--
Stefan

--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#8 lore raw

Re: [PATCH 3/3] mmc: tegra: prevent ACMD23 on Tegra 3

Quoted 28 lines · Peter Geis
Quoted 18 lines
Quoted 18 lines
Quoted 17 lines
Quoted 1 line

I finally got around to testing this on the Ouya (Tegra 3).

Thanks for testing!

Quoted 10 lines

I found that the "Got command interrupt 0x00010000 even though no command operation was in progress." error occurred when the interface is unstable.
I've had a lot of problems with sdmmc4 stability on the Ouya above 34 Mhz, probably due to the fact that they are using the internal cmd and clock pull-up resistors, against the TRM's instruction.
At 39Mhz, I saw the error this patch corrects.
With the patch, the error went away, but the interface is still unstable under load.

How does this instability manifest exactly?

Quoted 8 lines
Quoted 5 lines

At the very edge of stability, you see write errors under heavy load. As clock rate increases, the write errors occur more frequently. At a certain point, you start getting read errors. Following that you get constant io errors during card probing. Eventually the emmc will fail to initialize, with errors 87 or 110.

What mode are you running at actually? E.g. what is the ios file saying? cat /sys/kernel/debug/mmcX/ios

This is the best functionality I've been able to get prior to the patches:

Quoted 12 lines
root@ouya:~# cat /sys/kernel/debug/mmc0/ios
clock:          30000000 Hz
actual clock:   29142858 Hz
vdd:            21 (3.3 ~ 3.4 V)
bus mode:       2 (push-pull)
chip select:    0 (don't care)
power mode:     2 (on)
bus width:      3 (8 bits)
timing spec:    9 (mmc HS200)
signal voltage: 1 (1.80 V)
driver type:    0 (driver type B)

Yeah HS200 is definilty not supported by the controller and really should not be used.

Quoted 5 lines

Now I am trying DDR, but even with the patches I'm not able to remain stable above 17Mhz (34Mhz clock).

I've also tried just straight mmc-hs mode, but even that makes no difference.

So you tried timing spec 1 (mmc HS)?

How did you exactly enable mmc-hs mode?

I suggest to *not set* vqmmc and apply patch 1. It will report that signaling voltage is 3.3V, but that did not really matter in our case. This was our baseline and always worked stable on mainline. I also would use that mode when tweaking pinmux etc...

Quoted 10 lines
Quoted 10 lines
Quoted 6 lines

I've been tweaking the pull up/down values to try and improve the stability, but without access to anything but the TRM it's a lot of trial and error.

Hm, maybe Marcel's recent fixes in our device tree are helpful?
https://lkml.org/lkml/2018/7/22/165

Quoted 7 lines
Quoted 2 lines

Also make sure to have a complete pinmux such that alternative pins for sdmmc4 are *not* muxed as sdmmc4.

That was my first issue, which was preventing sdmmc4 from working at all. Just double checked all of the spare function pins, they are all assigned elsewhere.

Ok.

Quoted 14 lines
Quoted 14 lines
Quoted 11 lines
Quoted 6 lines
Quoted 3 lines

Lowering down to 32Mhz, without the patch there are no errors.

So the patch does not make it less stable right?

No, it did not affect stability.
Although I'd conduct some performance testing to check for degradation. Of course I'm nowhere near the limits of the controller, so it is doubtful I'd see a hit.

Ok, and this is with the complete patchset applied correct?

Quoted 7 lines
Quoted 2 lines

Btw, what device tree are you using? Ouya is not upstream as far as I can tell?

Indeed, I have the full patchset.

Ouya is an old android game console that I've been working on getting mainline working on.

I know, I have one sitting here too. I only tried to tinker a bit at the very beginning...

Quoted 6 lines

I've written most of the device tree, with contributions from Matt Merhar. It's almost bit for bit a cardhu dev board, but with everything not necessary to function removed.
They cut a lot of corners with the board design.
Last stable kernel was 3.2, but it ran fine at 52mhz, mind you it reported it was running mode 5.

That is what we saw too. With Apalis/Colibri T30 L4T downstream kernel (which is 3.1 with quite some patches) 52MHz DDR worked fine, surprisingly even with ACMD23. However, speed is slightly slower than mainline 52MHz without ACMD23...

--
Stefan

Quoted 18 lines

To get this speed, I have the pins all driven down at 4, and up at 24. Default is 2 down and 18 up from driver init.
The pin pull ups are exactly as the original kernel, all pins pulled up except reset, which is pulled down.

Quoted 12 lines

--
Stefan

Quoted 8 lines
Quoted 4 lines

--
Stefan

--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#9 lore raw

Re: [PATCH 3/3] mmc: tegra: prevent ACMD23 on Tegra 3

Quoted 48 lines · Stefan Agner
Quoted 28 lines · Peter Geis
Quoted 18 lines
Quoted 18 lines
Quoted 17 lines
Quoted 1 line

I finally got around to testing this on the Ouya (Tegra 3).

Thanks for testing!

Quoted 10 lines

I found that the "Got command interrupt 0x00010000 even though no command operation was in progress." error occurred when the interface is unstable.
I've had a lot of problems with sdmmc4 stability on the Ouya above 34 Mhz, probably due to the fact that they are using the internal cmd and clock pull-up resistors, against the TRM's instruction.
At 39Mhz, I saw the error this patch corrects.
With the patch, the error went away, but the interface is still unstable under load.

How does this instability manifest exactly?

Quoted 8 lines
Quoted 5 lines

At the very edge of stability, you see write errors under heavy load. As clock rate increases, the write errors occur more frequently. At a certain point, you start getting read errors. Following that you get constant io errors during card probing. Eventually the emmc will fail to initialize, with errors 87 or 110.

What mode are you running at actually? E.g. what is the ios file saying? cat /sys/kernel/debug/mmcX/ios

This is the best functionality I've been able to get prior to the patches:

Quoted 12 lines
root@ouya:~# cat /sys/kernel/debug/mmc0/ios
clock:          30000000 Hz
actual clock:   29142858 Hz
vdd:            21 (3.3 ~ 3.4 V)
bus mode:       2 (push-pull)
chip select:    0 (don't care)
power mode:     2 (on)
bus width:      3 (8 bits)
timing spec:    9 (mmc HS200)
signal voltage: 1 (1.80 V)
driver type:    0 (driver type B)

Yeah HS200 is definilty not supported by the controller and really should not be used.

Quoted 3 lines

Now I am trying DDR, but even with the patches I'm not able to remain stable above 17Mhz (34Mhz clock).

Quoted 6 lines
Quoted 2 lines

I've also tried just straight mmc-hs mode, but even that makes no difference.

So you tried timing spec 1 (mmc HS)?

How did you exactly enable mmc-hs mode?

cap-mmc-highspeed;

Quoted 5 lines

I suggest to *not set* vqmmc and apply patch 1. It will report that signaling voltage is 3.3V, but that did not really matter in our case. This was our baseline and always worked stable on mainline. I also would use that mode when tweaking pinmux etc...

Will do, thanks.

Quoted 38 lines
Quoted 11 lines
Quoted 11 lines
Quoted 7 lines

I've been tweaking the pull up/down values to try and improve the stability, but without access to anything but the TRM it's a lot of trial and error.

Hm, maybe Marcel's recent fixes in our device tree are helpful?
https://lkml.org/lkml/2018/7/22/165

Quoted 7 lines
Quoted 2 lines

Also make sure to have a complete pinmux such that alternative pins for sdmmc4 are *not* muxed as sdmmc4.

That was my first issue, which was preventing sdmmc4 from working at all. Just double checked all of the spare function pins, they are all assigned elsewhere.

Ok.

Quoted 17 lines
Quoted 16 lines
Quoted 11 lines
Quoted 6 lines
Quoted 3 lines

Lowering down to 32Mhz, without the patch there are no errors.

So the patch does not make it less stable right?

No, it did not affect stability.
Although I'd conduct some performance testing to check for degradation. Of course I'm nowhere near the limits of the controller, so it is doubtful I'd see a hit.

Ok, and this is with the complete patchset applied correct?

Btw, what device tree are you using? Ouya is not upstream as far as I can tell?

Quoted 7 lines
Quoted 4 lines

Indeed, I have the full patchset.

Ouya is an old android game console that I've been working on getting mainline working on.

I know, I have one sitting here too. I only tried to tinker a bit at the very beginning...

It runs Xubuntu very well now with mainline.
I've got most everything roughly supported with the exception of audio.

Quoted 8 lines
Quoted 7 lines

I've written most of the device tree, with contributions from Matt Merhar. It's almost bit for bit a cardhu dev board, but with everything not necessary to function removed.
They cut a lot of corners with the board design.
Last stable kernel was 3.2, but it ran fine at 52mhz, mind you it reported it was running mode 5.

Quoted 4 lines

That is what we saw too. With Apalis/Colibri T30 L4T downstream kernel (which is 3.1 with quite some patches) 52MHz DDR worked fine, surprisingly even with ACMD23. However, speed is slightly slower than mainline 52MHz without ACMD23...

I noticed the same thing, speed with the original kernel on the MMC was worse at 52Mhz than it was at 34Mhz in HS-200 mode on mainline. I'd be happy with it where it is, but the fact that it worked at 52Mhz before makes me believe something isn't quite there yet. I selected HS-200 mode just to force 1.8v mode.

Quoted 22 lines

--
Stefan

Quoted 18 lines

To get this speed, I have the pins all driven down at 4, and up at 24. Default is 2 down and 18 up from driver init.
The pin pull ups are exactly as the original kernel, all pins pulled up except reset, which is pulled down.

Quoted 12 lines

--
Stefan

Quoted 8 lines
Quoted 4 lines

--
Stefan

--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#10 lore raw

Re: [PATCH 3/3] mmc: tegra: prevent ACMD23 on Tegra 3

Quoted 117 lines · On Thursday, 26 July 2018 20:48:55 MSK Peter Geis wrote:
Quoted 44 lines · Stefan Agner
Quoted 28 lines · Peter Geis
Quoted 17 lines
Quoted 17 lines
Quoted 16 lines
Quoted 1 line

I finally got around to testing this on the Ouya (Tegra 3).

Thanks for testing!

Quoted 10 lines

I found that the "Got command interrupt 0x00010000 even though no command operation was in progress." error occurred when the interface is unstable.
I've had a lot of problems with sdmmc4 stability on the Ouya above 34 Mhz, probably due to the fact that they are using the internal cmd and
clock pull-up resistors, against the TRM's instruction.
At 39Mhz, I saw the error this patch corrects.
With the patch, the error went away, but the interface is still unstable under load.

How does this instability manifest exactly?

Quoted 8 lines
Quoted 5 lines

At the very edge of stability, you see write errors under heavy load. As clock rate increases, the write errors occur more frequently. At a certain point, you start getting read errors. Following that you get constant io errors during card probing. Eventually the emmc will fail to initialize, with errors 87 or 110.

What mode are you running at actually? E.g. what is the ios file saying? cat /sys/kernel/debug/mmcX/ios

This is the best functionality I've been able to get prior to the patches:

Quoted 11 lines
root@ouya:~# cat /sys/kernel/debug/mmc0/ios
clock:          30000000 Hz
actual clock:   29142858 Hz
vdd:            21 (3.3 ~ 3.4 V)
bus mode:       2 (push-pull)
chip select:    0 (don't care)
power mode:     2 (on)
bus width:      3 (8 bits)
timing spec:    9 (mmc HS200)
signal voltage: 1 (1.80 V)
driver type:    0 (driver type B)

Yeah HS200 is definilty not supported by the controller and really should not be used.

Quoted 8 lines
Quoted 5 lines

Now I am trying DDR, but even with the patches I'm not able to remain stable above 17Mhz (34Mhz clock).

I've also tried just straight mmc-hs mode, but even that makes no difference.>

So you tried timing spec 1 (mmc HS)?

How did you exactly enable mmc-hs mode?

cap-mmc-highspeed;

Quoted 4 lines

I suggest to *not set* vqmmc and apply patch 1. It will report that signaling voltage is 3.3V, but that did not really matter in our case. This was our baseline and always worked stable on mainline. I also would use that mode when tweaking pinmux etc...

Will do, thanks.

Quoted 30 lines
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines

I've been tweaking the pull up/down values to try and improve the stability, but without access to anything but the TRM it's a lot of trial and error.

Hm, maybe Marcel's recent fixes in our device tree are helpful?
https://lkml.org/lkml/2018/7/22/165

Quoted 6 lines
Quoted 2 lines

Also make sure to have a complete pinmux such that alternative pins for sdmmc4 are *not* muxed as sdmmc4.

That was my first issue, which was preventing sdmmc4 from working at all. Just double checked all of the spare function pins, they are all assigned elsewhere.

Ok.

Quoted 14 lines
Quoted 13 lines
Quoted 8 lines
Quoted 3 lines
Quoted 1 line

Lowering down to 32Mhz, without the patch there are no errors.

So the patch does not make it less stable right?

No, it did not affect stability.
Although I'd conduct some performance testing to check for degradation. Of course I'm nowhere near the limits of the controller, so it is doubtful I'd see a hit.

Ok, and this is with the complete patchset applied correct?

Btw, what device tree are you using? Ouya is not upstream as far as I can tell?

Quoted 7 lines
Quoted 4 lines

Indeed, I have the full patchset.

Ouya is an old android game console that I've been working on getting mainline working on.

I know, I have one sitting here too. I only tried to tinker a bit at the very beginning...

It runs Xubuntu very well now with mainline.
I've got most everything roughly supported with the exception of audio.

Quoted 8 lines
Quoted 7 lines

I've written most of the device tree, with contributions from Matt Merhar.
It's almost bit for bit a cardhu dev board, but with everything not necessary to function removed.
They cut a lot of corners with the board design.
Last stable kernel was 3.2, but it ran fine at 52mhz, mind you it reported it was running mode 5.

Quoted 4 lines

That is what we saw too. With Apalis/Colibri T30 L4T downstream kernel (which is 3.1 with quite some patches) 52MHz DDR worked fine, surprisingly even with ACMD23. However, speed is slightly slower than mainline 52MHz without ACMD23...

Quoted 5 lines

I noticed the same thing, speed with the original kernel on the MMC was worse at 52Mhz than it was at 34Mhz in HS-200 mode on mainline. I'd be happy with it where it is, but the fact that it worked at 52Mhz before makes me believe something isn't quite there yet.
I selected HS-200 mode just to force 1.8v mode.

What's the card model your Ouya's eMMC has?

#11 lore raw

Re: [PATCH 3/3] mmc: tegra: prevent ACMD23 on Tegra 3

Kingston KE4CN3K6A.
Though I am pretty sure I've figured out the instability. Brought it in to work and hooked it to a scope.
Couldn't find clock, but cmd and all eight bits are running at 1.2 volts. Repeated the results with the bootloader, the original kernel, and my mainline.
Also noticed that even on the slowest slew rate there is significant ringing and overshoot of .15 volts.

Quoted 139 lines · On Fri, Jul 27, 2018, 15:52 Dmitry Osipenko <[email protected]> wrote:
Quoted 8 lines · On Thursday, 26 July 2018 20:48:55 MSK Peter Geis wrote:
Quoted 7 lines · Stefan Agner
Quoted 6 lines · Peter Geis
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 1 line

I finally got around to testing this on the Ouya (Tegra 3).

Thanks for testing!

Quoted 2 lines

I found that the "Got command interrupt 0x00010000 even though no command operation was in progress." error occurred when the

interface

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

is unstable.
I've had a lot of problems with sdmmc4 stability on the Ouya

above 34

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 8 lines
Quoted 6 lines

Mhz, probably due to the fact that they are using the internal cmd and
clock pull-up resistors, against the TRM's instruction. At 39Mhz, I saw the error this patch corrects.
With the patch, the error went away, but the interface is still unstable under load.

How does this instability manifest exactly?

At the very edge of stability, you see write errors under heavy

load.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines

As clock rate increases, the write errors occur more frequently. At a certain point, you start getting read errors. Following that you get constant io errors during card probing. Eventually the emmc will fail to initialize, with errors 87 or 110.

What mode are you running at actually? E.g. what is the ios file

saying?

Quoted 22 lines
Quoted 22 lines
Quoted 4 lines
Quoted 1 line

cat /sys/kernel/debug/mmcX/ios

This is the best functionality I've been able to get prior to the patches:

Quoted 11 lines
root@ouya:~# cat /sys/kernel/debug/mmc0/ios
clock:          30000000 Hz
actual clock:   29142858 Hz
vdd:            21 (3.3 ~ 3.4 V)
bus mode:       2 (push-pull)
chip select:    0 (don't care)
power mode:     2 (on)
bus width:      3 (8 bits)
timing spec:    9 (mmc HS200)
signal voltage: 1 (1.80 V)
driver type:    0 (driver type B)

Yeah HS200 is definilty not supported by the controller and really should not be used.

Quoted 3 lines

Now I am trying DDR, but even with the patches I'm not able to remain stable above 17Mhz (34Mhz clock).

Quoted 11 lines
Quoted 5 lines
Quoted 2 lines

I've also tried just straight mmc-hs mode, but even that makes no difference.>

So you tried timing spec 1 (mmc HS)?

How did you exactly enable mmc-hs mode?

cap-mmc-highspeed;

Quoted 3 lines

I suggest to *not set* vqmmc and apply patch 1. It will report that signaling voltage is 3.3V, but that did not really matter in our case. This was our baseline and always worked stable on mainline. I also

would

Quoted 12 lines
Quoted 1 line

use that mode when tweaking pinmux etc...

Will do, thanks.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines

I've been tweaking the pull up/down values to try and improve the stability, but without access to anything but the TRM it's a lot of trial and error.

Hm, maybe Marcel's recent fixes in our device tree are helpful?
https://lkml.org/lkml/2018/7/22/165

Also make sure to have a complete pinmux such that alternative pins

for

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

sdmmc4 are *not* muxed as sdmmc4.

That was my first issue, which was preventing sdmmc4 from working at

all.

Quoted 11 lines
Quoted 11 lines
Quoted 2 lines

Just double checked all of the spare function pins, they are all assigned elsewhere.

Ok.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Lowering down to 32Mhz, without the patch there are no errors.

So the patch does not make it less stable right?

No, it did not affect stability.
Although I'd conduct some performance testing to check for

degradation.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 2 lines

Of course I'm nowhere near the limits of the controller, so it is doubtful I'd see a hit.

Ok, and this is with the complete patchset applied correct?

Btw, what device tree are you using? Ouya is not upstream as far as I can tell?

Quoted 6 lines
Quoted 6 lines
Quoted 4 lines

Indeed, I have the full patchset.

Ouya is an old android game console that I've been working on getting mainline working on.

I know, I have one sitting here too. I only tried to tinker a bit at

the

Quoted 18 lines
Quoted 1 line

very beginning...

It runs Xubuntu very well now with mainline.
I've got most everything roughly supported with the exception of audio.

Quoted 8 lines
Quoted 7 lines

I've written most of the device tree, with contributions from Matt Merhar.
It's almost bit for bit a cardhu dev board, but with everything not necessary to function removed.
They cut a lot of corners with the board design.
Last stable kernel was 3.2, but it ran fine at 52mhz, mind you it reported it was running mode 5.

Quoted 4 lines

That is what we saw too. With Apalis/Colibri T30 L4T downstream kernel (which is 3.1 with quite some patches) 52MHz DDR worked fine, surprisingly even with ACMD23. However, speed is slightly slower than mainline 52MHz without ACMD23...

Quoted 5 lines

I noticed the same thing, speed with the original kernel on the MMC was worse at 52Mhz than it was at 34Mhz in HS-200 mode on mainline. I'd be happy with it where it is, but the fact that it worked at 52Mhz before makes me believe something isn't quite there yet.
I selected HS-200 mode just to force 1.8v mode.

What's the card model your Ouya's eMMC has?

#12 lore raw

Re: [PATCH 3/3] mmc: tegra: prevent ACMD23 on Tegra 3

Quoted 8 lines · On Friday, 27 July 2018 23:19:53 MSK Peter Geis wrote:

Kingston KE4CN3K6A.
Though I am pretty sure I've figured out the instability. Brought it in to work and hooked it to a scope.
Couldn't find clock, but cmd and all eight bits are running at 1.2 volts. Repeated the results with the bootloader, the original kernel, and my mainline.
Also noticed that even on the slowest slew rate there is significant ringing and overshoot of .15 volts.

Okay, but eMMC is working fine with the original kernel, isn't it?

#13 lore raw

Re: [PATCH 3/3] mmc: tegra: prevent ACMD23 on Tegra 3

Quoted 10 lines · Dmitry Osipenko
Quoted 8 lines · On Friday, 27 July 2018 23:19:53 MSK Peter Geis wrote:

Kingston KE4CN3K6A.
Though I am pretty sure I've figured out the instability. Brought it in to work and hooked it to a scope.
Couldn't find clock, but cmd and all eight bits are running at 1.2 volts. Repeated the results with the bootloader, the original kernel, and my mainline.
Also noticed that even on the slowest slew rate there is significant ringing and overshoot of .15 volts.

Quoted 3 lines

Okay, but eMMC is working fine with the original kernel, isn't it?

Correct, at roughly double the speed of the mainline kernel.
According to the mmc spec, in high voltage mode it should have 2.7-3.3 volts in, and the minimum signal voltage should be .75 of that, which equates to a minimum voltage of over 2 volts. For low voltage mode, it should be 1.8 volts in, with the signals being between .3 and .7 volts.
Signal voltage of 1.3 volts is .75 of 1.8, which means we have low voltage in, but high voltage signaling.
This is even with HS-200 or DDR-1.8 assigned in the controller mode, so for some reason we aren't switching modes.
The original kernel was running in SDR 25 signaling, but didn't try to switch either.

Digging through the old code and the TRM, there are three ideas stuck in my head.
The original pinmux driver had settings such as low voltage divider and two values for each pull direction. The pinmux driver is io resetting specifically the pads we are using, dumping any values the bootloader had set. Is it possible the tap configuration is not working?

Tested-by on v1 1/3
#14 lore raw
In reply to Stefan Agner
Quoted 21 lines · Stefan Agner

The stack assumes that SDHC controller which support SD3.0 (SDR104) do
support HS200. This is not the case for Tegra 3, which does support SD
3.0
but only supports eMMC spec 4.41.

Use SDHCI_QUIRK2_BROKEN_HS200 to indicate that the controller does not
support HS200.

Note that commit 156e14b126ff ("mmc: sdhci: fix caps2 for HS200") added
the tie between SD3.0 (SDR104) and HS200. I don't think that this is necessarly true. It is fully legitimate to support SD3.0 and not support
HS200. The quirk naming suggests something is broken in the controller,
but this is not the case: The controller simply does not support HS200.

Quoted 2 lines
Fixes 7ad2ed1dfcbe ("mmc: tegra: enable UHS-I modes")

The whole series stress-tested overnight on various Apalis T30 as well as Colibri T30 modules:

Quoted 10 lines
---
 drivers/mmc/host/sdhci-tegra.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mmc/host/sdhci- renamed from drivers/mmc/host/sdhci-tegra.c +0 -0

tegra.c
index 970d38f68939..137df06b9b6e 100644

drivers/mmc/host/sdhci-tegra.c static const struct sdhci_pltfm_data · line 341

Quoted 9 lines
drivers/mmc/host/sdhci-tegra.c +2 -1
@@ -334,7 +334,8 @@ static const struct sdhci_pltfm_data
 sdhci_tegra30_pdata = {
 		  SDHCI_QUIRK_NO_HISPD_BIT |
 		  SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC |
 		  SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
-	.quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN,
+	.quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN |
+		   SDHCI_QUIRK2_BROKEN_HS200,
 	.ops  = &tegra_sdhci_ops,
 };

Works quite nicely on today's next once [1] is also applied:

root@apalis-t30:~# cat /sys/kernel/debug/mmc1/ios 
clock:          52000000 Hz
actual clock:   51000000 Hz
vdd:            21 (3.3 ~ 3.4 V)
bus mode:       2 (push-pull)
chip select:    0 (don't care)
power mode:     2 (on)
bus width:      3 (8 bits)
timing spec:    8 (mmc DDR52)
signal voltage: 1 (1.80 V)
driver type:    0 (driver type B)
root@apalis-t30:~# hdparm -t /dev/mmcblk1

/dev/mmcblk1:
Timing buffered disk reads: 236 MB in 3.01 seconds = 78.42 MB/sec

root@colibri-t30:~# cat /sys/kernel/debug/mmc0/ios 
clock:          52000000 Hz
actual clock:   51000000 Hz
vdd:            21 (3.3 ~ 3.4 V)
bus mode:       2 (push-pull)
chip select:    0 (don't care)
power mode:     2 (on)
bus width:      3 (8 bits)
timing spec:    8 (mmc DDR52)
signal voltage: 1 (1.80 V)
driver type:    0 (driver type B)
root@colibri-t30:~# hdparm -t /dev/mmcblk0

/dev/mmcblk0:
Timing buffered disk reads: 168 MB in 3.00 seconds = 55.99 MB/sec

[1] https://lore.kernel.org/lkml/1531487865-17427-1-git-send-email-avie
[email protected]

Applied
#15 lore raw
In reply to Stefan Agner
Quoted 8 lines · Stefan Agner

The stack assumes that SDHC controller which support SD3.0 (SDR104) do support HS200. This is not the case for Tegra 3, which does support SD 3.0
but only supports eMMC spec 4.41.

Use SDHCI_QUIRK2_BROKEN_HS200 to indicate that the controller does not support HS200.

Quoted 8 lines

Note that commit 156e14b126ff ("mmc: sdhci: fix caps2 for HS200") added the tie between SD3.0 (SDR104) and HS200. I don't think that this is necessarly true. It is fully legitimate to support SD3.0 and not support HS200. The quirk naming suggests something is broken in the controller, but this is not the case: The controller simply does not support HS200.

Fixes 7ad2ed1dfcbe ("mmc: tegra: enable UHS-I modes")

Thanks, applied all three patches for next!

Kind regards
Uffe

Quoted 25 lines
---
 drivers/mmc/host/sdhci-tegra.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mmc/host/sdhci-tegra.c +2 -2
index 970d38f68939..137df06b9b6e 100644
@@ -334,7 +334,8 @@ static const struct sdhci_pltfm_data sdhci_tegra30_pdata = {
                  SDHCI_QUIRK_NO_HISPD_BIT |
                  SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC |
                  SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
-       .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN,
+       .quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN |
+                  SDHCI_QUIRK2_BROKEN_HS200,
        .ops  = &tegra_sdhci_ops,
 };
 
--

2.18.0

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html