Skip to contentSkip to conversation

tty: serial: meson: Fix the compile link error reported by kernel test robot

PATCH Superseded Yu Tu 5 participants 12 messages Feb 28, 2022 – Mar 3, 2022

Subsystems (2)
lore
Share & tools
lore

Yu Tu

author
#0 lore raw

PATCH v3 1/1 tty: serial: meson: Fix the compile link error reported by kernel test robot

Describes the calculation of the UART baud rate clock using a clock frame. Forgot to add in Kconfig kernel test Robot compilation error due to COMMON_CLK dependency.

Fixes ("tty: serial:meson: Describes the calculation of the UART baud rate clock using a clock frame“)
---
 drivers/tty/serial/Kconfig      |  1 +
 drivers/tty/serial/meson_uart.c | 37 +++++++++++++++++++++++----------
 2 files changed, 27 insertions(+), 11 deletions(-)
drivers/tty/serial/Kconfig +1 -0
index e952ec5c7a7c..a0f2b82fc18b 100644
@@ -200,6 +200,7 @@ config SERIAL_KGDB_NMI
 config SERIAL_MESON
 	tristate "Meson serial port support"
 	depends on ARCH_MESON || COMPILE_TEST
+	depends on COMMON_CLK
 	select SERIAL_CORE
 	help
 	  This enables the driver for the on-chip UARTs of the Amlogic
drivers/tty/serial/meson_uart.c +26 -11
index bf6be5468aaf..972f210f3492 100644
@@ -780,28 +780,37 @@ static int meson_uart_probe(struct platform_device *pdev)
 		return ret;
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq < 0)
-		return irq;
+	if (irq < 0) {
+		ret = irq;
+		goto err_out_clk_disable;
+	}
 
 	of_property_read_u32(pdev->dev.of_node, "fifo-size", &fifosize);
 
 	if (meson_ports[pdev->id]) {
 		dev_err(&pdev->dev, "port %d already allocated\n", pdev->id);
-		return -EBUSY;
+		ret = -EBUSY;
+		goto err_out_clk_disable;
 	}
 
 	port = devm_kzalloc(&pdev->dev, sizeof(struct uart_port), GFP_KERNEL);
-	if (!port)
-		return -ENOMEM;
+	if (!port) {
+		ret = -ENOMEM;
+		goto err_out_clk_disable;
+	}
 
 	port->membase = devm_ioremap_resource(&pdev->dev, res_mem);
-	if (IS_ERR(port->membase))
-		return PTR_ERR(port->membase);
+	if (IS_ERR(port->membase)) {
+		ret = PTR_ERR(port->membase);
+		goto err_out_clk_disable;
+	}
 
 	private_data = devm_kzalloc(&pdev->dev, sizeof(*private_data),
 				    GFP_KERNEL);
-	if (!private_data)
-		return -ENOMEM;
+	if (!private_data) {
+		ret = -ENOMEM;
+		goto err_out_clk_disable;
+	}
 
 	if (device_get_match_data(&pdev->dev))
 		private_data->use_xtal_clk = true;
@@ -822,7 +831,7 @@ static int meson_uart_probe(struct platform_device *pdev)
 
 	ret = meson_uart_probe_clocks(port);
 	if (ret)
-		return ret;
+		goto err_out_clk_disable;
 
 	meson_ports[pdev->id] = port;
 	platform_set_drvdata(pdev, port);
@@ -831,9 +840,15 @@ static int meson_uart_probe(struct platform_device *pdev)
 	meson_uart_reset(port);
 
 	ret = uart_add_one_port(&meson_uart_driver, port);
-	if (ret)
+	if (ret) {
 		meson_ports[pdev->id] = NULL;
+		goto err_out_clk_disable;
+	}
+
+	return 0;
 
+err_out_clk_disable:
+	clk_disable_unprepare(pclk);
 	return ret;
 }
 

