linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Fix USB pipe configuration for RZ/G2L
@ 2024-03-08 18:09 Biju Das
  2024-03-08 18:09 ` [PATCH 1/4] dt-bindings: usb: renesas,usbhs: Document RZ/G2L family compatible Biju Das
                   ` (3 more replies)
  0 siblings, 4 replies; 25+ messages in thread
From: Biju Das @ 2024-03-08 18:09 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Greg Kroah-Hartman, Conor Dooley
  Cc: Biju Das, Geert Uytterhoeven, Magnus Damm, Yoshihiro Shimoda,
	linux-usb, devicetree, linux-renesas-soc, Prabhakar Mahadev Lad,
	Biju Das

The USBHS IP found on RZ/G2L SoCs only has 10 pipe buffers compared
to 16 pipe buffers on RZ/A2M. Document renesas,rzg2l-usbhs family
compatible to handle this difference for RZ/G2L family SoCs.

This patch series aims to fix the USB pipe configuration for RZ/G2L
family SoCs.

Biju Das (3):
  dt-bindings: usb: renesas,usbhs: Document RZ/G2L family compatible
  usb: renesas_usbhs: Remove trailing comma in the terminator entry for
    OF table
  arm64: dts: renesas: r9a07g0{43,44,54}: Update usbhs family compatible

Huy Nguyen (1):
  usb: renesas_usbhs: Update usbhs pipe configuration for RZ/G2L family

 .../bindings/usb/renesas,usbhs.yaml           |  6 +++-
 arch/arm64/boot/dts/renesas/r9a07g043.dtsi    |  2 +-
 arch/arm64/boot/dts/renesas/r9a07g044.dtsi    |  2 +-
 arch/arm64/boot/dts/renesas/r9a07g054.dtsi    |  2 +-
 drivers/usb/renesas_usbhs/common.c            | 33 +++++++++++++++++--
 5 files changed, 38 insertions(+), 7 deletions(-)

-- 
2.25.1


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

* [PATCH 1/4] dt-bindings: usb: renesas,usbhs: Document RZ/G2L family compatible
  2024-03-08 18:09 [PATCH 0/4] Fix USB pipe configuration for RZ/G2L Biju Das
@ 2024-03-08 18:09 ` Biju Das
  2024-03-09 12:07   ` Krzysztof Kozlowski
  2024-03-08 18:09 ` [PATCH 2/4] usb: renesas_usbhs: Update usbhs pipe configuration for RZ/G2L family Biju Das
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 25+ messages in thread
From: Biju Das @ 2024-03-08 18:09 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Biju Das, Greg Kroah-Hartman, Geert Uytterhoeven, Magnus Damm,
	Yoshihiro Shimoda, linux-usb, devicetree, linux-renesas-soc,
	Prabhakar Mahadev Lad, Biju Das

The USBHS IP found on RZ/G2L SoCs only has 10 pipe buffers compared
to 16 pipe buffers on RZ/A2M. Document renesas,rzg2l-usbhs family
compatible to handle this difference for RZ/G2L family SoCs.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
 Documentation/devicetree/bindings/usb/renesas,usbhs.yaml | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/usb/renesas,usbhs.yaml b/Documentation/devicetree/bindings/usb/renesas,usbhs.yaml
index 40ada78f2328..c63db3ebd07b 100644
--- a/Documentation/devicetree/bindings/usb/renesas,usbhs.yaml
+++ b/Documentation/devicetree/bindings/usb/renesas,usbhs.yaml
@@ -19,10 +19,14 @@ properties:
       - items:
           - enum:
               - renesas,usbhs-r7s9210   # RZ/A2
+          - const: renesas,rza2-usbhs
+
+      - items:
+          - enum:
               - renesas,usbhs-r9a07g043 # RZ/G2UL and RZ/Five
               - renesas,usbhs-r9a07g044 # RZ/G2{L,LC}
               - renesas,usbhs-r9a07g054 # RZ/V2L
-          - const: renesas,rza2-usbhs
+          - const: renesas,rzg2l-usbhs
 
       - items:
           - enum:
-- 
2.25.1


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

* [PATCH 2/4] usb: renesas_usbhs: Update usbhs pipe configuration for RZ/G2L family
  2024-03-08 18:09 [PATCH 0/4] Fix USB pipe configuration for RZ/G2L Biju Das
  2024-03-08 18:09 ` [PATCH 1/4] dt-bindings: usb: renesas,usbhs: Document RZ/G2L family compatible Biju Das
@ 2024-03-08 18:09 ` Biju Das
  2024-03-08 19:39   ` Geert Uytterhoeven
  2024-03-08 18:09 ` [PATCH 3/4] usb: renesas_usbhs: Remove trailing comma in the terminator entry for OF table Biju Das
  2024-03-08 18:09 ` [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}: Update usbhs family compatible Biju Das
  3 siblings, 1 reply; 25+ messages in thread
From: Biju Das @ 2024-03-08 18:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Huy Nguyen, Geert Uytterhoeven, Magnus Damm, Biju Das,
	Rob Herring, Yoshihiro Shimoda, Krzysztof Kozlowski,
	Uwe Kleine-König, linux-usb, linux-renesas-soc,
	Prabhakar Mahadev Lad, Biju Das

From: Huy Nguyen <huy.nguyen.wh@renesas.com>

The RZ/G2L family SoCs has 10 PIPE buffers compared to 16 pipe
buffers on RZ/A2M. Update the pipe configuration for RZ/G2L family
SoCs. For the backward compatibility SoC specific compatible is used
and will remove the same after few kernel releases.

Signed-off-by: Huy Nguyen <huy.nguyen.wh@renesas.com>
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
 drivers/usb/renesas_usbhs/common.c | 31 ++++++++++++++++++++++++++++--
 1 file changed, 29 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c
index dd1c17542439..030ec36deb64 100644
--- a/drivers/usb/renesas_usbhs/common.c
+++ b/drivers/usb/renesas_usbhs/common.c
@@ -397,6 +397,20 @@ static struct renesas_usbhs_driver_pipe_config usbhsc_new_pipe[] = {
 	RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_BULK, 512, 0xd8, true),
 };
 
+/* commonly used on RZ/G2L family */
+static struct renesas_usbhs_driver_pipe_config usbhsc_rzg2l_pipe[] = {
+	RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_CONTROL, 64, 0x00, false),
+	RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_ISOC, 1024, 0x08, true),
+	RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_ISOC, 1024, 0x28, true),
+	RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_BULK, 512, 0x48, true),
+	RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_BULK, 512, 0x58, true),
+	RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_BULK, 512, 0x68, true),
+	RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_INT, 64, 0x04, false),
+	RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_INT, 64, 0x05, false),
+	RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_INT, 64, 0x06, false),
+	RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_INT, 64, 0x07, false),
+};
+
 /*
  *		power control
  */
@@ -581,6 +595,10 @@ static const struct of_device_id usbhs_of_match[] = {
 		.compatible = "renesas,rza2-usbhs",
 		.data = &usbhs_rza2_plat_info,
 	},
+	{
+		.compatible = "renesas,rzg2l-usbhs",
+		.data = &usbhs_rza2_plat_info,
+	},
 	{ },
 };
 MODULE_DEVICE_TABLE(of, usbhs_of_match);
