Skip to contentSkip to conversation

mmc: sdhi: improve HS400 quirk handling

PATCH In review Wolfram Sang 5 participants 10 messages Jun 6, 2019 – Jun 10, 2019

Subsystems (2)
lore
Share & tools
lore

Wolfram Sang

author maintainer
#0 lore raw

v2 cover mmc: sdhi: improve HS400 quirk handling

There are some more SoCs which cannot handle HS400. Add them and clean up the quirk handling a bit. So, patch 1 is suitable for stable, the rest isn't.

Note that I don't have that HW, so I am relying on the provided information.

Changes since v1 (thanks Geert and Fabrizio!):
* use '[012]' to specify the range instead of single entries
* add RZ/G2M to the list

Wolfram Sang (3):
mmc: sdhi: disallow HS400 for M3-W ES1.2, RZ/G2M, and V3H
mmc: sdhi: improve quirk descriptions
mmc: sdhi: remove unneeded initialization

 drivers/mmc/host/renesas_sdhi_core.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
Signature · 1 line
2.11.0
author maintainer
#1 lore raw

PATCH v2 1/3 mmc: sdhi: disallow HS400 for M3-W ES1.2, RZ/G2M, and V3H

Our HW engineers informed us that HS400 is not working on these SoC revisions.

Fixes 0f4e2054c971 ("mmc: renesas_sdhi: disable HS400 on H3 ES1.x and M3-W ES1.[012]")
---
 drivers/mmc/host/renesas_sdhi_core.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/mmc/host/renesas_sdhi_core.c +7 -2
index db73f9f1b186..683c449a2f94 100644
@@ -620,11 +620,16 @@ static const struct renesas_sdhi_quirks sdhi_quirks_h3_es2 = {
 	.hs400_4taps = true,
 };
 
+static const struct renesas_sdhi_quirks sdhi_quirks_nohs400 = {
+	.hs400_disabled = true,
+};
+
 static const struct soc_device_attribute sdhi_quirks_match[]  = {
 	{ .soc_id = "r8a7795", .revision = "ES1.*", .data = &sdhi_quirks_h3_m3w_es1 },
 	{ .soc_id = "r8a7795", .revision = "ES2.0", .data = &sdhi_quirks_h3_es2 },
-	{ .soc_id = "r8a7796", .revision = "ES1.0", .data = &sdhi_quirks_h3_m3w_es1 },
-	{ .soc_id = "r8a7796", .revision = "ES1.1", .data = &sdhi_quirks_h3_m3w_es1 },
+	{ .soc_id = "r8a7796", .revision = "ES1.[012]", .data = &sdhi_quirks_h3_m3w_es1 },
+	{ .soc_id = "r8a774a1", .revision = "ES1.[012]", .data = &sdhi_quirks_h3_m3w_es1 },
+	{ .soc_id = "r8a77980", .data = &sdhi_quirks_nohs400 },
 	{ /* Sentinel. */ },
 };
 
Signature · 1 line
2.11.0
Reviewed-by on v2 1/3
#2 lore raw

Re: [PATCH v2 1/3] mmc: sdhi: disallow HS400 for M3-W ES1.2, RZ/G2M, and V3H

Quoted 5 lines · Wolfram Sang

Our HW engineers informed us that HS400 is not working on these SoC revisions.

Fixes 0f4e2054c971 ("mmc: renesas_sdhi: disable HS400 on H3 ES1.x and M3-W ES1.[012]")

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Reviewed-by on v2 1/3
#3 lore raw

RE: [PATCH v2 1/3] mmc: sdhi: disallow HS400 for M3-W ES1.2, RZ/G2M, and V3H

In reply to Wolfram Sang

Hello Wolfram!

Thank you for adding the r8a774a1 to the list!

Quoted 9 lines

From: Wolfram Sang <[email protected]>
Sent: 06 June 2019 12:36
Subject: [PATCH v2 1/3] mmc: sdhi: disallow HS400 for M3-W ES1.2, RZ/G2M, and V3H

Our HW engineers informed us that HS400 is not working on these SoC revisions.

Fixes 0f4e2054c971 ("mmc: renesas_sdhi: disable HS400 on H3 ES1.x and M3-W ES1.[012]")
Quoted 29 lines
---
 drivers/mmc/host/renesas_sdhi_core.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/mmc/host/renesas_sdhi_core.c +7 -3
index db73f9f1b186..683c449a2f94 100644
@@ -620,11 +620,16 @@ static const struct renesas_sdhi_quirks sdhi_quirks_h3_es2 = {
 	.hs400_4taps = true,
 };
 
+static const struct renesas_sdhi_quirks sdhi_quirks_nohs400 = {
+	.hs400_disabled = true,
+};
+
 static const struct soc_device_attribute sdhi_quirks_match[]  = {
 	{ .soc_id = "r8a7795", .revision = "ES1.*", .data = &sdhi_quirks_h3_m3w_es1 },
 	{ .soc_id = "r8a7795", .revision = "ES2.0", .data = &sdhi_quirks_h3_es2 },
-	{ .soc_id = "r8a7796", .revision = "ES1.0", .data = &sdhi_quirks_h3_m3w_es1 },
-	{ .soc_id = "r8a7796", .revision = "ES1.1", .data = &sdhi_quirks_h3_m3w_es1 },
+	{ .soc_id = "r8a7796", .revision = "ES1.[012]", .data = &sdhi_quirks_h3_m3w_es1 },
+	{ .soc_id = "r8a774a1", .revision = "ES1.[012]", .data = &sdhi_quirks_h3_m3w_es1 },
+	{ .soc_id = "r8a77980", .data = &sdhi_quirks_nohs400 },
 	{ /* Sentinel. */ },
 };
 
--

2.11.0