base-commit: c2faf737abfb10f88f2d2612d573e9edc3c42c37

Signature · 1 line
2.33.1
#1 lore raw

Hi,

Quoted 5 lines · Yu Tu

Describes the calculation of the UART baud rate clock using a clock frame. Forgot to add in Kconfig kernel test Robot compilation error due to COMMON_CLK dependency.

Fixes ("tty: serial:meson: Describes the calculation of the UART baud rate clock using a clock frame“)

As I already replied on V2 of this patch, you're invited to apply these fixes directly on the next version of your "Use CCF to describe the UART baud rate clock" patchset and not as a separate patch.

Thanks,
Neil

Quoted 99 lines
---
  drivers/tty/serial/Kconfig      |  1 +
  drivers/tty/serial/meson_uart.c | 37 +++++++++++++++++++++++----------
  2 files changed, 27 insertions(+), 11 deletions(-)
drivers/tty/serial/Kconfig +1 -0
index e952ec5c7a7c..a0f2b82fc18b 100644
@@ -200,6 +200,7 @@ config SERIAL_KGDB_NMI
  config SERIAL_MESON
  	tristate "Meson serial port support"
  	depends on ARCH_MESON || COMPILE_TEST
+	depends on COMMON_CLK
  	select SERIAL_CORE
  	help
  	  This enables the driver for the on-chip UARTs of the Amlogic
drivers/tty/serial/meson_uart.c +26 -11
index bf6be5468aaf..972f210f3492 100644
@@ -780,28 +780,37 @@ static int meson_uart_probe(struct platform_device *pdev)
  		return ret;
 
  	irq = platform_get_irq(pdev, 0);
-	if (irq < 0)
-		return irq;
+	if (irq < 0) {
+		ret = irq;
+		goto err_out_clk_disable;
+	}
 
  	of_property_read_u32(pdev->dev.of_node, "fifo-size", &fifosize);
 
  	if (meson_ports[pdev->id]) {
  		dev_err(&pdev->dev, "port %d already allocated\n", pdev->id);
-		return -EBUSY;
+		ret = -EBUSY;
+		goto err_out_clk_disable;
  	}
 
  	port = devm_kzalloc(&pdev->dev, sizeof(struct uart_port), GFP_KERNEL);
-	if (!port)
-		return -ENOMEM;
+	if (!port) {
+		ret = -ENOMEM;
+		goto err_out_clk_disable;
+	}
 
  	port->membase = devm_ioremap_resource(&pdev->dev, res_mem);
-	if (IS_ERR(port->membase))
-		return PTR_ERR(port->membase);
+	if (IS_ERR(port->membase)) {
+		ret = PTR_ERR(port->membase);
+		goto err_out_clk_disable;
+	}
 
  	private_data = devm_kzalloc(&pdev->dev, sizeof(*private_data),
  				    GFP_KERNEL);
-	if (!private_data)
-		return -ENOMEM;
+	if (!private_data) {
+		ret = -ENOMEM;
+		goto err_out_clk_disable;
+	}
 
  	if (device_get_match_data(&pdev->dev))
  		private_data->use_xtal_clk = true;
@@ -822,7 +831,7 @@ static int meson_uart_probe(struct platform_device *pdev)
 
  	ret = meson_uart_probe_clocks(port);
  	if (ret)
-		return ret;
+		goto err_out_clk_disable;
 
  	meson_ports[pdev->id] = port;
  	platform_set_drvdata(pdev, port);
@@ -831,9 +840,15 @@ static int meson_uart_probe(struct platform_device *pdev)
  	meson_uart_reset(port);
 
  	ret = uart_add_one_port(&meson_uart_driver, port);
-	if (ret)
+	if (ret) {
  		meson_ports[pdev->id] = NULL;
+		goto err_out_clk_disable;
+	}
+
+	return 0;
 
+err_out_clk_disable:
+	clk_disable_unprepare(pclk);
  	return ret;
  }
 