@@ -645,8 +663,17 @@ static int usbhs_probe(struct platform_device *pdev)
 
 	/* set default param if platform doesn't have */
 	if (usbhs_get_dparam(priv, has_new_pipe_configs)) {
-		priv->dparam.pipe_configs = usbhsc_new_pipe;
-		priv->dparam.pipe_size = ARRAY_SIZE(usbhsc_new_pipe);
+		/* for backward compatibility check soc specific compatible */
+		if (of_device_is_compatible(pdev->dev.of_node, "renesas,usbhs-r9a07g043") ||
+		    of_device_is_compatible(pdev->dev.of_node, "renesas,usbhs-r9a07g044") ||
+		    of_device_is_compatible(pdev->dev.of_node, "renesas,usbhs-r9a07g054") ||
+		    of_device_is_compatible(pdev->dev.of_node, "renesas,rzg2l-usbhs")) {
+			priv->dparam.pipe_configs = usbhsc_rzg2l_pipe;
+			priv->dparam.pipe_size = ARRAY_SIZE(usbhsc_rzg2l_pipe);
+		} else {
+			priv->dparam.pipe_configs = usbhsc_new_pipe;
+			priv->dparam.pipe_size = ARRAY_SIZE(usbhsc_new_pipe);
+		}
 	} else if (!priv->dparam.pipe_configs) {
 		priv->dparam.pipe_configs = usbhsc_default_pipe;
 		priv->dparam.pipe_size = ARRAY_SIZE(usbhsc_default_pipe);
-- 
2.25.1


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

* [PATCH 3/4] usb: renesas_usbhs: Remove trailing comma in the terminator entry for OF table
  2024-03-08 18:09 [PATCH 0/4] Fix USB pipe configuration for RZ/G2L Biju Das
  2024-03-08 18:09 ` [PATCH 1/4] dt-bindings: usb: renesas,usbhs: Document RZ/G2L family compatible Biju Das
  2024-03-08 18:09 ` [PATCH 2/4] usb: renesas_usbhs: Update usbhs pipe configuration for RZ/G2L family Biju Das
@ 2024-03-08 18:09 ` Biju Das
  2024-03-08 19:40   ` Geert Uytterhoeven
  2024-03-08 18:09 ` [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}: Update usbhs family compatible Biju Das
  3 siblings, 1 reply; 25+ messages in thread
From: Biju Das @ 2024-03-08 18:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Biju Das, Geert Uytterhoeven, Magnus Damm, Huy Nguyen,
	Rob Herring, Yoshihiro Shimoda, Krzysztof Kozlowski,
	Uwe Kleine-König, linux-usb, linux-renesas-soc,
	Prabhakar Mahadev Lad, Biju Das

Remove the trailing comma in the terminator entry for the OF table
making code robust against (theoretical) misrebases or other similar
things where the new entry goes _after_ the termination without the
compiler noticing.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
 drivers/usb/renesas_usbhs/common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c
index 030ec36deb64..7f8fc86fc687 100644
--- a/drivers/usb/renesas_usbhs/common.c
+++ b/drivers/usb/renesas_usbhs/common.c
@@ -599,7 +599,7 @@ static const struct of_device_id usbhs_of_match[] = {
 		.compatible = "renesas,rzg2l-usbhs",
 		.data = &usbhs_rza2_plat_info,
 	},
-	{ },
+	{ }
 };
 MODULE_DEVICE_TABLE(of, usbhs_of_match);
 
-- 
2.25.1


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

* [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}: Update usbhs family compatible
  2024-03-08 18:09 [PATCH 0/4] Fix USB pipe configuration for RZ/G2L Biju Das
                   ` (2 preceding siblings ...)
  2024-03-08 18:09 ` [PATCH 3/4] usb: renesas_usbhs: Remove trailing comma in the terminator entry for OF table Biju Das
@ 2024-03-08 18:09 ` Biju Das
  2024-03-09 12:08   ` Krzysztof Kozlowski
  3 siblings, 1 reply; 25+ messages in thread
From: Biju Das @ 2024-03-08 18:09 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Biju Das, Geert Uytterhoeven, Magnus Damm, linux-renesas-soc,
	devicetree, Prabhakar Mahadev Lad, Biju Das

Replace 'renesas,rza2m-usbhs->renesas,rzg2l-usbhs' as family compatible
for RZ/G2L family SOCs as there is a difference in number of pipe
buffers compared to RZ/A2M.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
 arch/arm64/boot/dts/renesas/r9a07g043.dtsi | 2 +-
 arch/arm64/boot/dts/renesas/r9a07g044.dtsi | 2 +-
 arch/arm64/boot/dts/renesas/r9a07g054.dtsi | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/boot/dts/renesas/r9a07g043.dtsi b/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
index 8721f4c9fa0f..766c54b91acc 100644
--- a/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
+++ b/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
@@ -812,7 +812,7 @@ usb2_phy1: usb-phy@11c70200 {
 
 		hsusb: usb@11c60000 {
 			compatible = "renesas,usbhs-r9a07g043",
-				     "renesas,rza2-usbhs";
+				     "renesas,rzg2l-usbhs";
 			reg = <0 0x11c60000 0 0x10000>;
 			interrupts = <SOC_PERIPHERAL_IRQ(100) IRQ_TYPE_EDGE_RISING>,
 				     <SOC_PERIPHERAL_IRQ(101) IRQ_TYPE_LEVEL_HIGH>,
diff --git a/arch/arm64/boot/dts/renesas/r9a07g044.dtsi b/arch/arm64/boot/dts/renesas/r9a07g044.dtsi
index 9f00b75d2bd0..88634ae43287 100644
--- a/arch/arm64/boot/dts/renesas/r9a07g044.dtsi
+++ b/arch/arm64/boot/dts/renesas/r9a07g044.dtsi
@@ -1217,7 +1217,7 @@ usb2_phy1: usb-phy@11c70200 {
 
 		hsusb: usb@11c60000 {
 			compatible = "renesas,usbhs-r9a07g044",
-				     "renesas,rza2-usbhs";
+				     "renesas,rzg2l-usbhs";
 			reg = <0 0x11c60000 0 0x10000>;
 			interrupts = <GIC_SPI 100 IRQ_TYPE_EDGE_RISING>,
 				     <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>,
diff --git a/arch/arm64/boot/dts/renesas/r9a07g054.dtsi b/arch/arm64/boot/dts/renesas/r9a07g054.dtsi
index 53d8905f367a..e89bfe4085f5 100644
--- a/arch/arm64/boot/dts/renesas/r9a07g054.dtsi
+++ b/arch/arm64/boot/dts/renesas/r9a07g054.dtsi
@@ -1225,7 +1225,7 @@ usb2_phy1: usb-phy@11c70200 {
 
 		hsusb: usb@11c60000 {
 			compatible = "renesas,usbhs-r9a07g054",
-				     "renesas,rza2-usbhs";
+				     "renesas,rzg2l-usbhs";
 			reg = <0 0x11c60000 0 0x10000>;
 			interrupts = <GIC_SPI 100 IRQ_TYPE_EDGE_RISING>,
 				     <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>,
-- 
2.25.1


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

* Re: [PATCH 2/4] usb: renesas_usbhs: Update usbhs pipe configuration for RZ/G2L family
  2024-03-08 18:09 ` [PATCH 2/4] usb: renesas_usbhs: Update usbhs pipe configuration for RZ/G2L family Biju Das
@ 2024-03-08 19:39   ` Geert Uytterhoeven
  2024-03-09 10:20     ` Biju Das
  0 siblings, 1 reply; 25+ messages in thread
From: Geert Uytterhoeven @ 2024-03-08 19:39 UTC (permalink / raw)
  To: Biju Das
  Cc: Greg Kroah-Hartman, Huy Nguyen, Geert Uytterhoeven, Magnus Damm,
	Rob Herring, Yoshihiro Shimoda, Krzysztof Kozlowski,
	Uwe Kleine-König, linux-usb, linux-renesas-soc,
	Prabhakar Mahadev Lad, Biju Das

Hi Biju,

On Fri, Mar 8, 2024 at 7:09 PM Biju Das <biju.das.jz@bp.renesas.com> wrote:
> From: Huy Nguyen <huy.nguyen.wh@renesas.com>
>
> The RZ/G2L family SoCs has 10 PIPE buffers compared to 16 pipe
> buffers on RZ/A2M. Update the pipe configuration for RZ/G2L family
> SoCs. For the backward compatibility SoC specific compatible is used
> and will remove the same after few kernel releases.
>
> Signed-off-by: Huy Nguyen <huy.nguyen.wh@renesas.com>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>

Thanks for your patch!

> --- a/drivers/usb/renesas_usbhs/common.c
> +++ b/drivers/usb/renesas_usbhs/common.c
> @@ -397,6 +397,20 @@ static struct renesas_usbhs_driver_pipe_config usbhsc_new_pipe[] = {
>         RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_BULK, 512, 0xd8, true),
>  };
>
> +/* commonly used on RZ/G2L family */
> +static struct renesas_usbhs_driver_pipe_config usbhsc_rzg2l_pipe[] = {
> +       RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_CONTROL, 64, 0x00, false),
> +       RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_ISOC, 1024, 0x08, true),
> +       RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_ISOC, 1024, 0x28, true),
> +       RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_BULK, 512, 0x48, true),
> +       RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_BULK, 512, 0x58, true),
> +       RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_BULK, 512, 0x68, true),
> +       RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_INT, 64, 0x04, false),
> +       RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_INT, 64, 0x05, false),
> +       RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_INT, 64, 0x06, false),
> +       RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_INT, 64, 0x07, false),
> +};
> +
>  /*
>   *             power control
>   */
> @@ -581,6 +595,10 @@ static const struct of_device_id usbhs_of_match[] = {
>                 .compatible = "renesas,rza2-usbhs",
>                 .data = &usbhs_rza2_plat_info,
>         },
> +       {
> +               .compatible = "renesas,rzg2l-usbhs",
> +               .data = &usbhs_rza2_plat_info,

Is usbhs_rza2_plat_info correct for RZ/G2L?

> +       },
>         { },
>  };
>  MODULE_DEVICE_TABLE(of, usbhs_of_match);
> @@ -645,8 +663,17 @@ static int usbhs_probe(struct platform_device *pdev)
>
>         /* set default param if platform doesn't have */
>         if (usbhs_get_dparam(priv, has_new_pipe_configs)) {
> -               priv->dparam.pipe_configs = usbhsc_new_pipe;
> -               priv->dparam.pipe_size = ARRAY_SIZE(usbhsc_new_pipe);
> +               /* for backward compatibility check soc specific compatible */
> +               if (of_device_is_compatible(pdev->dev.of_node, "renesas,usbhs-r9a07g043") ||
> +                   of_device_is_compatible(pdev->dev.of_node, "renesas,usbhs-r9a07g044") ||
> +                   of_device_is_compatible(pdev->dev.of_node, "renesas,usbhs-r9a07g054") ||

Please no of_device_is_compatible() checks in a driver's .probe()
method. Just add entries to usbhs_of_match[] instead.

> +                   of_device_is_compatible(pdev->dev.of_node, "renesas,rzg2l-usbhs")) {

Ah, that's where you really handle RZ/G2L.
Please use renesas_usbhs_platform_info instead.

> +                       priv->dparam.pipe_configs = usbhsc_rzg2l_pipe;
> +                       priv->dparam.pipe_size = ARRAY_SIZE(usbhsc_rzg2l_pipe);
> +               } else {
> +                       priv->dparam.pipe_configs = usbhsc_new_pipe;
> +                       priv->dparam.pipe_size = ARRAY_SIZE(usbhsc_new_pipe);
> +               }
>         } else if (!priv->dparam.pipe_configs) {
>                 priv->dparam.pipe_configs = usbhsc_default_pipe;
>                 priv->dparam.pipe_size = ARRAY_SIZE(usbhsc_default_pipe);

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

* Re: [PATCH 3/4] usb: renesas_usbhs: Remove trailing comma in the terminator entry for OF table
  2024-03-08 18:09 ` [PATCH 3/4] usb: renesas_usbhs: Remove trailing comma in the terminator entry for OF table Biju Das
@ 2024-03-08 19:40   ` Geert Uytterhoeven
  0 siblings, 0 replies; 25+ messages in thread
From: Geert Uytterhoeven @ 2024-03-08 19:40 UTC (permalink / raw)
  To: Biju Das
  Cc: Greg Kroah-Hartman, Geert Uytterhoeven, Magnus Damm, Huy Nguyen,
	Rob Herring, Yoshihiro Shimoda, Krzysztof Kozlowski,
	Uwe Kleine-König, linux-usb, linux-renesas-soc,
	Prabhakar Mahadev Lad, Biju Das

On Fri, Mar 8, 2024 at 7:09 PM Biju Das <biju.das.jz@bp.renesas.com> wrote:
> Remove the trailing comma in the terminator entry for the OF table
> making code robust against (theoretical) misrebases or other similar
> things where the new entry goes _after_ the termination without the
> compiler noticing.
>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

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

* RE: [PATCH 2/4] usb: renesas_usbhs: Update usbhs pipe configuration for RZ/G2L family
  2024-03-08 19:39   ` Geert Uytterhoeven
@ 2024-03-09 10:20     ` Biju Das
  0 siblings, 0 replies; 25+ messages in thread
From: Biju Das @ 2024-03-09 10:20 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Greg Kroah-Hartman, Huy Nguyen, Geert Uytterhoeven, Magnus Damm,
	Rob Herring, Yoshihiro Shimoda, Krzysztof Kozlowski,
	Uwe Kleine-König, linux-usb, linux-renesas-soc,
	Prabhakar Mahadev Lad, biju.das.au

Hi Geert,

Thanks for the feedback.

> -----Original Message-----
> From: Geert Uytterhoeven <geert@linux-m68k.org>
> Sent: Friday, March 8, 2024 7:40 PM
> To: Biju Das <biju.das.jz@bp.renesas.com>
> Subject: Re: [PATCH 2/4] usb: renesas_usbhs: Update usbhs pipe configuration for RZ/G2L family
> 
> Hi Biju,
> 
> On Fri, Mar 8, 2024 at 7:09 PM Biju Das <biju.das.jz@bp.renesas.com> wrote:
> > From: Huy Nguyen <huy.nguyen.wh@renesas.com>
> >
> > The RZ/G2L family SoCs has 10 PIPE buffers compared to 16 pipe buffers
> > on RZ/A2M. Update the pipe configuration for RZ/G2L family SoCs. For
> > the backward compatibility SoC specific compatible is used and will
> > remove the same after few kernel releases.
> >
> > Signed-off-by: Huy Nguyen <huy.nguyen.wh@renesas.com>
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> 
> Thanks for your patch!
> 
> > --- a/drivers/usb/renesas_usbhs/common.c
> > +++ b/drivers/usb/renesas_usbhs/common.c
> > @@ -397,6 +397,20 @@ static struct renesas_usbhs_driver_pipe_config usbhsc_new_pipe[] = {
> >         RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_BULK, 512, 0xd8, true),
> > };
> >
> > +/* commonly used on RZ/G2L family */
> > +static struct renesas_usbhs_driver_pipe_config usbhsc_rzg2l_pipe[] = {
> > +       RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_CONTROL, 64, 0x00, false),
> > +       RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_ISOC, 1024, 0x08, true),
> > +       RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_ISOC, 1024, 0x28, true),
> > +       RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_BULK, 512, 0x48, true),
> > +       RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_BULK, 512, 0x58, true),
> > +       RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_BULK, 512, 0x68, true),
> > +       RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_INT, 64, 0x04, false),
> > +       RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_INT, 64, 0x05, false),
> > +       RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_INT, 64, 0x06, false),
> > +       RENESAS_USBHS_PIPE(USB_ENDPOINT_XFER_INT, 64, 0x07, false), };
> > +
> >  /*
> >   *             power control
> >   */
> > @@ -581,6 +595,10 @@ static const struct of_device_id usbhs_of_match[] = {
> >                 .compatible = "renesas,rza2-usbhs",
> >                 .data = &usbhs_rza2_plat_info,
> >         },
> > +       {
> > +               .compatible = "renesas,rzg2l-usbhs",
> > +               .data = &usbhs_rza2_plat_info,
> 
> Is usbhs_rza2_plat_info correct for RZ/G2L?

Ok, Will use usbhs_rzg2l_plat_info, filling pipe_configs and pipe_size.

> 
> > +       },
> >         { },
> >  };
> >  MODULE_DEVICE_TABLE(of, usbhs_of_match); @@ -645,8 +663,17 @@ static
> > int usbhs_probe(struct platform_device *pdev)
> >
> >         /* set default param if platform doesn't have */
> >         if (usbhs_get_dparam(priv, has_new_pipe_configs)) {
> > -               priv->dparam.pipe_configs = usbhsc_new_pipe;
> > -               priv->dparam.pipe_size = ARRAY_SIZE(usbhsc_new_pipe);
> > +               /* for backward compatibility check soc specific compatible */
> > +               if (of_device_is_compatible(pdev->dev.of_node, "renesas,usbhs-r9a07g043") ||
> > +                   of_device_is_compatible(pdev->dev.of_node, "renesas,usbhs-r9a07g044") ||
> > +                   of_device_is_compatible(pdev->dev.of_node,
> > + "renesas,usbhs-r9a07g054") ||
> 
> Please no of_device_is_compatible() checks in a driver's .probe() method. Just add entries to
> usbhs_of_match[] instead.

Ok.
> 
> > +                   of_device_is_compatible(pdev->dev.of_node,
> > + "renesas,rzg2l-usbhs")) {
> 
> Ah, that's where you really handle RZ/G2L.
> Please use renesas_usbhs_platform_info instead.

Agreed, will move the table to rza2.c and use info to fill
pipe_configs and pipe_size.

Cheers,
Biju

> 
> > +                       priv->dparam.pipe_configs = usbhsc_rzg2l_pipe;
> > +                       priv->dparam.pipe_size = ARRAY_SIZE(usbhsc_rzg2l_pipe);
> > +               } else {
> > +                       priv->dparam.pipe_configs = usbhsc_new_pipe;
> > +                       priv->dparam.pipe_size = ARRAY_SIZE(usbhsc_new_pipe);
> > +               }
> >         } else if (!priv->dparam.pipe_configs) {
> >                 priv->dparam.pipe_configs = usbhsc_default_pipe;
> >                 priv->dparam.pipe_size =
> > ARRAY_SIZE(usbhsc_default_pipe);

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

* Re: [PATCH 1/4] dt-bindings: usb: renesas,usbhs: Document RZ/G2L family compatible
  2024-03-08 18:09 ` [PATCH 1/4] dt-bindings: usb: renesas,usbhs: Document RZ/G2L family compatible Biju Das
@ 2024-03-09 12:07   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 25+ messages in thread
From: Krzysztof Kozlowski @ 2024-03-09 12:07 UTC (permalink / raw)
  To: Biju Das, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Greg Kroah-Hartman, Geert Uytterhoeven, Magnus Damm,
	Yoshihiro Shimoda, linux-usb, devicetree, linux-renesas-soc,
	Prabhakar Mahadev Lad, Biju Das

On 08/03/2024 19:09, Biju Das wrote:
> The USBHS IP found on RZ/G2L SoCs only has 10 pipe buffers compared
> to 16 pipe buffers on RZ/A2M. Document renesas,rzg2l-usbhs family
> compatible to handle this difference for RZ/G2L family SoCs.
> 

Another point of futility of using generic fallbacks which are simply
not correct. Just start using SoCs fallbacks.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


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

* Re: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}: Update usbhs family compatible
  2024-03-08 18:09 ` [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}: Update usbhs family compatible Biju Das
@ 2024-03-09 12:08   ` Krzysztof Kozlowski
  2024-03-09 12:14     ` Biju Das
  0 siblings, 1 reply; 25+ messages in thread
From: Krzysztof Kozlowski @ 2024-03-09 12:08 UTC (permalink / raw)
  To: Biju Das, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Geert Uytterhoeven, Magnus Damm, linux-renesas-soc, devicetree,
	Prabhakar Mahadev Lad, Biju Das

On 08/03/2024 19:09, Biju Das wrote:
> Replace 'renesas,rza2m-usbhs->renesas,rzg2l-usbhs' as family compatible
> for RZ/G2L family SOCs as there is a difference in number of pipe
> buffers compared to RZ/A2M.
> 
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
>  arch/arm64/boot/dts/renesas/r9a07g043.dtsi | 2 +-
>  arch/arm64/boot/dts/renesas/r9a07g044.dtsi | 2 +-
>  arch/arm64/boot/dts/renesas/r9a07g054.dtsi | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/renesas/r9a07g043.dtsi b/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
> index 8721f4c9fa0f..766c54b91acc 100644
> --- a/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
> +++ b/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
> @@ -812,7 +812,7 @@ usb2_phy1: usb-phy@11c70200 {
>  
>  		hsusb: usb@11c60000 {
>  			compatible = "renesas,usbhs-r9a07g043",
> -				     "renesas,rza2-usbhs";
> +				     "renesas,rzg2l-usbhs";

This looks like ABI break and commit msg is quite vague about it.

Best regards,
Krzysztof


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

* RE: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}: Update usbhs family compatible
  2024-03-09 12:08   ` Krzysztof Kozlowski
@ 2024-03-09 12:14     ` Biju Das
  2024-03-09 12:25       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 25+ messages in thread
From: Biju Das @ 2024-03-09 12:14 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Geert Uytterhoeven, Magnus Damm, linux-renesas-soc, devicetree,
	Prabhakar Mahadev Lad, biju.das.au

Hi Krzysztof Kozlowski,

Thanks for the feedback.

> -----Original Message-----
> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Sent: Saturday, March 9, 2024 12:08 PM
> Subject: Re: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}: Update usbhs family compatible
> 
> On 08/03/2024 19:09, Biju Das wrote:
> > Replace 'renesas,rza2m-usbhs->renesas,rzg2l-usbhs' as family
> > compatible for RZ/G2L family SOCs as there is a difference in number
> > of pipe buffers compared to RZ/A2M.
> >
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > ---
> >  arch/arm64/boot/dts/renesas/r9a07g043.dtsi | 2 +-
> > arch/arm64/boot/dts/renesas/r9a07g044.dtsi | 2 +-
> > arch/arm64/boot/dts/renesas/r9a07g054.dtsi | 2 +-
> >  3 files changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
> > b/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
> > index 8721f4c9fa0f..766c54b91acc 100644
> > --- a/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
> > +++ b/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
> > @@ -812,7 +812,7 @@ usb2_phy1: usb-phy@11c70200 {
> >
> >  		hsusb: usb@11c60000 {
> >  			compatible = "renesas,usbhs-r9a07g043",
> > -				     "renesas,rza2-usbhs";
> > +				     "renesas,rzg2l-usbhs";
> 
> This looks like ABI break and commit msg is quite vague about it.

OK, Will update the commit message as driver is taking care of the backward
compatibility.

Cheers,
Biju

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

* Re: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}: Update usbhs family compatible
  2024-03-09 12:14     ` Biju Das
@ 2024-03-09 12:25       ` Krzysztof Kozlowski
  2024-03-09 12:32         ` Biju Das
  0 siblings, 1 reply; 25+ messages in thread
From: Krzysztof Kozlowski @ 2024-03-09 12:25 UTC (permalink / raw)
  To: Biju Das, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Geert Uytterhoeven, Magnus Damm, linux-renesas-soc, devicetree,
	Prabhakar Mahadev Lad, biju.das.au

On 09/03/2024 13:14, Biju Das wrote:
> Hi Krzysztof Kozlowski,
> 
> Thanks for the feedback.
> 
>> -----Original Message-----
>> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>> Sent: Saturday, March 9, 2024 12:08 PM
>> Subject: Re: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}: Update usbhs family compatible
>>
>> On 08/03/2024 19:09, Biju Das wrote:
>>> Replace 'renesas,rza2m-usbhs->renesas,rzg2l-usbhs' as family
>>> compatible for RZ/G2L family SOCs as there is a difference in number
>>> of pipe buffers compared to RZ/A2M.
>>>
>>> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
>>> ---
>>>  arch/arm64/boot/dts/renesas/r9a07g043.dtsi | 2 +-
>>> arch/arm64/boot/dts/renesas/r9a07g044.dtsi | 2 +-
>>> arch/arm64/boot/dts/renesas/r9a07g054.dtsi | 2 +-
>>>  3 files changed, 3 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
>>> b/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
>>> index 8721f4c9fa0f..766c54b91acc 100644
>>> --- a/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
>>> +++ b/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
>>> @@ -812,7 +812,7 @@ usb2_phy1: usb-phy@11c70200 {
>>>
>>>  		hsusb: usb@11c60000 {
>>>  			compatible = "renesas,usbhs-r9a07g043",
>>> -				     "renesas,rza2-usbhs";
>>> +				     "renesas,rzg2l-usbhs";
>>
>> This looks like ABI break and commit msg is quite vague about it.
> 
> OK, Will update the commit message as driver is taking care of the backward
> compatibility.

Ah, I was not precise here, you should consider the impact this is on
DTB used on other kernels. You guys should really stop using
imprecise/incorrect generic fallbacks and, since it is usually tricky to
know which fallback is correct or not, you should stop using them at all.

Such change of replacing fallback is really odd.

Best regards,
Krzysztof


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

* RE: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}: Update usbhs family compatible
  2024-03-09 12:25       ` Krzysztof Kozlowski
@ 2024-03-09 12:32         ` Biju Das
  2024-03-09 13:30           ` Krzysztof Kozlowski
  0 siblings, 1 reply; 25+ messages in thread
From: Biju Das @ 2024-03-09 12:32 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Geert Uytterhoeven, Magnus Damm, linux-renesas-soc, devicetree,
	Prabhakar Mahadev Lad, biju.das.au

Hi Krzysztof Kozlowski,

> -----Original Message-----
> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Sent: Saturday, March 9, 2024 12:26 PM
> Subject: Re: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}: Update usbhs family compatible
> 
> On 09/03/2024 13:14, Biju Das wrote:
> > Hi Krzysztof Kozlowski,
> >
> > Thanks for the feedback.
> >
> >> -----Original Message-----
> >> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> >> Sent: Saturday, March 9, 2024 12:08 PM
> >> Subject: Re: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}:
> >> Update usbhs family compatible
> >>
> >> On 08/03/2024 19:09, Biju Das wrote:
> >>> Replace 'renesas,rza2m-usbhs->renesas,rzg2l-usbhs' as family
> >>> compatible for RZ/G2L family SOCs as there is a difference in number
> >>> of pipe buffers compared to RZ/A2M.
> >>>
> >>> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> >>> ---
> >>>  arch/arm64/boot/dts/renesas/r9a07g043.dtsi | 2 +-
> >>> arch/arm64/boot/dts/renesas/r9a07g044.dtsi | 2 +-
> >>> arch/arm64/boot/dts/renesas/r9a07g054.dtsi | 2 +-
> >>>  3 files changed, 3 insertions(+), 3 deletions(-)
> >>>
> >>> diff --git a/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
> >>> b/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
> >>> index 8721f4c9fa0f..766c54b91acc 100644
> >>> --- a/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
> >>> +++ b/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
> >>> @@ -812,7 +812,7 @@ usb2_phy1: usb-phy@11c70200 {
> >>>
> >>>  		hsusb: usb@11c60000 {
> >>>  			compatible = "renesas,usbhs-r9a07g043",
> >>> -				     "renesas,rza2-usbhs";
> >>> +				     "renesas,rzg2l-usbhs";
> >>
> >> This looks like ABI break and commit msg is quite vague about it.
> >
> > OK, Will update the commit message as driver is taking care of the
> > backward compatibility.
> 
> Ah, I was not precise here, you should consider the impact this is on DTB used on other kernels. You
> guys should really stop using imprecise/incorrect generic fallbacks and, since it is usually tricky to
> know which fallback is correct or not, you should stop using them at all.

There will be driver change to handle SoC specific compatible.

So ,

old DTB + old kernel will have 16 pipe buffers
old DTB + newer kernel will have 9 pipe buffers.
New DTB + new kernel will have 9 pipe buffer.

Cheer,
Biju



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

* Re: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}: Update usbhs family compatible
  2024-03-09 12:32         ` Biju Das
@ 2024-03-09 13:30           ` Krzysztof Kozlowski
  2024-03-09 15:43             ` Biju Das
  2024-03-11  9:03             ` Geert Uytterhoeven
  0 siblings, 2 replies; 25+ messages in thread
From: Krzysztof Kozlowski @ 2024-03-09 13:30 UTC (permalink / raw)
  To: Biju Das, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Geert Uytterhoeven, Magnus Damm, linux-renesas-soc, devicetree,
	Prabhakar Mahadev Lad, biju.das.au

On 09/03/2024 13:32, Biju Das wrote:
> Hi Krzysztof Kozlowski,
> 
>> -----Original Message-----
>> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>> Sent: Saturday, March 9, 2024 12:26 PM
>> Subject: Re: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}: Update usbhs family compatible
>>
>> On 09/03/2024 13:14, Biju Das wrote:
>>> Hi Krzysztof Kozlowski,
>>>
>>> Thanks for the feedback.
>>>
>>>> -----Original Message-----
>>>> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>>> Sent: Saturday, March 9, 2024 12:08 PM
>>>> Subject: Re: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}:
>>>> Update usbhs family compatible
>>>>
>>>> On 08/03/2024 19:09, Biju Das wrote:
>>>>> Replace 'renesas,rza2m-usbhs->renesas,rzg2l-usbhs' as family
>>>>> compatible for RZ/G2L family SOCs as there is a difference in number
>>>>> of pipe buffers compared to RZ/A2M.
>>>>>
>>>>> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
>>>>> ---
>>>>>  arch/arm64/boot/dts/renesas/r9a07g043.dtsi | 2 +-
>>>>> arch/arm64/boot/dts/renesas/r9a07g044.dtsi | 2 +-
>>>>> arch/arm64/boot/dts/renesas/r9a07g054.dtsi | 2 +-
>>>>>  3 files changed, 3 insertions(+), 3 deletions(-)
>>>>>
>>>>> diff --git a/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
>>>>> b/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
>>>>> index 8721f4c9fa0f..766c54b91acc 100644
>>>>> --- a/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
>>>>> +++ b/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
>>>>> @@ -812,7 +812,7 @@ usb2_phy1: usb-phy@11c70200 {
>>>>>
>>>>>  		hsusb: usb@11c60000 {
>>>>>  			compatible = "renesas,usbhs-r9a07g043",
>>>>> -				     "renesas,rza2-usbhs";
>>>>> +				     "renesas,rzg2l-usbhs";
>>>>
>>>> This looks like ABI break and commit msg is quite vague about it.
>>>
>>> OK, Will update the commit message as driver is taking care of the
>>> backward compatibility.
>>
>> Ah, I was not precise here, you should consider the impact this is on DTB used on other kernels. You
>> guys should really stop using imprecise/incorrect generic fallbacks and, since it is usually tricky to
>> know which fallback is correct or not, you should stop using them at all.
> 
> There will be driver change to handle SoC specific compatible.
> 
> So ,
> 
> old DTB + old kernel will have 16 pipe buffers
> old DTB + newer kernel will have 9 pipe buffers.
> New DTB + new kernel will have 9 pipe buffer.

You missed new DTB and old kernel. This breaks all users of DTS. That's
the entire point of your broken generic compatibles which you did not
address.

Best regards,
Krzysztof


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

* RE: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}: Update usbhs family compatible
  2024-03-09 13:30           ` Krzysztof Kozlowski
@ 2024-03-09 15:43             ` Biju Das
  2024-03-09 15:53               ` Biju Das
  2024-03-10  8:03               ` Krzysztof Kozlowski
  2024-03-11  9:03             ` Geert Uytterhoeven
  1 sibling, 2 replies; 25+ messages in thread
From: Biju Das @ 2024-03-09 15:43 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Geert Uytterhoeven, Magnus Damm, linux-renesas-soc, devicetree,
	Prabhakar Mahadev Lad, biju.das.au

Hi Krzysztof Kozlowski,

> -----Original Message-----
> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Sent: Saturday, March 9, 2024 1:30 PM
> Subject: Re: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}: Update usbhs family compatible
> 
> On 09/03/2024 13:32, Biju Das wrote:
> > Hi Krzysztof Kozlowski,
> >
> >> -----Original Message-----
> >> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> >> Sent: Saturday, March 9, 2024 12:26 PM
> >> Subject: Re: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}:
> >> Update usbhs family compatible
> >>
> >> On 09/03/2024 13:14, Biju Das wrote:
> >>> Hi Krzysztof Kozlowski,
> >>>
> >>> Thanks for the feedback.
> >>>
> >>>> -----Original Message-----
> >>>> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> >>>> Sent: Saturday, March 9, 2024 12:08 PM
> >>>> Subject: Re: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}:
> >>>> Update usbhs family compatible
> >>>>
> >>>> On 08/03/2024 19:09, Biju Das wrote:
> >>>>> Replace 'renesas,rza2m-usbhs->renesas,rzg2l-usbhs' as family
> >>>>> compatible for RZ/G2L family SOCs as there is a difference in
> >>>>> number of pipe buffers compared to RZ/A2M.
> >>>>>
> >>>>> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> >>>>> ---
> >>>>>  arch/arm64/boot/dts/renesas/r9a07g043.dtsi | 2 +-
> >>>>> arch/arm64/boot/dts/renesas/r9a07g044.dtsi | 2 +-
> >>>>> arch/arm64/boot/dts/renesas/r9a07g054.dtsi | 2 +-
> >>>>>  3 files changed, 3 insertions(+), 3 deletions(-)
> >>>>>
> >>>>> diff --git a/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
> >>>>> b/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
> >>>>> index 8721f4c9fa0f..766c54b91acc 100644
> >>>>> --- a/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
> >>>>> +++ b/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
> >>>>> @@ -812,7 +812,7 @@ usb2_phy1: usb-phy@11c70200 {
> >>>>>
> >>>>>  		hsusb: usb@11c60000 {
> >>>>>  			compatible = "renesas,usbhs-r9a07g043",
> >>>>> -				     "renesas,rza2-usbhs";
> >>>>> +				     "renesas,rzg2l-usbhs";
> >>>>
> >>>> This looks like ABI break and commit msg is quite vague about it.
> >>>
> >>> OK, Will update the commit message as driver is taking care of the
> >>> backward compatibility.
> >>
> >> Ah, I was not precise here, you should consider the impact this is on
> >> DTB used on other kernels. You guys should really stop using
> >> imprecise/incorrect generic fallbacks and, since it is usually tricky to know which fallback is
> correct or not, you should stop using them at all.
> >
> > There will be driver change to handle SoC specific compatible.
> >
> > So ,
> >
> > old DTB + old kernel will have 16 pipe buffers old DTB + newer kernel
> > will have 9 pipe buffers.
> > New DTB + new kernel will have 9 pipe buffer.
> 
> You missed new DTB and old kernel. This breaks all users of DTS. That's the entire point of your broken
> generic compatibles which you did not address.

As per my knowledge, there is no user in RZ/G2L is using new DTB and old kernel.
So, it is safe.

Cheers,
Biju

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

* RE: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}: Update usbhs family compatible
  2024-03-09 15:43             ` Biju Das
@ 2024-03-09 15:53               ` Biju Das
  2024-03-10  7:57                 ` Biju Das
  2024-03-10  8:03               ` Krzysztof Kozlowski
  1 sibling, 1 reply; 25+ messages in thread
From: Biju Das @ 2024-03-09 15:53 UTC (permalink / raw)
  To: Biju Das, Krzysztof Kozlowski, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley
  Cc: Geert Uytterhoeven, Magnus Damm, linux-renesas-soc, devicetree,
	Prabhakar Mahadev Lad, biju.das.au

Hi Krzysztof Kozlowski,

> -----Original Message-----
> From: Biju Das <biju.das.jz@bp.renesas.com>
> Sent: Saturday, March 9, 2024 3:43 PM
> Subject: RE: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}: Update usbhs family compatible
> 
> Hi Krzysztof Kozlowski,
> 
> > -----Original Message-----
> > From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > Sent: Saturday, March 9, 2024 1:30 PM
> > Subject: Re: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}:
> > Update usbhs family compatible
> >
> > On 09/03/2024 13:32, Biju Das wrote:
> > > Hi Krzysztof Kozlowski,
> > >
> > >> -----Original Message-----
> > >> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > >> Sent: Saturday, March 9, 2024 12:26 PM
> > >> Subject: Re: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}:
> > >> Update usbhs family compatible
> > >>
> > >> On 09/03/2024 13:14, Biju Das wrote:
> > >>> Hi Krzysztof Kozlowski,
> > >>>
> > >>> Thanks for the feedback.
> > >>>
> > >>>> -----Original Message-----
> > >>>> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > >>>> Sent: Saturday, March 9, 2024 12:08 PM
> > >>>> Subject: Re: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}:
> > >>>> Update usbhs family compatible
> > >>>>
> > >>>> On 08/03/2024 19:09, Biju Das wrote:
> > >>>>> Replace 'renesas,rza2m-usbhs->renesas,rzg2l-usbhs' as family
> > >>>>> compatible for RZ/G2L family SOCs as there is a difference in
> > >>>>> number of pipe buffers compared to RZ/A2M.
> > >>>>>
> > >>>>> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > >>>>> ---
> > >>>>>  arch/arm64/boot/dts/renesas/r9a07g043.dtsi | 2 +-
> > >>>>> arch/arm64/boot/dts/renesas/r9a07g044.dtsi | 2 +-
> > >>>>> arch/arm64/boot/dts/renesas/r9a07g054.dtsi | 2 +-
> > >>>>>  3 files changed, 3 insertions(+), 3 deletions(-)
> > >>>>>
> > >>>>> diff --git a/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
> > >>>>> b/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
> > >>>>> index 8721f4c9fa0f..766c54b91acc 100644
> > >>>>> --- a/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
> > >>>>> +++ b/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
> > >>>>> @@ -812,7 +812,7 @@ usb2_phy1: usb-phy@11c70200 {
> > >>>>>
> > >>>>>  		hsusb: usb@11c60000 {
> > >>>>>  			compatible = "renesas,usbhs-r9a07g043",
> > >>>>> -				     "renesas,rza2-usbhs";
> > >>>>> +				     "renesas,rzg2l-usbhs";
> > >>>>
> > >>>> This looks like ABI break and commit msg is quite vague about it.
> > >>>
> > >>> OK, Will update the commit message as driver is taking care of the
> > >>> backward compatibility.
> > >>
> > >> Ah, I was not precise here, you should consider the impact this is
> > >> on DTB used on other kernels. You guys should really stop using
> > >> imprecise/incorrect generic fallbacks and, since it is usually
> > >> tricky to know which fallback is
> > correct or not, you should stop using them at all.
> > >
> > > There will be driver change to handle SoC specific compatible.
> > >
> > > So ,
> > >
> > > old DTB + old kernel will have 16 pipe buffers old DTB + newer
> > > kernel will have 9 pipe buffers.
> > > New DTB + new kernel will have 9 pipe buffer.
> >
> > You missed new DTB and old kernel. This breaks all users of DTS.
> > That's the entire point of your broken generic compatibles which you did not address.
> 
> As per my knowledge, there is no user in RZ/G2L is using new DTB and old kernel.
> So, it is safe.

If there is a user for such change, we could use

	compatible = "renesas,usbhs-r9a07g043",
	             "renesas,rzg2l-usbhs",
			 "renesas,rza2-usbhs";

Or

	compatible = "renesas,usbhs-r9a07g043",
			 "renesas,rza2-usbhs";


The former consumes less memory compared to the later.

As later requires, 3 platform structures for rz/g2l, rz/v2l and rz/gul
whereas the former requires just 1.


Cheers,
Biju



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

* RE: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}: Update usbhs family compatible
  2024-03-09 15:53               ` Biju Das
@ 2024-03-10  7:57                 ` Biju Das
  2024-03-10  8:06                   ` Krzysztof Kozlowski
  0 siblings, 1 reply; 25+ messages in thread
From: Biju Das @ 2024-03-10  7:57 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Geert Uytterhoeven, Magnus Damm, linux-renesas-soc, devicetree,
	Prabhakar Mahadev Lad, biju.das.au

Hi Krzysztof Kozlowski,

> >
> > > -----Original Message-----
> > > From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > > Sent: Saturday, March 9, 2024 1:30 PM
> > > Subject: Re: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}:
> > > Update usbhs family compatible
> > >
> > > On 09/03/2024 13:32, Biju Das wrote:
> > > > Hi Krzysztof Kozlowski,
> > > >
> > > >> -----Original Message-----
> > > >> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > > >> Sent: Saturday, March 9, 2024 12:26 PM
> > > >> Subject: Re: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}:
> > > >> Update usbhs family compatible
> > > >>
> > > >> On 09/03/2024 13:14, Biju Das wrote:
> > > >>> Hi Krzysztof Kozlowski,
> > > >>>
> > > >>> Thanks for the feedback.
> > > >>>
> > > >>>> -----Original Message-----
> > > >>>> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > > >>>> Sent: Saturday, March 9, 2024 12:08 PM
> > > >>>> Subject: Re: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}:
> > > >>>> Update usbhs family compatible
> > > >>>>
> > > >>>> On 08/03/2024 19:09, Biju Das wrote:
> > > >>>>> Replace 'renesas,rza2m-usbhs->renesas,rzg2l-usbhs' as family
> > > >>>>> compatible for RZ/G2L family SOCs as there is a difference in
> > > >>>>> number of pipe buffers compared to RZ/A2M.
> > > >>>>>
> > > >>>>> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > > >>>>> ---
> > > >>>>>  arch/arm64/boot/dts/renesas/r9a07g043.dtsi | 2 +-
> > > >>>>> arch/arm64/boot/dts/renesas/r9a07g044.dtsi | 2 +-
> > > >>>>> arch/arm64/boot/dts/renesas/r9a07g054.dtsi | 2 +-
> > > >>>>>  3 files changed, 3 insertions(+), 3 deletions(-)
> > > >>>>>
> > > >>>>> diff --git a/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
> > > >>>>> b/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
> > > >>>>> index 8721f4c9fa0f..766c54b91acc 100644
> > > >>>>> --- a/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
> > > >>>>> +++ b/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
> > > >>>>> @@ -812,7 +812,7 @@ usb2_phy1: usb-phy@11c70200 {
> > > >>>>>
> > > >>>>>  		hsusb: usb@11c60000 {
> > > >>>>>  			compatible = "renesas,usbhs-r9a07g043",
> > > >>>>> -				     "renesas,rza2-usbhs";
> > > >>>>> +				     "renesas,rzg2l-usbhs";
> > > >>>>
> > > >>>> This looks like ABI break and commit msg is quite vague about it.
> > > >>>
> > > >>> OK, Will update the commit message as driver is taking care of
> > > >>> the backward compatibility.
> > > >>
> > > >> Ah, I was not precise here, you should consider the impact this
> > > >> is on DTB used on other kernels. You guys should really stop
> > > >> using imprecise/incorrect generic fallbacks and, since it is
> > > >> usually tricky to know which fallback is
> > > correct or not, you should stop using them at all.
> > > >
> > > > There will be driver change to handle SoC specific compatible.
> > > >
> > > > So ,
> > > >
> > > > old DTB + old kernel will have 16 pipe buffers old DTB + newer
> > > > kernel will have 9 pipe buffers.
> > > > New DTB + new kernel will have 9 pipe buffer.
> > >
> > > You missed new DTB and old kernel. This breaks all users of DTS.
> > > That's the entire point of your broken generic compatibles which you did not address.
> >
> > As per my knowledge, there is no user in RZ/G2L is using new DTB and old kernel.
> > So, it is safe.
> 
> If there is a user for such change, we could use
> 
> 	compatible = "renesas,usbhs-r9a07g043",
> 	             "renesas,rzg2l-usbhs",
> 			 "renesas,rza2-usbhs";
> 
> Or
> 
> 	compatible = "renesas,usbhs-r9a07g043",
> 			 "renesas,rza2-usbhs";
> 
> 
> The former consumes less memory compared to the later.
> 
> As later requires, 3 platform structures for rz/g2l, rz/v2l and rz/gul whereas the former requires just
> 1.

Another way is using RZ/G2L SoC fallback compatible for both RZ/V2L and RZ/Five varients

	compatible = "renesas,usbhs-r9a07g043",
	             "renesas, usbhs-r9a07g044",
			 "renesas,rza2-usbhs";

This will fit into all ABI combinations with optimized memory usage in driver related to platform structure.

old DTB + old kernel will have 16 pipe buffers
old DTB + new kernel will have 9 pipe buffers
New DTB + old kernel will have 16 pipe buffers
New DTB + new kernel will have 9 pipe buffers

Cheers,
Biju






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

* Re: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}: Update usbhs family compatible
  2024-03-09 15:43             ` Biju Das
  2024-03-09 15:53               ` Biju Das
@ 2024-03-10  8:03               ` Krzysztof Kozlowski
  1 sibling, 0 replies; 25+ messages in thread
From: Krzysztof Kozlowski @ 2024-03-10  8:03 UTC (permalink / raw)
  To: Biju Das, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Geert Uytterhoeven, Magnus Damm, linux-renesas-soc, devicetree,
	Prabhakar Mahadev Lad, biju.das.au

On 09/03/2024 16:43, Biju Das wrote:
> Hi Krzysztof Kozlowski,
> 
>> -----Original Message-----
>> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>> Sent: Saturday, March 9, 2024 1:30 PM
>> Subject: Re: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}: Update usbhs family compatible
>>
>> On 09/03/2024 13:32, Biju Das wrote:
>>> Hi Krzysztof Kozlowski,
>>>
>>>> -----Original Message-----
>>>> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>>> Sent: Saturday, March 9, 2024 12:26 PM
>>>> Subject: Re: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}:
>>>> Update usbhs family compatible
>>>>
>>>> On 09/03/2024 13:14, Biju Das wrote:
>>>>> Hi Krzysztof Kozlowski,
>>>>>
>>>>> Thanks for the feedback.
>>>>>
>>>>>> -----Original Message-----
>>>>>> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>>>>> Sent: Saturday, March 9, 2024 12:08 PM
>>>>>> Subject: Re: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}:
>>>>>> Update usbhs family compatible
>>>>>>
>>>>>> On 08/03/2024 19:09, Biju Das wrote:
>>>>>>> Replace 'renesas,rza2m-usbhs->renesas,rzg2l-usbhs' as family
>>>>>>> compatible for RZ/G2L family SOCs as there is a difference in
>>>>>>> number of pipe buffers compared to RZ/A2M.
>>>>>>>
>>>>>>> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
>>>>>>> ---
>>>>>>>  arch/arm64/boot/dts/renesas/r9a07g043.dtsi | 2 +-
>>>>>>> arch/arm64/boot/dts/renesas/r9a07g044.dtsi | 2 +-
>>>>>>> arch/arm64/boot/dts/renesas/r9a07g054.dtsi | 2 +-
>>>>>>>  3 files changed, 3 insertions(+), 3 deletions(-)
>>>>>>>
>>>>>>> diff --git a/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
>>>>>>> b/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
>>>>>>> index 8721f4c9fa0f..766c54b91acc 100644
>>>>>>> --- a/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
>>>>>>> +++ b/arch/arm64/boot/dts/renesas/r9a07g043.dtsi
>>>>>>> @@ -812,7 +812,7 @@ usb2_phy1: usb-phy@11c70200 {
>>>>>>>
>>>>>>>  		hsusb: usb@11c60000 {
>>>>>>>  			compatible = "renesas,usbhs-r9a07g043",
>>>>>>> -				     "renesas,rza2-usbhs";
>>>>>>> +				     "renesas,rzg2l-usbhs";
>>>>>>
>>>>>> This looks like ABI break and commit msg is quite vague about it.
>>>>>
>>>>> OK, Will update the commit message as driver is taking care of the
>>>>> backward compatibility.
>>>>
>>>> Ah, I was not precise here, you should consider the impact this is on
>>>> DTB used on other kernels. You guys should really stop using
>>>> imprecise/incorrect generic fallbacks and, since it is usually tricky to know which fallback is
>> correct or not, you should stop using them at all.
>>>
>>> There will be driver change to handle SoC specific compatible.
>>>
>>> So ,
>>>
>>> old DTB + old kernel will have 16 pipe buffers old DTB + newer kernel
>>> will have 9 pipe buffers.
>>> New DTB + new kernel will have 9 pipe buffer.
>>
>> You missed new DTB and old kernel. This breaks all users of DTS. That's the entire point of your broken
>> generic compatibles which you did not address.
> 
> As per my knowledge, there is no user in RZ/G2L is using new DTB and old kernel.
> So, it is safe.

What do you mean? There can be hundreds of users like this, every
company could fork the kernel but use exported DTS. Or every other
open-source project using exported/packaged DTS repo.

Best regards,
Krzysztof


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

* Re: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}: Update usbhs family compatible
  2024-03-10  7:57                 ` Biju Das
@ 2024-03-10  8:06                   ` Krzysztof Kozlowski
  2024-03-10  8:16                     ` Biju Das
  0 siblings, 1 reply; 25+ messages in thread
From: Krzysztof Kozlowski @ 2024-03-10  8:06 UTC (permalink / raw)
  To: Biju Das, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Geert Uytterhoeven, Magnus Damm, linux-renesas-soc, devicetree,
	Prabhakar Mahadev Lad, biju.das.au

On 10/03/2024 08:57, Biju Das wrote:
>>>>> old DTB + old kernel will have 16 pipe buffers old DTB + newer
>>>>> kernel will have 9 pipe buffers.
>>>>> New DTB + new kernel will have 9 pipe buffer.
>>>>
>>>> You missed new DTB and old kernel. This breaks all users of DTS.
>>>> That's the entire point of your broken generic compatibles which you did not address.
>>>
>>> As per my knowledge, there is no user in RZ/G2L is using new DTB and old kernel.
>>> So, it is safe.
>>
>> If there is a user for such change, we could use
>>
>> 	compatible = "renesas,usbhs-r9a07g043",
>> 	             "renesas,rzg2l-usbhs",
>> 			 "renesas,rza2-usbhs";
>>
>> Or
>>
>> 	compatible = "renesas,usbhs-r9a07g043",
>> 			 "renesas,rza2-usbhs";
>>
>>
>> The former consumes less memory compared to the later.
>>
>> As later requires, 3 platform structures for rz/g2l, rz/v2l and rz/gul whereas the former requires just
>> 1.
> 
> Another way is using RZ/G2L SoC fallback compatible for both RZ/V2L and RZ/Five varients
> 
> 	compatible = "renesas,usbhs-r9a07g043",
> 	             "renesas, usbhs-r9a07g044",

How does it solve anything? Nothing binds to this.

> 			 "renesas,rza2-usbhs";
> 
> This will fit into all ABI combinations with optimized memory usage in driver related to platform structure.
> 
> old DTB + old kernel will have 16 pipe buffers
> old DTB + new kernel will have 9 pipe buffers
> New DTB + old kernel will have 16 pipe buffers
> New DTB + new kernel will have 9 pipe buffers

Maybe just drop incorrect generic compatibles since you are breaking
users? You did not provide any rationale against my arguments.

Best regards,
Krzysztof


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

* RE: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}: Update usbhs family compatible
  2024-03-10  8:06                   ` Krzysztof Kozlowski
@ 2024-03-10  8:16                     ` Biju Das
  2024-03-10  8:39                       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 25+ messages in thread