author maintainer
#4 lore raw

PATCH v2 2/3 mmc: sdhi: improve quirk descriptions

In reply to Wolfram Sang

Quirks show up in new SoCs as well, so the naming should be generic. Describe them by what they do.

---
 drivers/mmc/host/renesas_sdhi_core.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/mmc/host/renesas_sdhi_core.c +6 -6
index 683c449a2f94..24857ced9f2e 100644
@@ -610,12 +610,12 @@ static void renesas_sdhi_enable_dma(struct tmio_mmc_host *host, bool enable)
 	renesas_sdhi_sdbuf_width(host, enable ? width : 16);
 }
 
-static const struct renesas_sdhi_quirks sdhi_quirks_h3_m3w_es1 = {
+static const struct renesas_sdhi_quirks sdhi_quirks_4tap_nohs400 = {
 	.hs400_disabled = true,
 	.hs400_4taps = true,
 };
 
-static const struct renesas_sdhi_quirks sdhi_quirks_h3_es2 = {
+static const struct renesas_sdhi_quirks sdhi_quirks_4tap = {
 	.hs400_disabled = false,
 	.hs400_4taps = true,
 };
@@ -625,10 +625,10 @@ static const struct renesas_sdhi_quirks sdhi_quirks_nohs400 = {
 };
 
 static const struct soc_device_attribute sdhi_quirks_match[]  = {
-	{ .soc_id = "r8a7795", .revision = "ES1.*", .data = &sdhi_quirks_h3_m3w_es1 },
-	{ .soc_id = "r8a7795", .revision = "ES2.0", .data = &sdhi_quirks_h3_es2 },
-	{ .soc_id = "r8a7796", .revision = "ES1.[012]", .data = &sdhi_quirks_h3_m3w_es1 },
-	{ .soc_id = "r8a774a1", .revision = "ES1.[012]", .data = &sdhi_quirks_h3_m3w_es1 },
+	{ .soc_id = "r8a7795", .revision = "ES1.*", .data = &sdhi_quirks_4tap_nohs400 },
+	{ .soc_id = "r8a7795", .revision = "ES2.0", .data = &sdhi_quirks_4tap },
+	{ .soc_id = "r8a7796", .revision = "ES1.[012]", .data = &sdhi_quirks_4tap_nohs400 },
+	{ .soc_id = "r8a774a1", .revision = "ES1.[012]", .data = &sdhi_quirks_4tap_nohs400 },
 	{ .soc_id = "r8a77980", .data = &sdhi_quirks_nohs400 },
 	{ /* Sentinel. */ },
 };
Signature · 1 line
2.11.0
Reviewed-by on v2 2/3
#5 lore raw

Re: [PATCH v2 2/3] mmc: sdhi: improve quirk descriptions

Quoted 4 lines · Wolfram Sang

Quirks show up in new SoCs as well, so the naming should be generic. Describe them by what they do.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
author maintainer
#6 lore raw

PATCH v2 3/3 mmc: sdhi: remove unneeded initialization

In reply to Wolfram Sang

Bools are initialized to 'false' by default.

---
 drivers/mmc/host/renesas_sdhi_core.c | 1 -
 1 file changed, 1 deletion(-)
drivers/mmc/host/renesas_sdhi_core.c +0 -1
index 24857ced9f2e..64d3b5fb7fe5 100644
@@ -616,7 +616,6 @@ static const struct renesas_sdhi_quirks sdhi_quirks_4tap_nohs400 = {
 };
 
 static const struct renesas_sdhi_quirks sdhi_quirks_4tap = {
-	.hs400_disabled = false,
 	.hs400_4taps = true,
 };
 
Signature · 1 line
2.11.0
Reviewed-by on v2 3/3
#7 lore raw

Re: [PATCH v2 3/3] mmc: sdhi: remove unneeded initialization

Quoted 3 lines · Wolfram Sang

Bools are initialized to 'false' by default.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Reviewed-by on the v2 series
#8 lore raw
In reply to Wolfram Sang

Hi (again) Wolfram,

I now see there was a v2 of this series which addressed Geert's comments. Sorry for missing this and replying to v1. For the whole series,

Quoted 20 lines · Wolfram Sang

There are some more SoCs which cannot handle HS400. Add them and clean up the quirk handling a bit. So, patch 1 is suitable for stable, the rest isn't.

Note that I don't have that HW, so I am relying on the provided information.

Changes since v1 (thanks Geert and Fabrizio!):
* use '[012]' to specify the range instead of single entries
* add RZ/G2M to the list

Wolfram Sang (3):
mmc: sdhi: disallow HS400 for M3-W ES1.2, RZ/G2M, and V3H
mmc: sdhi: improve quirk descriptions
mmc: sdhi: remove unneeded initialization

 drivers/mmc/host/renesas_sdhi_core.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
Signature · 1 line
2.11.0
Signature · 2 lines
Regards,
Niklas Söderlund
#9 lore raw
In reply to Wolfram Sang
Quoted 10 lines · Wolfram Sang

There are some more SoCs which cannot handle HS400. Add them and clean up the quirk handling a bit. So, patch 1 is suitable for stable, the rest isn't.

Note that I don't have that HW, so I am relying on the provided information.

Changes since v1 (thanks Geert and Fabrizio!):
* use '[012]' to specify the range instead of single entries
* add RZ/G2M to the list

Quoted 8 lines

Wolfram Sang (3):
mmc: sdhi: disallow HS400 for M3-W ES1.2, RZ/G2M, and V3H
mmc: sdhi: improve quirk descriptions
mmc: sdhi: remove unneeded initialization

 drivers/mmc/host/renesas_sdhi_core.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

Applied patch 1 for fixes and by adding a stable tag, the rest is applied for next, thanks!

Kind regards
Uffe