base-commit: c2faf737abfb10f88f2d2612d573e9edc3c42c37

author
#2 lore raw

Hi,

Quoted 9 lines · Neil Armstrong

[ EXTERNAL EMAIL ]

Hi,

Quoted 4 lines · Yu Tu

Describes the calculation of the UART baud rate clock using a clock frame. Forgot to add in Kconfig kernel test Robot compilation error due to COMMON_CLK dependency.

Quoted 6 lines
Quoted 1 line
Fixes ("tty: serial:meson: Describes the calculation of the UART baud rate clock using a clock frame“)

As I already replied on V2 of this patch, you're invited to apply these fixes directly on the next version of your "Use CCF to describe the UART baud rate clock" patchset and not as a separate patch.

Sorry, I don't understand what you mean. Could you be more specific?

Quoted 94 lines

Thanks,
Neil

Quoted 90 lines

---
  drivers/tty/serial/Kconfig      |  1 + drivers/tty/serial/meson_uart.c | 37 +++++++++++++++++++++++----------

  2 files changed, 27 insertions(+), 11 deletions(-)
drivers/tty/serial/Kconfig +0 -0
index e952ec5c7a7c..a0f2b82fc18b 100644
@@ -200,6 +200,7 @@ config SERIAL_KGDB_NMI

  config SERIAL_MESON
      tristate "Meson serial port support"
      depends on ARCH_MESON || COMPILE_TEST
+    depends on COMMON_CLK
      select SERIAL_CORE
      help
        This enables the driver for the on-chip UARTs of the Amlogic

drivers/tty/serial/meson_uart.c +26 -11
index bf6be5468aaf..972f210f3492 100644
@@ -780,28 +780,37 @@ static int meson_uart_probe(struct 
 platform_device *pdev)
           return ret;
       irq = platform_get_irq(pdev, 0);
-    if (irq < 0)
-        return irq;
+    if (irq < 0) {
+        ret = irq;
+        goto err_out_clk_disable;
+    }
       of_property_read_u32(pdev->dev.of_node, "fifo-size", &fifosize);
       if (meson_ports[pdev->id]) {
           dev_err(&pdev->dev, "port %d already allocated\n", pdev->id);
-        return -EBUSY;
+        ret = -EBUSY;
+        goto err_out_clk_disable;
       }
       port = devm_kzalloc(&pdev->dev, sizeof(struct uart_port), GFP_KERNEL);
-    if (!port)
-        return -ENOMEM;
+    if (!port) {
+        ret = -ENOMEM;
+        goto err_out_clk_disable;
+    }
       port->membase = devm_ioremap_resource(&pdev->dev, res_mem);
-    if (IS_ERR(port->membase))
-        return PTR_ERR(port->membase);
+    if (IS_ERR(port->membase)) {
+        ret = PTR_ERR(port->membase);
+        goto err_out_clk_disable;
+    }
       private_data = devm_kzalloc(&pdev->dev, sizeof(*private_data),
                       GFP_KERNEL);
-    if (!private_data)
-        return -ENOMEM;
+    if (!private_data) {
+        ret = -ENOMEM;
+        goto err_out_clk_disable;
+    }
       if (device_get_match_data(&pdev->dev))
           private_data->use_xtal_clk = true;
@@ -822,7 +831,7 @@ static int meson_uart_probe(struct platform_device 
 *pdev)
       ret = meson_uart_probe_clocks(port);
       if (ret)
-        return ret;
+        goto err_out_clk_disable;
       meson_ports[pdev->id] = port;
       platform_set_drvdata(pdev, port);
@@ -831,9 +840,15 @@ static int meson_uart_probe(struct 
 platform_device *pdev)
       meson_uart_reset(port);
       ret = uart_add_one_port(&meson_uart_driver, port);
-    if (ret)
+    if (ret) {
           meson_ports[pdev->id] = NULL;
+        goto err_out_clk_disable;
+    }
+
+    return 0;
+err_out_clk_disable:
+    clk_disable_unprepare(pclk);
       return ret;
   }
 