From: Biju Das @ 2024-03-10  8:16 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Geert Uytterhoeven, Magnus Damm, linux-renesas-soc, devicetree,
	Prabhakar Mahadev Lad, biju.das.au

Hi Krzysztof Kozlowski,

> -----Original Message-----
> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Sent: Sunday, March 10, 2024 8:06 AM
> Subject: Re: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}: Update usbhs family compatible
> 
> On 10/03/2024 08:57, Biju Das wrote:
> >>>>> old DTB + old kernel will have 16 pipe buffers old DTB + newer
> >>>>> kernel will have 9 pipe buffers.
> >>>>> New DTB + new kernel will have 9 pipe buffer.
> >>>>
> >>>> You missed new DTB and old kernel. This breaks all users of DTS.
> >>>> That's the entire point of your broken generic compatibles which you did not address.
> >>>
> >>> As per my knowledge, there is no user in RZ/G2L is using new DTB and old kernel.
> >>> So, it is safe.
> >>
> >> If there is a user for such change, we could use
> >>
> >> 	compatible = "renesas,usbhs-r9a07g043",
> >> 	             "renesas,rzg2l-usbhs",
> >> 			 "renesas,rza2-usbhs";
> >>
> >> Or
> >>
> >> 	compatible = "renesas,usbhs-r9a07g043",
> >> 			 "renesas,rza2-usbhs";
> >>
> >>
> >> The former consumes less memory compared to the later.
> >>
> >> As later requires, 3 platform structures for rz/g2l, rz/v2l and
> >> rz/gul whereas the former requires just 1.
> >
> > Another way is using RZ/G2L SoC fallback compatible for both RZ/V2L
> > and RZ/Five varients
> >
> > 	compatible = "renesas,usbhs-r9a07g043",
> > 	             "renesas, usbhs-r9a07g044",
> 
> How does it solve anything? Nothing binds to this.

