linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] mmc: sdhi: improve HS400 quirk handling
@ 2019-06-04 15:15 Wolfram Sang
  2019-06-04 15:15 ` [PATCH 1/3] mmc: sdhi: disallow HS400 for M3-W ES1.2 and V3H Wolfram Sang
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Wolfram Sang @ 2019-06-04 15:15 UTC (permalink / raw)
  To: linux-mmc
  Cc: linux-renesas-soc, Yoshihiro Shimoda, Niklas Söderlund,
	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.

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

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

-- 
2.11.0


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

* [PATCH 1/3] mmc: sdhi: disallow HS400 for M3-W ES1.2 and V3H
  2019-06-04 15:15 [PATCH 0/3] mmc: sdhi: improve HS400 quirk handling Wolfram Sang
@ 2019-06-04 15:15 ` Wolfram Sang
  2019-06-04 15:28   ` Geert Uytterhoeven
  2019-06-05  8:31   ` Fabrizio Castro
  2019-06-04 15:15 ` [PATCH 2/3] mmc: sdhi: improve quirk descriptions Wolfram Sang
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 9+ messages in thread
From: Wolfram Sang @ 2019-06-04 15:15 UTC (permalink / raw)
  To: linux-mmc
  Cc: linux-renesas-soc, Yoshihiro Shimoda, Niklas Söderlund,
	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]")
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

This one should go back to stable.

 drivers/mmc/host/renesas_sdhi_core.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
index db73f9f1b186..e98ba6cf6c13 100644
--- a/drivers/mmc/host/renesas_sdhi_core.c
+++ b/drivers/mmc/host/renesas_sdhi_core.c
@@ -620,11 +620,17 @@ 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.2", .data = &sdhi_quirks_h3_m3w_es1 },
+	{ .soc_id = "r8a77980", .data = &sdhi_quirks_nohs400 },
 	{ /* Sentinel. */ },
 };
 
-- 
2.11.0


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

* [PATCH 2/3] mmc: sdhi: improve quirk descriptions
  2019-06-04 15:15 [PATCH 0/3] mmc: sdhi: improve HS400 quirk handling Wolfram Sang
  2019-06-04 15:15 ` [PATCH 1/3] mmc: sdhi: disallow HS400 for M3-W ES1.2 and V3H Wolfram Sang
@ 2019-06-04 15:15 ` Wolfram Sang
  2019-06-04 15:15 ` [PATCH 3/3] mmc: sdhi: remove unneeded initialization Wolfram Sang
  2019-06-10 12:41 ` [PATCH 0/3] mmc: sdhi: improve HS400 quirk handling Niklas Söderlund
  3 siblings, 0 replies; 9+ messages in thread
From: Wolfram Sang @ 2019-06-04 15:15 UTC (permalink / raw)
  To: linux-mmc
  Cc: linux-renesas-soc, Yoshihiro Shimoda, Niklas Söderlund,
	Wolfram Sang

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

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/mmc/host/renesas_sdhi_core.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
index e98ba6cf6c13..1cdf5920e861 100644
--- a/drivers/mmc/host/renesas_sdhi_core.c
+++ b/drivers/mmc/host/renesas_sdhi_core.c
@@ -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,11 +625,11 @@ 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.0", .data = &sdhi_quirks_h3_m3w_es1 },
-	{ .soc_id = "r8a7796", .revision = "ES1.1", .data = &sdhi_quirks_h3_m3w_es1 },
-	{ .soc_id = "r8a7796", .revision = "ES1.2", .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.0", .data = &sdhi_quirks_4tap_nohs400 },
+	{ .soc_id = "r8a7796", .revision = "ES1.1", .data = &sdhi_quirks_4tap_nohs400 },
+	{ .soc_id = "r8a7796", .revision = "ES1.2", .data = &sdhi_quirks_4tap_nohs400 },
 	{ .soc_id = "r8a77980", .data = &sdhi_quirks_nohs400 },
 	{ /* Sentinel. */ },
 };
-- 
2.11.0


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

* [PATCH 3/3] mmc: sdhi: remove unneeded initialization
  2019-06-04 15:15 [PATCH 0/3] mmc: sdhi: improve HS400 quirk handling Wolfram Sang
  2019-06-04 15:15 ` [PATCH 1/3] mmc: sdhi: disallow HS400 for M3-W ES1.2 and V3H Wolfram Sang
  2019-06-04 15:15 ` [PATCH 2/3] mmc: sdhi: improve quirk descriptions Wolfram Sang
@ 2019-06-04 15:15 ` Wolfram Sang
  2019-06-10 12:41 ` [PATCH 0/3] mmc: sdhi: improve HS400 quirk handling Niklas Söderlund
  3 siblings, 0 replies; 9+ messages in thread
From: Wolfram Sang @ 2019-06-04 15:15 UTC (permalink / raw)
  To: linux-mmc
  Cc: linux-renesas-soc, Yoshihiro Shimoda, Niklas Söderlund,
	Wolfram Sang

Bools are initialized to 'false' by default.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/mmc/host/renesas_sdhi_core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
index 1cdf5920e861..334fb3527685 100644
--- a/drivers/mmc/host/renesas_sdhi_core.c
+++ b/drivers/mmc/host/renesas_sdhi_core.c
@@ -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,
 };
 
-- 
2.11.0


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

* Re: [PATCH 1/3] mmc: sdhi: disallow HS400 for M3-W ES1.2 and V3H
  2019-06-04 15:15 ` [PATCH 1/3] mmc: sdhi: disallow HS400 for M3-W ES1.2 and V3H Wolfram Sang