base-commit: c2faf737abfb10f88f2d2612d573e9edc3c42c37

#3 lore raw
In reply to Neil Armstrong
Quoted 7 lines · Neil Armstrong

Hi,

Quoted 4 lines · Yu Tu

Describes the calculation of the UART baud rate clock using a clock frame. Forgot to add in Kconfig kernel test Robot compilation error due to COMMON_CLK dependency.

Quoted 5 lines
Quoted 1 line
Fixes ("tty: serial:meson: Describes the calculation of the UART baud rate clock using a clock frame“)

As I already replied on V2 of this patch, you're invited to apply these fixes directly on the next version of your "Use CCF to describe the UART baud rate clock" patchset and not as a separate patch.

No, this is broken in linux-next now as the path listed here is in my tree right now.

I need a fix for it, or I can revert the original.

thanks,

greg k-h

#4 lore raw

Hi Greg,

Le 28/02/2022 à 22:21, Greg Kroah-Hartman a écrit :

Quoted 8 lines · Neil Armstrong
Quoted 7 lines

Hi,

Quoted 4 lines · Yu Tu

Describes the calculation of the UART baud rate clock using a clock frame. Forgot to add in Kconfig kernel test Robot compilation error due to COMMON_CLK dependency.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Fixes ("tty: serial:meson: Describes the calculation of the UART baud rate clock using a clock frame“)

As I already replied on V2 of this patch, you're invited to apply these fixes directly on the next version of your "Use CCF to describe the UART baud rate clock" patchset and not as a separate patch.

No, this is broken in linux-next now as the path listed here is in my tree right now.

Oh, I wasn't aware you took this patchset.

Quoted 2 lines

I need a fix for it, or I can revert the original.

Please revert the whole patchset, it's not ready yet, neither fully reviewed ands buggy on old SoCs.

Thanks,
Neil

Quoted 4 lines

thanks,

greg k-h

author
#5 lore raw

Hi Neil,

Quoted 22 lines · Neil Armstrong

[ EXTERNAL EMAIL ]

Hi Greg,

Le 28/02/2022 à 22:21, Greg Kroah-Hartman a écrit :

Quoted 8 lines · Neil Armstrong
Quoted 7 lines

Hi,

Quoted 4 lines · Yu Tu

Describes the calculation of the UART baud rate clock using a clock frame. Forgot to add in Kconfig kernel test Robot compilation error due to COMMON_CLK dependency.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Fixes ("tty: serial:meson: Describes the calculation of the UART baud rate clock using a clock frame“)

As I already replied on V2 of this patch, you're invited to apply these fixes directly on the next version of your "Use CCF to describe the UART baud rate clock" patchset and not as a separate patch.

No, this is broken in linux-next now as the path listed here is in my tree right now.

Quoted 7 lines

Oh, I wasn't aware you took this patchset.

Quoted 2 lines

I need a fix for it, or I can revert the original.

Please revert the whole patchset, it's not ready yet, neither fully reviewed ands buggy on old SoCs.

I have tested that there is no problem with G12A and S4 boards. Can I merge them first and fix them later if there is any problem?

Quoted 9 lines

Thanks,
Neil

Quoted 4 lines

thanks,

greg k-h

reviewer
#6 lore raw
Quoted 28 lines · Yu Tu

Hi Neil,

Quoted 25 lines · Neil Armstrong

[ EXTERNAL EMAIL ]
Hi Greg,
Le 28/02/2022 à 22:21, Greg Kroah-Hartman a écrit :

Quoted 11 lines · Neil Armstrong
Quoted 10 lines

Hi,

Quoted 6 lines · Yu Tu

Describes the calculation of the UART baud rate clock using a clock frame. Forgot to add in Kconfig kernel test Robot compilation error due to COMMON_CLK dependency.

Fixes: ("tty: serial:meson: Describes the calculation of the UART baud rate clock using a clock frame“)

Quoted 8 lines
Quoted 5 lines

As I already replied on V2 of this patch, you're invited to apply these fixes directly
on the next version of your "Use CCF to describe the UART baud rate clock" patchset
and not as a separate patch.

No, this is broken in linux-next now as the path listed here is in my tree right now.

Oh, I wasn't aware you took this patchset.

Quoted 1 line
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

I need a fix for it, or I can revert the original.

Please revert the whole patchset, it's not ready yet, neither fully reviewed ands buggy
on old SoCs.

I have tested that there is no problem with G12A and S4 boards. Can I merge them first and fix them later if there is any problem?

That's called a regression. That is not how we do things in mainline There is still a lot of people using GXL boards. Those are still sold even.

Quoted 8 lines
Quoted 8 lines

Thanks,
Neil

Quoted 4 lines

thanks,

greg k-h

#7 lore raw
In reply to Neil Armstrong
Quoted 20 lines · Neil Armstrong

Hi Greg,

Le 28/02/2022 à 22:21, Greg Kroah-Hartman a écrit :

Quoted 8 lines · Neil Armstrong
Quoted 7 lines

Hi,

Quoted 4 lines · Yu Tu

Describes the calculation of the UART baud rate clock using a clock frame. Forgot to add in Kconfig kernel test Robot compilation error due to COMMON_CLK dependency.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Fixes ("tty: serial:meson: Describes the calculation of the UART baud rate clock using a clock frame“)

As I already replied on V2 of this patch, you're invited to apply these fixes directly on the next version of your "Use CCF to describe the UART baud rate clock" patchset and not as a separate patch.

No, this is broken in linux-next now as the path listed here is in my tree right now.

Quoted 7 lines

Oh, I wasn't aware you took this patchset.

Quoted 2 lines

I need a fix for it, or I can revert the original.

Please revert the whole patchset, it's not ready yet, neither fully reviewed ands buggy on old SoCs.

Yes, will go do so now, thanks for letting me know and sorry about all of this.

greg k-h

#8 lore raw

Hi,

Quoted 24 lines · Greg Kroah-Hartman
Quoted 23 lines · Neil Armstrong

Hi Greg,

Le 28/02/2022 à 22:21, Greg Kroah-Hartman a écrit :

Quoted 8 lines · Neil Armstrong
Quoted 7 lines

Hi,

Quoted 4 lines · Yu Tu

Describes the calculation of the UART baud rate clock using a clock frame. Forgot to add in Kconfig kernel test Robot compilation error due to COMMON_CLK dependency.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Fixes ("tty: serial:meson: Describes the calculation of the UART baud rate clock using a clock frame“)

As I already replied on V2 of this patch, you're invited to apply these fixes directly on the next version of your "Use CCF to describe the UART baud rate clock" patchset and not as a separate patch.

No, this is broken in linux-next now as the path listed here is in my tree right now.

Oh, I wasn't aware you took this patchset.

Quoted 1 line
Quoted 7 lines
Quoted 4 lines
Quoted 1 line

I need a fix for it, or I can revert the original.

Please revert the whole patchset, it's not ready yet, neither fully reviewed ands buggy on old SoCs.

Yes, will go do so now, thanks for letting me know and sorry about all of this.

Thanks, we'll make sure it won't happen again and will work toawrds a working solution

Neil

Quoted 2 lines

greg k-h

_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic

#9 lore raw
In reply to Yu Tu
Quoted 18 lines · Yu Tu

Describes the calculation of the UART baud rate clock using a clock frame. Forgot to add in Kconfig kernel test Robot compilation error due to COMMON_CLK dependency.

Fixes ("tty: serial:meson: Describes the calculation of the UART baud rate clock using a clock frame“)
---
 drivers/tty/serial/Kconfig      |  1 +
 drivers/tty/serial/meson_uart.c | 37 +++++++++++++++++++++++----------
 2 files changed, 27 insertions(+), 11 deletions(-)
drivers/tty/serial/Kconfig +0 -0
index e952ec5c7a7c..a0f2b82fc18b 100644

drivers/tty/serial/Kconfig config SERIAL_KGDB_NMI · line 206

Quoted 7 lines
drivers/tty/serial/Kconfig +1 -0
@@ -200,6 +200,7 @@ config SERIAL_KGDB_NMI
 config SERIAL_MESON
 	tristate "Meson serial port support"
 	depends on ARCH_MESON || COMPILE_TEST
+	depends on COMMON_CLK
 	select SERIAL_CORE
 	help
 	  This enables the driver for the on-chip UARTs of the Amlogic

This is a link issue. The rest is an unrelated error handling fix. It should really be sent as two patches.

regards,
dan carpenter

#10 lore raw
Quoted 14 lines · Dan Carpenter
Quoted 13 lines · Yu Tu

Describes the calculation of the UART baud rate clock using a clock frame. Forgot to add in Kconfig kernel test Robot compilation error due to COMMON_CLK dependency.

Fixes ("tty: serial:meson: Describes the calculation of the UART baud rate clock using a clock frame“)
---
 drivers/tty/serial/Kconfig      |  1 +
 drivers/tty/serial/meson_uart.c | 37 +++++++++++++++++++++++----------
 2 files changed, 27 insertions(+), 11 deletions(-)
Quoted 16 lines

drivers/tty/serial/Kconfig config SERIAL_KGDB_NMI · line 206

Quoted 12 lines
drivers/tty/serial/Kconfig +1 -0
index e952ec5c7a7c..a0f2b82fc18b 100644
@@ -200,6 +200,7 @@ config SERIAL_KGDB_NMI
 config SERIAL_MESON
 	tristate "Meson serial port support"
 	depends on ARCH_MESON || COMPILE_TEST
+	depends on COMMON_CLK
 	select SERIAL_CORE
 	help
 	  This enables the driver for the on-chip UARTs of the Amlogic

This is a link issue. The rest is an unrelated error handling fix. It should really be sent as two patches.

I'll take the first version of this patch, which just did this portion, and the rest can be an independant change.

thanks,

greg k-h

author
#11 lore raw

Hi greg and dan,
Thank you very much for your reply. I will make a separate submission
as you suggested to fix Dan's suggestion.

Quoted 41 lines · Greg Kroah-Hartman

[ EXTERNAL EMAIL ]

Quoted 14 lines · Dan Carpenter
Quoted 13 lines · Yu Tu

Describes the calculation of the UART baud rate clock using a clock frame. Forgot to add in Kconfig kernel test Robot compilation error due to COMMON_CLK dependency.

Fixes ("tty: serial:meson: Describes the calculation of the UART baud rate clock using a clock frame“)
---
  drivers/tty/serial/Kconfig      |  1 +
  drivers/tty/serial/meson_uart.c | 37 +++++++++++++++++++++++----------
  2 files changed, 27 insertions(+), 11 deletions(-)
Quoted 16 lines

drivers/tty/serial/Kconfig config SERIAL_KGDB_NMI · line 206

Quoted 12 lines
drivers/tty/serial/Kconfig +1 -0
index e952ec5c7a7c..a0f2b82fc18b 100644
@@ -200,6 +200,7 @@ config SERIAL_KGDB_NMI
  config SERIAL_MESON
  	tristate "Meson serial port support"
  	depends on ARCH_MESON || COMPILE_TEST
+	depends on COMMON_CLK
  	select SERIAL_CORE
  	help
  	  This enables the driver for the on-chip UARTs of the Amlogic

This is a link issue. The rest is an unrelated error handling fix. It should really be sent as two patches.

I'll take the first version of this patch, which just did this portion, and the rest can be an independant change.

thanks,

greg k-h