This will solve all the issues.

The usbhs-r9a07g043 IP is derived from usbhs-r9a07g044 that is derived from rza2-usbhs.

> 
> > 			 "renesas,rza2-usbhs";
> >
> > This will fit into all ABI combinations with optimized memory usage in driver related to platform
> structure.
> >
> > old DTB + old kernel will have 16 pipe buffers old DTB + new kernel
> > will have 9 pipe buffers New DTB + old kernel will have 16 pipe
> > buffers New DTB + new kernel will have 9 pipe buffers
> 
> Maybe just drop incorrect generic compatibles since you are breaking users? You did not provide any
> rationale against my arguments.

The above model does not break any users. Can you please give an example which breaks the users?


Cheers,
Biju

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

* Re: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}: Update usbhs family compatible
  2024-03-10  8:16                     ` Biju Das
@ 2024-03-10  8:39                       ` Krzysztof Kozlowski
  2024-03-10  9:59                         ` Biju Das
  0 siblings, 1 reply; 25+ messages in thread
From: Krzysztof Kozlowski @ 2024-03-10  8:39 UTC (permalink / raw)
  To: Biju Das, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Geert Uytterhoeven, Magnus Damm, linux-renesas-soc, devicetree,
	Prabhakar Mahadev Lad, biju.das.au

On 10/03/2024 09:16, Biju Das wrote:
> Hi Krzysztof Kozlowski,
> 
>> -----Original Message-----
>> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>> Sent: Sunday, March 10, 2024 8:06 AM
>> Subject: Re: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}: Update usbhs family compatible
>>
>> On 10/03/2024 08:57, Biju Das wrote:
>>>>>>> old DTB + old kernel will have 16 pipe buffers old DTB + newer
>>>>>>> kernel will have 9 pipe buffers.
>>>>>>> New DTB + new kernel will have 9 pipe buffer.
>>>>>>
>>>>>> You missed new DTB and old kernel. This breaks all users of DTS.
>>>>>> That's the entire point of your broken generic compatibles which you did not address.
>>>>>
>>>>> As per my knowledge, there is no user in RZ/G2L is using new DTB and old kernel.
>>>>> So, it is safe.
>>>>
>>>> If there is a user for such change, we could use
>>>>
>>>> 	compatible = "renesas,usbhs-r9a07g043",
>>>> 	             "renesas,rzg2l-usbhs",
>>>> 			 "renesas,rza2-usbhs";
>>>>
>>>> Or
>>>>
>>>> 	compatible = "renesas,usbhs-r9a07g043",
>>>> 			 "renesas,rza2-usbhs";
>>>>
>>>>
>>>> The former consumes less memory compared to the later.
>>>>
>>>> As later requires, 3 platform structures for rz/g2l, rz/v2l and
>>>> rz/gul whereas the former requires just 1.
>>>
>>> Another way is using RZ/G2L SoC fallback compatible for both RZ/V2L
>>> and RZ/Five varients
>>>
>>> 	compatible = "renesas,usbhs-r9a07g043",
>>> 	             "renesas, usbhs-r9a07g044",
>>
>> How does it solve anything? Nothing binds to this.
> 
> This will solve all the issues.

That's not really the answer, but I see you plan to keep old fallback.
So this means old fallback is correct and entire patchset does not make
sense.

This is confusing.

Best regards,
Krzysztof


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

* RE: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}: Update usbhs family compatible
  2024-03-10  8:39                       ` Krzysztof Kozlowski