@ 2019-06-04 15:28   ` Geert Uytterhoeven
  2019-06-04 15:41     ` Wolfram Sang
  2019-06-05  8:31   ` Fabrizio Castro
  1 sibling, 1 reply; 9+ messages in thread
From: Geert Uytterhoeven @ 2019-06-04 15:28 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Linux MMC List, Linux-Renesas, Yoshihiro Shimoda, Niklas Söderlund

Hi Wolfram,

On Tue, Jun 4, 2019 at 5:17 PM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> 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]")
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

> --- a/drivers/mmc/host/renesas_sdhi_core.c
> +++ b/drivers/mmc/host/renesas_sdhi_core.c
> @@ -620,11 +620,17 @@ 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.2", .data = &sdhi_quirks_h3_m3w_es1 },

I think the above 3 lines can be combined in:

     { .soc_id = "r8a7796", .revision = "ES1.[012]", .data =
&sdhi_quirks_h3_m3w_es1 },

Or do you prefer separate lines for easier grepping?

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

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

* Re: [PATCH 1/3] mmc: sdhi: disallow HS400 for M3-W ES1.2 and V3H
  2019-06-04 15:28   ` Geert Uytterhoeven
@ 2019-06-04 15:41     ` Wolfram Sang
  0 siblings, 0 replies; 9+ messages in thread
From: Wolfram Sang @ 2019-06-04 15:41 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Wolfram Sang, Linux MMC List, Linux-Renesas, Yoshihiro Shimoda,
	Niklas Söderlund

[-- Attachment #1: Type: text/plain, Size: 314 bytes --]


> I think the above 3 lines can be combined in:
> 
>      { .soc_id = "r8a7796", .revision = "ES1.[012]", .data =
> &sdhi_quirks_h3_m3w_es1 },
> 
> Or do you prefer separate lines for easier grepping?

No, I just forgot one can do this :) Will wait a little for further
comments and then fix. Thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* RE: [PATCH 1/3] mmc: sdhi: disallow HS400 for M3-W ES1.2 and V3H
  2019-06-04 15:15 ` [PATCH 1/3] mmc: sdhi: disallow HS400 for M3-W ES1.2 and V3H Wolfram Sang
  2019-06-04 15:28   ` Geert Uytterhoeven
@ 2019-06-05  8:31   ` Fabrizio Castro
  2019-06-05  8:39     ` Geert Uytterhoeven
  1 sibling, 1 reply; 9+ messages in thread
From: Fabrizio Castro @ 2019-06-05  8:31 UTC (permalink / raw)
  To: Wolfram Sang, linux-mmc, Geert Uytterhoeven
  Cc: linux-renesas-soc, Yoshihiro Shimoda, Niklas Söderlund

Hello Wolfram,

Thank you for your patch!

> From: linux-renesas-soc-owner@vger.kernel.org <linux-renesas-soc-owner@vger.kernel.org> On Behalf Of Wolfram Sang
> Sent: 04 June 2019 16:15
> Subject: [PATCH 1/3] mmc: sdhi: disallow HS400 for M3-W ES1.2 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]")
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
> 
> This one should go back to stable.
> 
>  drivers/mmc/host/renesas_sdhi_core.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
> index db73f9f1b186..e98ba6cf6c13 100644
> --- a/drivers/mmc/host/renesas_sdhi_core.c
> +++ b/drivers/mmc/host/renesas_sdhi_core.c
> @@ -620,11 +620,17 @@ 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.2", .data = &sdhi_quirks_h3_m3w_es1 },

Can we actually detect E1.2 on the M3-W? My understanding is that the content of the
PRR is the same for 1.1 and 1.2 (Geert, could you please jump in?).
I am saying this because I am using an RZ/G2M (r8a774a1), revision 1.2, that it's reporting
itself as 1.1.
Also, the r8a774a1 and r8a7796 are identical (even revision-wise), so I guess we could
add r8a774a1 to the pile while at it?

Thanks,
Fab

> +	{ .soc_id = "r8a77980", .data = &sdhi_quirks_nohs400 },
>  	{ /* Sentinel. */ },
>  };
> 
> --
> 2.11.0


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

* Re: [PATCH 1/3] mmc: sdhi: disallow HS400 for M3-W ES1.2 and V3H
  2019-06-05  8:31   ` Fabrizio Castro
