linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi: sh-msiof: drop support for R-Car H3 ES1.[01]
@ 2023-01-23  7:58 Wolfram Sang
  2023-01-23  9:42 ` Geert Uytterhoeven
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfram Sang @ 2023-01-23  7:58 UTC (permalink / raw)
  To: linux-spi; +Cc: linux-renesas-soc, Geert Uytterhoeven, Wolfram Sang

These revisions have HW issues and are only early engineering samples
used internally. We simply drop the MSIOF support for them.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

We got confirmation from Renesas for dropping ES1.* support.

 drivers/spi/spi-sh-msiof.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
index 9bca3d076f05..e3b249c71175 100644
--- a/drivers/spi/spi-sh-msiof.c
+++ b/drivers/spi/spi-sh-msiof.c
@@ -24,6 +24,7 @@
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
 #include <linux/sh_dma.h>
+#include <linux/sys_soc.h>
 
 #include <linux/spi/sh_msiof.h>
 #include <linux/spi/spi.h>
@@ -1257,8 +1258,15 @@ static void sh_msiof_release_dma(struct sh_msiof_spi_priv *p)
 	dma_release_channel(ctlr->dma_tx);
 }
 
+static const struct soc_device_attribute sh_msiof_blacklist[] = {
+	/* Those have HW issues */
+	{ .soc_id = "r8a7795", .revision = "ES1.[01]" },
+	{ /* Sentinel */ }
+};
+
 static int sh_msiof_spi_probe(struct platform_device *pdev)
 {
+	const struct soc_device_attribute *attr;
 	struct spi_controller *ctlr;
 	const struct sh_msiof_chipdata *chipdata;
 	struct sh_msiof_spi_info *info;
@@ -1267,6 +1275,10 @@ static int sh_msiof_spi_probe(struct platform_device *pdev)
 	int i;
 	int ret;
 
+	attr = soc_device_match(sh_msiof_blacklist);
+	if (attr)
+		return -ENOTSUPP;
+
 	chipdata = of_device_get_match_data(&pdev->dev);
 	if (chipdata) {
 		info = sh_msiof_spi_parse_dt(&pdev->dev);
-- 
2.30.2


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

* Re: [PATCH] spi: sh-msiof: drop support for R-Car H3 ES1.[01]
  2023-01-23  7:58 [PATCH] spi: sh-msiof: drop support for R-Car H3 ES1.[01] Wolfram Sang
@ 2023-01-23  9:42 ` Geert Uytterhoeven
  2023-01-23 10:02   ` Wolfram Sang
  0 siblings, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2023-01-23  9:42 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-spi, linux-renesas-soc, Geert Uytterhoeven

Hi Wolfram,

On Mon, Jan 23, 2023 at 8:58 AM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> These revisions have HW issues and are only early engineering samples
> used internally. We simply drop the MSIOF support for them.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
>
> We got confirmation from Renesas for dropping ES1.* support.

Thanks for your patch!

> --- a/drivers/spi/spi-sh-msiof.c
> +++ b/drivers/spi/spi-sh-msiof.c
> @@ -24,6 +24,7 @@
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/sh_dma.h>
> +#include <linux/sys_soc.h>
>
>  #include <linux/spi/sh_msiof.h>
>  #include <linux/spi/spi.h>
> @@ -1257,8 +1258,15 @@ static void sh_msiof_release_dma(struct sh_msiof_spi_priv *p)
>         dma_release_channel(ctlr->dma_tx);
>  }
>
> +static const struct soc_device_attribute sh_msiof_blacklist[] = {
> +       /* Those have HW issues */
> +       { .soc_id = "r8a7795", .revision = "ES1.[01]" },
> +       { /* Sentinel */ }
> +};
> +
>  static int sh_msiof_spi_probe(struct platform_device *pdev)
>  {
> +       const struct soc_device_attribute *attr;
>         struct spi_controller *ctlr;
>         const struct sh_msiof_chipdata *chipdata;
>         struct sh_msiof_spi_info *info;
> @@ -1267,6 +1275,10 @@ static int sh_msiof_spi_probe(struct platform_device *pdev)
>         int i;
>         int ret;
>
> +       attr = soc_device_match(sh_msiof_blacklist);
> +       if (attr)
> +               return -ENOTSUPP;

I don't think adding more soc_device_match() calls is the proper way to
handle this...
What about adding a single check to drivers/soc/renesas/renesas-soc.c,
removing r8a77950*dts*, and removing all R-Car H3 ES1.x matches from
all drivers?

> +
>         chipdata = of_device_get_match_data(&pdev->dev);
>         if (chipdata) {
>                 info = sh_msiof_spi_parse_dt(&pdev->dev);

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] 4+ messages in thread

* Re: [PATCH] spi: sh-msiof: drop support for R-Car H3 ES1.[01]
  2023-01-23  9:42 ` Geert Uytterhoeven
@ 2023-01-23 10:02   ` Wolfram Sang
  2023-01-25 13:39     ` Wolfram Sang
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfram Sang @ 2023-01-23 10:02 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-spi, linux-renesas-soc, Geert Uytterhoeven

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


> I don't think adding more soc_device_match() calls is the proper way to
> handle this...
> What about adding a single check to drivers/soc/renesas/renesas-soc.c,
> removing r8a77950*dts*, and removing all R-Car H3 ES1.x matches from
> all drivers?

Can be argued. My take was like keep the existing ES1 support which is
not in the way and disable the rest. But if you want to get rid of it
entirely, that is cleaner, of course. A tad more work removing the
existing quirks, but well...


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

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

* Re: [PATCH] spi: sh-msiof: drop support for R-Car H3 ES1.[01]
  2023-01-23 10:02   ` Wolfram Sang
@ 2023-01-25 13:39     ` Wolfram Sang
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2023-01-25 13:39 UTC (permalink / raw)
  To: Geert Uytterhoeven, linux-spi, linux-renesas-soc, Geert Uytterhoeven

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


> But if you want to get rid of it entirely, that is cleaner, of course.

I'll start with that work later today, removing ES1 of H3.


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

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

end of thread, other threads:[~2023-01-25 13:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-23  7:58 [PATCH] spi: sh-msiof: drop support for R-Car H3 ES1.[01] Wolfram Sang
2023-01-23  9:42 ` Geert Uytterhoeven
2023-01-23 10:02   ` Wolfram Sang
2023-01-25 13:39     ` Wolfram Sang

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).