@ 2024-03-10  9:59                         ` Biju Das
  0 siblings, 0 replies; 25+ messages in thread
From: Biju Das @ 2024-03-10  9:59 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Geert Uytterhoeven, Magnus Damm, linux-renesas-soc, devicetree,
	Prabhakar Mahadev Lad, biju.das.au

Hi Krzysztof Kozlowski,

> -----Original Message-----
> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Sent: Sunday, March 10, 2024 8:40 AM
> Subject: Re: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}: Update usbhs family compatible
> 
> On 10/03/2024 09:16, Biju Das wrote:
> > Hi Krzysztof Kozlowski,
> >
> >> -----Original Message-----
> >> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> >> Sent: Sunday, March 10, 2024 8:06 AM
> >> Subject: Re: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}:
> >> Update usbhs family compatible
> >>
> >> On 10/03/2024 08:57, Biju Das wrote:
> >>>>>>> old DTB + old kernel will have 16 pipe buffers old DTB + newer
> >>>>>>> kernel will have 9 pipe buffers.
> >>>>>>> New DTB + new kernel will have 9 pipe buffer.
> >>>>>>
> >>>>>> You missed new DTB and old kernel. This breaks all users of DTS.
> >>>>>> That's the entire point of your broken generic compatibles which you did not address.
> >>>>>
> >>>>> As per my knowledge, there is no user in RZ/G2L is using new DTB and old kernel.
> >>>>> So, it is safe.
> >>>>
> >>>> If there is a user for such change, we could use
> >>>>
> >>>> 	compatible = "renesas,usbhs-r9a07g043",
> >>>> 	             "renesas,rzg2l-usbhs",
> >>>> 			 "renesas,rza2-usbhs";
> >>>>
> >>>> Or
> >>>>
> >>>> 	compatible = "renesas,usbhs-r9a07g043",
> >>>> 			 "renesas,rza2-usbhs";
> >>>>
> >>>>
> >>>> The former consumes less memory compared to the later.
> >>>>
> >>>> As later requires, 3 platform structures for rz/g2l, rz/v2l and
> >>>> rz/gul whereas the former requires just 1.
> >>>
> >>> Another way is using RZ/G2L SoC fallback compatible for both RZ/V2L
> >>> and RZ/Five varients
> >>>
> >>> 	compatible = "renesas,usbhs-r9a07g043",
> >>> 	             "renesas, usbhs-r9a07g044",
> >>
> >> How does it solve anything? Nothing binds to this.
> >
> > This will solve all the issues.
> 
> That's not really the answer, but I see you plan to keep old fallback.

Yes, To avoid the ABI breakage as per the use case you mentioned for new dtb + old kernel

> So this means old fallback is correct and entire patchset does not make sense.
> 
> This is confusing.

I need to correct the binding/driver code as per the below for avoiding all possible ABI breakage
and at the same time optimize the memory usage in driver as all(r9a07g0{43,44,54} belong
to the same RZ/G2L family SoCs.


	compatible = "renesas,usbhs-r9a07g043",
	             "renesas,usbhs-r9a07g044",
			 "renesas,rza2-usbhs";

Or

	compatible = "renesas,usbhs-r9a07g043",
	             "renesas,rzg2l-usbhs",
			 "renesas,rza2-usbhs";


Cheers,
Biju




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

* Re: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}: Update usbhs family compatible
  2024-03-09 13:30           ` Krzysztof Kozlowski
  2024-03-09 15:43             ` Biju Das
@ 2024-03-11  9:03             ` Geert Uytterhoeven
  2024-03-12 10:58               ` Krzysztof Kozlowski
  1 sibling, 1 reply; 25+ messages in thread
From: Geert Uytterhoeven @ 2024-03-11  9:03 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Biju Das, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Magnus Damm, linux-renesas-soc, devicetree,
	Prabhakar Mahadev Lad, biju.das.au

Hi Krzysztof,

On Sat, Mar 9, 2024 at 2:30 PM Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
> On 09/03/2024 13:32, Biju Das wrote:
> >> -----Original Message-----
> >> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> >>>> This looks like ABI break and commit msg is quite vague about it.
> >>>
> >>> OK, Will update the commit message as driver is taking care of the
> >>> backward compatibility.
> >>
> >> Ah, I was not precise here, you should consider the impact this is on DTB used on other kernels. You
> >> guys should really stop using imprecise/incorrect generic fallbacks and, since it is usually tricky to
> >> know which fallback is correct or not, you should stop using them at all.
> >
> > There will be driver change to handle SoC specific compatible.
> >
> > So ,
> >
> > old DTB + old kernel will have 16 pipe buffers
> > old DTB + newer kernel will have 9 pipe buffers.
> > New DTB + new kernel will have 9 pipe buffer.
>
> You missed new DTB and old kernel. This breaks all users of DTS. That's
> the entire point of your broken generic compatibles which you did not
> address.

Doesn't DT guarantee only forward compatibility?

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

* Re: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}: Update usbhs family compatible
  2024-03-11  9:03             ` Geert Uytterhoeven