@ 2019-06-05  8:39     ` Geert Uytterhoeven
  0 siblings, 0 replies; 9+ messages in thread
From: Geert Uytterhoeven @ 2019-06-05  8:39 UTC (permalink / raw)
  To: Fabrizio Castro
  Cc: Wolfram Sang, linux-mmc, Geert Uytterhoeven, linux-renesas-soc,
	Yoshihiro Shimoda, Niklas Söderlund

Hi Fabrizio,

On Wed, Jun 5, 2019 at 10:31 AM Fabrizio Castro
<fabrizio.castro@bp.renesas.com> wrote:
> > From: linux-renesas-soc-owner@vger.kernel.org <linux-renesas-soc-owner@vger.kernel.org> On Behalf Of Wolfram Sang
> > Sent: 04 June 2019 16:15
> > Subject: [PATCH 1/3] mmc: sdhi: disallow HS400 for M3-W ES1.2 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]")
> > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> > ---
> >
> > This one should go back to stable.
> >
> >  drivers/mmc/host/renesas_sdhi_core.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
> > index db73f9f1b186..e98ba6cf6c13 100644
> > --- a/drivers/mmc/host/renesas_sdhi_core.c
> > +++ b/drivers/mmc/host/renesas_sdhi_core.c
> > @@ -620,11 +620,17 @@ 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.2", .data = &sdhi_quirks_h3_m3w_es1 },
>
> Can we actually detect E1.2 on the M3-W? My understanding is that the content of the
> PRR is the same for 1.1 and 1.2 (Geert, could you please jump in?).

Indeed, we cannot detect ES1.2 from the PRR, so technically it is already
covered by the existing check.
However, one day we might find some other way to differentiate between
M3-W ES1.1 and ES1.2 at runtime, and a need or other good reason to
enhance renesas_soc_init() to use that logic.

> Also, the r8a774a1 and r8a7796 are identical (even revision-wise), so I guess we could
> add r8a774a1 to the pile while at it?

Yes, we should.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

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

* Re: [PATCH 0/3] mmc: sdhi: improve HS400 quirk handling
  2019-06-04 15:15 [PATCH 0/3] mmc: sdhi: improve HS400 quirk handling Wolfram Sang
                   ` (2 preceding siblings ...)
  2019-06-04 15:15 ` [PATCH 3/3] mmc: sdhi: remove unneeded initialization Wolfram Sang
@ 2019-06-10 12:41 ` Niklas Söderlund
  3 siblings, 0 replies; 9+ messages in thread
From: Niklas Söderlund @ 2019-06-10 12:41 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-mmc, linux-renesas-soc, Yoshihiro Shimoda

Hi Wolfram,

Thanks for your work.

On 2019-06-04 17:15:27 +0200, Wolfram Sang wrote:
> 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.
> 
> Wolfram Sang (3):
>   mmc: sdhi: disallow HS400 for M3-W ES1.2 and V3H
>   mmc: sdhi: improve quirk descriptions
>   mmc: sdhi: remove unneeded initialization

For the whole series, with or without merging the r8a7796 entries per 
Geert's comments,

Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

> 
>  drivers/mmc/host/renesas_sdhi_core.c | 19 ++++++++++++-------
>  1 file changed, 12 insertions(+), 7 deletions(-)
> 
> -- 
> 2.11.0
> 

-- 
Regards,
Niklas Söderlund

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

end of thread, other threads:[~2019-06-10 12:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-04 15:15 [PATCH 0/3] mmc: sdhi: improve HS400 quirk handling Wolfram Sang
2019-06-04 15:15 ` [PATCH 1/3] mmc: sdhi: disallow HS400 for M3-W ES1.2 and V3H Wolfram Sang
2019-06-04 15:28   ` Geert Uytterhoeven
2019-06-04 15:41     ` Wolfram Sang
2019-06-05  8:31   ` Fabrizio Castro
2019-06-05  8:39     ` Geert Uytterhoeven
2019-06-04 15:15 ` [PATCH 2/3] mmc: sdhi: improve quirk descriptions Wolfram Sang
2019-06-04 15:15 ` [PATCH 3/3] mmc: sdhi: remove unneeded initialization Wolfram Sang
2019-06-10 12:41 ` [PATCH 0/3] mmc: sdhi: improve HS400 quirk handling Niklas Söderlund

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).