@ 2024-03-12 10:58               ` Krzysztof Kozlowski
  2024-03-12 18:13                 ` Biju Das
  0 siblings, 1 reply; 25+ messages in thread
From: Krzysztof Kozlowski @ 2024-03-12 10:58 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Biju Das, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Magnus Damm, linux-renesas-soc, devicetree,
	Prabhakar Mahadev Lad, biju.das.au

On 11/03/2024 10:03, Geert Uytterhoeven wrote:
> Hi Krzysztof,
> 
> On Sat, Mar 9, 2024 at 2:30 PM Krzysztof Kozlowski
> <krzysztof.kozlowski@linaro.org> wrote:
>> On 09/03/2024 13:32, Biju Das wrote:
>>>> -----Original Message-----
>>>> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>>>>> This looks like ABI break and commit msg is quite vague about it.
>>>>>
>>>>> OK, Will update the commit message as driver is taking care of the
>>>>> backward compatibility.
>>>>
>>>> Ah, I was not precise here, you should consider the impact this is on DTB used on other kernels. You
>>>> guys should really stop using imprecise/incorrect generic fallbacks and, since it is usually tricky to
>>>> know which fallback is correct or not, you should stop using them at all.
>>>
>>> There will be driver change to handle SoC specific compatible.
>>>
>>> So ,
>>>
>>> old DTB + old kernel will have 16 pipe buffers
>>> old DTB + newer kernel will have 9 pipe buffers.
>>> New DTB + new kernel will have 9 pipe buffer.
>>
>> You missed new DTB and old kernel. This breaks all users of DTS. That's
>> the entire point of your broken generic compatibles which you did not
>> address.
> 
> Doesn't DT guarantee only forward compatibility?

If by DT you mean DTS, then:
The DTS is exported from kernel since long time and (might be|is used)
in other projects, like recently in U-Boot. Therefore dropping
compatible from DTS, which is used for binding, might affect these 3rd
party projects.

While you are right that we do not guarantee such compatibility, we also
might want to have it.

Best regards,
Krzysztof


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

* RE: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}: Update usbhs family compatible
  2024-03-12 10:58               ` Krzysztof Kozlowski
@ 2024-03-12 18:13                 ` Biju Das
  0 siblings, 0 replies; 25+ messages in thread
From: Biju Das @ 2024-03-12 18:13 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Geert Uytterhoeven
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Magnus Damm, linux-renesas-soc, devicetree,
	Prabhakar Mahadev Lad, biju.das.au

Hi Krzysztof Kozlowski,

> -----Original Message-----
> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Sent: Tuesday, March 12, 2024 10:58 AM
> Subject: Re: [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}: Update usbhs family compatible
> 
> On 11/03/2024 10:03, Geert Uytterhoeven wrote:
> > Hi Krzysztof,
> >
> > On Sat, Mar 9, 2024 at 2:30 PM Krzysztof Kozlowski
> > <krzysztof.kozlowski@linaro.org> wrote:
> >> On 09/03/2024 13:32, Biju Das wrote:
> >>>> -----Original Message-----
> >>>> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> >>>>>> This looks like ABI break and commit msg is quite vague about it.
> >>>>>
> >>>>> OK, Will update the commit message as driver is taking care of the
> >>>>> backward compatibility.
> >>>>
> >>>> Ah, I was not precise here, you should consider the impact this is
> >>>> on DTB used on other kernels. You guys should really stop using
> >>>> imprecise/incorrect generic fallbacks and, since it is usually tricky to know which fallback is
> correct or not, you should stop using them at all.
> >>>
> >>> There will be driver change to handle SoC specific compatible.
> >>>
> >>> So ,
> >>>
> >>> old DTB + old kernel will have 16 pipe buffers old DTB + newer
> >>> kernel will have 9 pipe buffers.
> >>> New DTB + new kernel will have 9 pipe buffer.
> >>
> >> You missed new DTB and old kernel. This breaks all users of DTS.
> >> That's the entire point of your broken generic compatibles which you
> >> did not address.
> >
> > Doesn't DT guarantee only forward compatibility?
> 
> If by DT you mean DTS, then:
> The DTS is exported from kernel since long time and (might be|is used) in other projects, like recently
> in U-Boot. Therefore dropping compatible from DTS, which is used for binding, might affect these 3rd
> party projects.
> 
> While you are right that we do not guarantee such compatibility, we also might want to have it.

If that is the case, the I would like to retain renesas,rzg2l-usbhs for grouping similar RZ/G2L
alike SoCs as in [1]. In the driver, I will use SoC specific compatible to avoid ABI breakage
related to old DTB  + new kernel.

[1] https://patchwork.kernel.org/project/linux-renesas-soc/patch/20240308180919.6603-5-biju.das.jz@bp.renesas.com/

Cheers,
Biju

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

end of thread, other threads:[~2024-03-12 18:13 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-08 18:09 [PATCH 0/4] Fix USB pipe configuration for RZ/G2L Biju Das
2024-03-08 18:09 ` [PATCH 1/4] dt-bindings: usb: renesas,usbhs: Document RZ/G2L family compatible Biju Das
2024-03-09 12:07   ` Krzysztof Kozlowski
2024-03-08 18:09 ` [PATCH 2/4] usb: renesas_usbhs: Update usbhs pipe configuration for RZ/G2L family Biju Das
2024-03-08 19:39   ` Geert Uytterhoeven
2024-03-09 10:20     ` Biju Das
2024-03-08 18:09 ` [PATCH 3/4] usb: renesas_usbhs: Remove trailing comma in the terminator entry for OF table Biju Das
2024-03-08 19:40   ` Geert Uytterhoeven
2024-03-08 18:09 ` [PATCH 4/4] arm64: dts: renesas: r9a07g0{43,44,54}: Update usbhs family compatible Biju Das
2024-03-09 12:08   ` Krzysztof Kozlowski
2024-03-09 12:14     ` Biju Das
2024-03-09 12:25       ` Krzysztof Kozlowski
2024-03-09 12:32         ` Biju Das
2024-03-09 13:30           ` Krzysztof Kozlowski
2024-03-09 15:43             ` Biju Das
2024-03-09 15:53               ` Biju Das
2024-03-10  7:57                 ` Biju Das
2024-03-10  8:06                   ` Krzysztof Kozlowski
2024-03-10  8:16                     ` Biju Das
2024-03-10  8:39                       ` Krzysztof Kozlowski
2024-03-10  9:59                         ` Biju Das
2024-03-10  8:03               ` Krzysztof Kozlowski
2024-03-11  9:03             ` Geert Uytterhoeven
2024-03-12 10:58               ` Krzysztof Kozlowski
2024-03-12 18:13                 ` Biju Das

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