Skip to contentSkip to conversation

thermal: qoriq: Add clock operations

PATCH In review [email protected] 4 participants 25 messages Jul 30, 2019 – Aug 29, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/5 thermal: qoriq: Add clock operations

From: Anson Huang <[email protected]>

Some platforms like i.MX8MQ has clock control for this module, need to add clock operations to make sure the driver is working properly.

---
Changes since V2:
- move this patch as first patch in the series;
- add clock disable handling in error path of probe.

---
 drivers/thermal/qoriq_thermal.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
drivers/thermal/qoriq_thermal.c +23 -0
index 7b36493..2893947 100644
@@ -2,6 +2,7 @@
 //
 // Copyright 2016 Freescale Semiconductor, Inc.
 
+#include <linux/clk.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/err.h>
@@ -72,6 +73,7 @@ struct qoriq_sensor {
 
 struct qoriq_tmu_data {
 	struct qoriq_tmu_regs __iomem *regs;
+	struct clk *clk;
 	bool little_endian;
 	struct qoriq_sensor	*sensor[SITES_MAX];
 };
@@ -209,6 +211,16 @@ static int qoriq_tmu_probe(struct platform_device *pdev)
 		goto err_iomap;
 	}
 
+	data->clk = devm_clk_get_optional(&pdev->dev, NULL);
+	if (IS_ERR(data->clk))
+		return PTR_ERR(data->clk);
+
+	ret = clk_prepare_enable(data->clk);
+	if (ret) {
+		dev_err(&pdev->dev, "Failed to enable clock\n");
+		return ret;
+	}
+
 	qoriq_tmu_init_device(data);	/* TMU initialization */
 
 	ret = qoriq_tmu_calibration(pdev);	/* TMU calibration */
@@ -225,6 +237,7 @@ static int qoriq_tmu_probe(struct platform_device *pdev)
 	return 0;
 
 err_tmu:
+	clk_disable_unprepare(data->clk);
 	iounmap(data->regs);
 
 err_iomap:
@@ -241,6 +254,9 @@ static int qoriq_tmu_remove(struct platform_device *pdev)
 	tmu_write(data, TMR_DISABLE, &data->regs->tmr);
 
 	iounmap(data->regs);
+
+	clk_disable_unprepare(data->clk);
+
 	platform_set_drvdata(pdev, NULL);
 
 	return 0;
@@ -257,14 +273,21 @@ static int qoriq_tmu_suspend(struct device *dev)
 	tmr &= ~TMR_ME;
 	tmu_write(data, tmr, &data->regs->tmr);
 
+	clk_disable_unprepare(data->clk);
+
 	return 0;
 }
 
 static int qoriq_tmu_resume(struct device *dev)
 {
 	u32 tmr;
+	int ret;
 	struct qoriq_tmu_data *data = dev_get_drvdata(dev);
 
+	ret = clk_prepare_enable(data->clk);
+	if (ret)
+		return ret;
+
 	/* Enable monitoring */
 	tmr = tmu_read(data, &data->regs->tmr);
 	tmr |= TMR_ME;
Signature · 1 line
2.7.4
#1 lore raw

PATCH v3 2/5 thermal: qoriq: Fix error path of calling qoriq_tmu_register_tmu_zone fail

From: Anson Huang <[email protected]>

When registering tmu zone failed, the error path should be err_tmu instead of err_iomap, as iounmap() needs to be called.

---
New patch.

---
 drivers/thermal/qoriq_thermal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/qoriq_thermal.c +1 -1
index 2893947..5755a11 100644
@@ -231,7 +231,7 @@ static int qoriq_tmu_probe(struct platform_device *pdev)
 	if (ret < 0) {
 		dev_err(&pdev->dev, "Failed to register sensors\n");
 		ret = -ENODEV;
-		goto err_iomap;
+		goto err_tmu;
 	}
 
 	return 0;
Signature · 1 line
2.7.4
#3 lore raw

PATCH v3 3/5 thermal: qoriq: Use devm_platform_ioremap_resource() instead of of_iomap()

In reply to [email protected]

From: Anson Huang <[email protected]>

Use devm_platform_ioremap_resource() instead of of_iomap() to save the iounmap() call in error handle path;

---
No change, just adjust the patch sequence and handle the conflicts.

---
 drivers/thermal/qoriq_thermal.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)
drivers/thermal/qoriq_thermal.c +6 -12
index 5755a11..8d19601 100644
@@ -204,11 +204,10 @@ static int qoriq_tmu_probe(struct platform_device *pdev)
 
 	data->little_endian = of_property_read_bool(np, "little-endian");
 
-	data->regs = of_iomap(np, 0);
-	if (!data->regs) {
+	data->regs = devm_platform_ioremap_resource(pdev, 0);
+	if (IS_ERR(data->regs)) {
 		dev_err(&pdev->dev, "Failed to get memory region\n");
-		ret = -ENODEV;
-		goto err_iomap;
+		return PTR_ERR(data->regs);
 	}
 
 	data->clk = devm_clk_get_optional(&pdev->dev, NULL);
@@ -225,22 +224,19 @@ static int qoriq_tmu_probe(struct platform_device *pdev)
 
 	ret = qoriq_tmu_calibration(pdev);	/* TMU calibration */
 	if (ret < 0)
-		goto err_tmu;
+		goto err;
 
 	ret = qoriq_tmu_register_tmu_zone(pdev);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "Failed to register sensors\n");
 		ret = -ENODEV;
-		goto err_tmu;
+		goto err;
 	}
 
 	return 0;
 
-err_tmu:
+err:
 	clk_disable_unprepare(data->clk);
-	iounmap(data->regs);
-
-err_iomap:
 	platform_set_drvdata(pdev, NULL);
 
 	return ret;
@@ -253,8 +249,6 @@ static int qoriq_tmu_remove(struct platform_device *pdev)
 	/* Disable monitoring */
 	tmu_write(data, TMR_DISABLE, &data->regs->tmr);
 
-	iounmap(data->regs);
-
 	clk_disable_unprepare(data->clk);
 
 	platform_set_drvdata(pdev, NULL);
Signature · 1 line
2.7.4
#5 lore raw

PATCH v3 4/5 thermal: qoriq: Use __maybe_unused instead of #if CONFIG_PM_SLEEP

In reply to [email protected]

From: Anson Huang <[email protected]>

Use __maybe_unused for power management related functions instead of #if CONFIG_PM_SLEEP to simply the code.

---
No changes.

---
 drivers/thermal/qoriq_thermal.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/thermal/qoriq_thermal.c +2 -4
index 8d19601..39542c6 100644
@@ -256,8 +256,7 @@ static int qoriq_tmu_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef CONFIG_PM_SLEEP
-static int qoriq_tmu_suspend(struct device *dev)
+static int __maybe_unused qoriq_tmu_suspend(struct device *dev)
 {
 	u32 tmr;
 	struct qoriq_tmu_data *data = dev_get_drvdata(dev);
@@ -272,7 +271,7 @@ static int qoriq_tmu_suspend(struct device *dev)
 	return 0;
 }
 
-static int qoriq_tmu_resume(struct device *dev)
+static int __maybe_unused qoriq_tmu_resume(struct device *dev)
 {
 	u32 tmr;
 	int ret;
@@ -289,7 +288,6 @@ static int qoriq_tmu_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
 static SIMPLE_DEV_PM_OPS(qoriq_tmu_pm_ops,
 			 qoriq_tmu_suspend, qoriq_tmu_resume);
Signature · 1 line
2.7.4
#7 lore raw

PATCH v3 5/5 dt-bindings: thermal: qoriq: Add optional clocks property

In reply to [email protected]

From: Anson Huang <[email protected]>

Some platforms like i.MX8M series SoCs have clock control for TMU, add optional clocks property to the binding doc.

---
No changes, noted the i.MX8M series SoCs need this clock in commit log.

---
 Documentation/devicetree/bindings/thermal/qoriq-thermal.txt | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/thermal/qoriq-thermal.txt +1 -0
index 04cbb90..28f2cba 100644
@@ -23,6 +23,7 @@ Required properties:
 Optional property:
 - little-endian : If present, the TMU registers are little endian. If absent,
 	the default is big endian.
+- clocks : the clock for clocking the TMU silicon.
 
 Example:
 
Signature · 1 line
2.7.4
Reviewed-by on v3 5/5
#8 lore raw

RE: [PATCH V3 5/5] dt-bindings: thermal: qoriq: Add optional clocks property

Quoted 8 lines

From: [email protected] <[email protected]>
Sent: Tuesday, July 30, 2019 10:21 AM

Some platforms like i.MX8M series SoCs have clock control for TMU, add optional clocks property to the binding doc.

Regards
Aisheng

#10 lore raw
In reply to [email protected]
Quoted 8 lines · On 7/30/2019 5:31 AM, [email protected] wrote:

From: Anson Huang <[email protected]>

Some platforms like i.MX8MQ has clock control for this module, need to add clock operations to make sure the driver is working properly.

This series looks good, do you think it can be merged in time for v5.4? Today was v5.3-rc6.

In an earlier series the CLK_IS_CRITICAL flags was removed from the TMU clock so if the thermal driver doesn't explicitly enable it the system will hang on probe. This is what happens in linux-next right now!

Unless this patches is merged soon we'll end up with a 5.4-rc1 that doesn't boot on imx8mq. An easy fix would be to drop/revert commit 951c1aef9691 ("clk: imx8mq: Remove CLK_IS_CRITICAL flag for IMX8MQ_CLK_TMU_ROOT") until the thermal patches are accepted.

Merging patches out-of-order when they have hard (boot-breaking) dependencies also breaks bisect.

--
Regards,
Leonard

#11 lore raw
Quoted 13 lines · On 7/30/2019 5:31 AM, [email protected] wrote:
Quoted 7 lines

From: Anson Huang <[email protected]>

Some platforms like i.MX8MQ has clock control for this module, need to add clock operations to make sure the driver is working properly.

This series looks good, do you think it can be merged in time for v5.4? Today was v5.3-rc6.

If the question is for me, then I am NOT sure, the thermal patches are pending there for almost half year and I did NOT receive any response, looks like no one is maintaining the thermal sub-system?

Quoted 4 lines

In an earlier series the CLK_IS_CRITICAL flags was removed from the TMU clock so if the thermal driver doesn't explicitly enable it the system will hang on probe. This is what happens in linux-next right now!

The thermal driver should be built with module, so default kernel should can boot up, do you modify the thermal driver as built-in?

Quoted 5 lines

Unless this patches is merged soon we'll end up with a 5.4-rc1 that doesn't boot on imx8mq. An easy fix would be to drop/revert commit 951c1aef9691 ("clk: imx8mq: Remove CLK_IS_CRITICAL flag for IMX8MQ_CLK_TMU_ROOT") until the thermal patches are accepted.

If the thermal driver is built as module, I think no need to revert the commit, but if by default thermal driver is built-in or mod probed, then yes, it should NOT break kernel boot up.

Anson.

Quoted 7 lines

Merging patches out-of-order when they have hard (boot-breaking) dependencies also breaks bisect.

--
Regards,
Leonard

reviewer
#12 lore raw
Quoted 10 lines · Anson Huang
Quoted 10 lines · On 7/30/2019 5:31 AM, [email protected] wrote:
Quoted 8 lines

From: Anson Huang <[email protected]>

Some platforms like i.MX8MQ has clock control for this module, need to
add clock operations to make sure the driver is working properly.

Quoted 7 lines
Quoted 3 lines

This series looks good, do you think it can be merged in time for v5.4?
Today was v5.3-rc6.

If the question is for me, then I am NOT sure, the thermal patches are pending
there for almost half year and I did NOT receive any response,

which patch series you're referring to?

Quoted 3 lines

looks like no one
is maintaining the thermal sub-system?

Eduardo is maintaining all the thermal-soc driver changes. Thus I usually filtered out the soc driver patches in my mailbox.

The last email from Eduardo is that he is offline during this July and will be back and taking patches in August.

I will double check with Eduardo anyway.

thanks,
rui

Quoted 33 lines
Quoted 6 lines

In an earlier series the CLK_IS_CRITICAL flags was removed from the TMU
clock so if the thermal driver doesn't explicitly enable it the system will hang
on probe. This is what happens in linux-next right now!

The thermal driver should be built with module, so default kernel should can boot
up, do you modify the thermal driver as built-in?

Quoted 6 lines

Unless this patches is merged soon we'll end up with a 5.4-rc1 that doesn't
boot on imx8mq. An easy fix would be to drop/revert commit 951c1aef9691 ("clk: imx8mq: Remove CLK_IS_CRITICAL flag for IMX8MQ_CLK_TMU_ROOT") until the thermal patches are accepted.

If the thermal driver is built as module, I think no need to revert the commit, but
if by default thermal driver is built-in or mod probed, then yes, it should NOT break
kernel boot up.

Anson.

Quoted 7 lines

Merging patches out-of-order when they have hard (boot-breaking) dependencies also breaks bisect.

--
Regards,
Leonard

#13 lore raw

Hi, Rui

Quoted 11 lines · Anson Huang
Quoted 10 lines
Quoted 10 lines · On 7/30/2019 5:31 AM, [email protected] wrote:
Quoted 8 lines

From: Anson Huang <[email protected]>

Some platforms like i.MX8MQ has clock control for this module, need to add clock operations to make sure the driver is working properly.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

This series looks good, do you think it can be merged in time for v5.4?
Today was v5.3-rc6.

If the question is for me, then I am NOT sure, the thermal patches are pending there for almost half year and I did NOT receive any response,

which patch series you're referring to?

Below i.MX8QXP patch series, I meant I started it from last year, the latest resend version is 2 months ago:

https://patchwork.kernel.org/patch/11000809/

Quoted 3 lines
Quoted 3 lines

looks like no one
is maintaining the thermal sub-system?

Below two patch series are also pending there for some time:

https://patchwork.kernel.org/patch/11032777/

https://patchwork.kernel.org/patch/11031297/

Quoted 9 lines
Quoted 1 line

Eduardo is maintaining all the thermal-soc driver changes. Thus I usually filtered out the soc driver patches in my mailbox.

The last email from Eduardo is that he is offline during this July and will be back and taking patches in August.

I will double check with Eduardo anyway.

Thanks, especially our i.MX8QXP thermal driver patch, I started it from last year and due to some different opinion from different reviewers, this patch series version is up to v15, but I did NOT receive response since June, appreciated if you guys can take a look at this, I ping it many times but no feedback. Thanks!

https://patchwork.kernel.org/patch/11000809/

Anson.

Quoted 33 lines

thanks,
rui

Quoted 28 lines
Quoted 5 lines

In an earlier series the CLK_IS_CRITICAL flags was removed from the TMU clock so if the thermal driver doesn't explicitly enable it the system will hang on probe. This is what happens in linux-next right now!

The thermal driver should be built with module, so default kernel should can boot up, do you modify the thermal driver as built-in?

Quoted 5 lines

Unless this patches is merged soon we'll end up with a 5.4-rc1 that doesn't boot on imx8mq. An easy fix would be to drop/revert commit 951c1aef9691 ("clk: imx8mq: Remove CLK_IS_CRITICAL flag for IMX8MQ_CLK_TMU_ROOT") until the thermal patches are accepted.

If the thermal driver is built as module, I think no need to revert the commit, but if by default thermal driver is built-in or mod probed, then yes, it should NOT break kernel boot up.

Anson.

Quoted 7 lines

Merging patches out-of-order when they have hard (boot-breaking) dependencies also breaks bisect.

--
Regards,
Leonard

#14 lore raw
In reply to Anson Huang
Quoted 7 lines · Anson Huang
Quoted 3 lines

In an earlier series the CLK_IS_CRITICAL flags was removed from the TMU clock so if the thermal driver doesn't explicitly enable it the system will hang on probe. This is what happens in linux-next right now!

The thermal driver should be built with module, so default kernel should can boot up, do you modify the thermal driver as built-in?

Quoted 8 lines
Quoted 4 lines

Unless this patches is merged soon we'll end up with a 5.4-rc1 that doesn't boot on imx8mq. An easy fix would be to drop/revert commit 951c1aef9691 ("clk: imx8mq: Remove CLK_IS_CRITICAL flag for IMX8MQ_CLK_TMU_ROOT") until the thermal patches are accepted.

If the thermal driver is built as module, I think no need to revert the commit, but if by default thermal driver is built-in or mod probed, then yes, it should NOT break kernel boot up.

The qoriq_thermal driver is built as a module in defconfig and when modules are properly installed in rootfs they will be automatically be probed on boot and cause a hang.

I usually run nfsroot with modules:

make modules_install INSTALL_MOD_PATH=/srv/nfs/imx8-root

--
Regards,
Leonard

reviewer
#15 lore raw
Quoted 23 lines · Leonard Crestez
Quoted 16 lines · Anson Huang
Quoted 5 lines

In an earlier series the CLK_IS_CRITICAL flags was removed from the TMU
clock so if the thermal driver doesn't explicitly enable it the system will hang
on probe. This is what happens in linux-next right now!

The thermal driver should be built with module, so default kernel should can boot
up, do you modify the thermal driver as built-in?

Quoted 5 lines

Unless this patches is merged soon we'll end up with a 5.4-rc1 that doesn't
boot on imx8mq. An easy fix would be to drop/revert commit 951c1aef9691 ("clk: imx8mq: Remove CLK_IS_CRITICAL flag for IMX8MQ_CLK_TMU_ROOT") until the thermal patches are accepted.

Quoted 5 lines

If the thermal driver is built as module, I think no need to revert the commit, but
if by default thermal driver is built-in or mod probed, then yes, it should NOT break
kernel boot up.

Quoted 8 lines

The qoriq_thermal driver is built as a module in defconfig and when modules are properly installed in rootfs they will be automatically be
probed on boot and cause a hang.

I usually run nfsroot with modules:

make modules_install INSTALL_MOD_PATH=/srv/nfs/imx8-root

so we need this patch shipped in the beginning of the merge window, right?
if there is hard dependency between patches, it's better to send them in one series, and get shipped via either tree.

BTW, who is maintaining qoriq driver from NXP? If Anson is maintaining and developing this driver, it's better to update this in the driver or the MAINTAINER file, I will take the driver specific patches as long as we have ACK/Reviewed-By from the driver maintainer.

thanks,
rui

Quoted 4 lines

--
Regards,
Leonard

reviewer
#16 lore raw
Quoted 40 lines · Zhang Rui
Quoted 30 lines · Leonard Crestez
Quoted 16 lines · Anson Huang
Quoted 5 lines

In an earlier series the CLK_IS_CRITICAL flags was removed from the TMU
clock so if the thermal driver doesn't explicitly enable it the system will hang
on probe. This is what happens in linux-next right now!

The thermal driver should be built with module, so default kernel should can boot
up, do you modify the thermal driver as built-in?

Quoted 5 lines

Unless this patches is merged soon we'll end up with a 5.4-rc1 that doesn't
boot on imx8mq. An easy fix would be to drop/revert commit 951c1aef9691 ("clk: imx8mq: Remove CLK_IS_CRITICAL flag for IMX8MQ_CLK_TMU_ROOT") until the thermal patches are accepted.

Quoted 6 lines

If the thermal driver is built as module, I think no need to revert
the commit, but
if by default thermal driver is built-in or mod probed, then yes, it should NOT break
kernel boot up.

The qoriq_thermal driver is built as a module in defconfig and when
modules are properly installed in rootfs they will be automatically be
probed on boot and cause a hang.

Quoted 3 lines

I usually run nfsroot with modules:

make modules_install INSTALL_MOD_PATH=/srv/nfs/imx8-root

so we need this patch shipped in the beginning of the merge window, right?
if there is hard dependency between patches, it's better to send them in one series, and get shipped via either tree.

Quoted 7 lines

BTW, who is maintaining qoriq driver from NXP? If Anson is maintaining
and developing this driver, it's better to update this in the driver or
the MAINTAINER file, I will take the driver specific patches as long as
we have ACK/Reviewed-By from the driver maintainer.

And also, can you provide your feedback for this one?
https://patchwork.kernel.org/patch/10974147/

thanks,
rui

Quoted 8 lines

thanks,
rui

Quoted 4 lines

--
Regards,
Leonard

#17 lore raw

Hi, Rui

Quoted 34 lines · Zhang Rui
Quoted 33 lines · Leonard Crestez
Quoted 19 lines · Anson Huang
Quoted 14 lines
Quoted 4 lines

In an earlier series the CLK_IS_CRITICAL flags was removed from the TMU clock so if the thermal driver doesn't explicitly enable it the system will hang on probe. This is what happens in linux-next right now!

The thermal driver should be built with module, so default kernel should can boot up, do you modify the thermal driver as built-in?

Quoted 5 lines

Unless this patches is merged soon we'll end up with a 5.4-rc1 that doesn't boot on imx8mq. An easy fix would be to drop/revert commit
951c1aef9691 ("clk: imx8mq: Remove CLK_IS_CRITICAL flag for IMX8MQ_CLK_TMU_ROOT") until the thermal patches are accepted.

Quoted 3 lines

If the thermal driver is built as module, I think no need to revert the commit, but if by default thermal driver is built-in or mod probed, then yes, it should NOT break kernel boot up.

Quoted 7 lines

The qoriq_thermal driver is built as a module in defconfig and when modules are properly installed in rootfs they will be automatically be probed on boot and cause a hang.

I usually run nfsroot with modules:

make modules_install INSTALL_MOD_PATH=/srv/nfs/imx8-root

so we need this patch shipped in the beginning of the merge window, right?
if there is hard dependency between patches, it's better to send them in one series, and get shipped via either tree.

Quoted 4 lines
Quoted 4 lines

BTW, who is maintaining qoriq driver from NXP? If Anson is maintaining and developing this driver, it's better to update this in the driver or the MAINTAINER file, I will take the driver specific patches as long as we have ACK/Reviewed-By from the driver maintainer.

I am NOT sure who is the qoriq driver from NXP, some of our i.MX SoCs use qoriq thermal IP, so I have to add support for them. The first maintainer for this driver is [email protected], but I can NOT find it from NXP's mail system, NOT sure if he is still in NXP. The MAINTAINER file does NOT have info for this Driver's maintainer, so how to update it? Just change the name in driver? Or leave it as what it is?

MODULE_AUTHOR("Jia Hongtao <[email protected]>"); MODULE_DESCRIPTION("QorIQ Thermal Monitoring Unit driver"); MODULE_LICENSE("GPL v2");

Quoted 8 lines

And also, can you provide your feedback for this one?
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatch
work.kernel.org%2Fpatch%2F10974147%2F&amp;data=02%7C01%7Canson.h uang%40nxp.com%7C887e7c90f7c943ff0d9b08d72b92aea1%7C686ea1d3bc2 b4c6fa92cd99c5c301635%7C0%7C0%7C637025781325203384&amp;sdata=Xg tX6mPdA50Nbb%2FmnS2om2bJNepTd1th6HmfwGuU9Hw%3D&amp;reserve d=0

I can take a look at it later.

Thanks,
Anson

reviewer
#18 lore raw
Quoted 68 lines · Anson Huang

Hi, Rui

Quoted 46 lines · Zhang Rui
Quoted 45 lines · Leonard Crestez
Quoted 33 lines · Anson Huang
Quoted 21 lines
Quoted 6 lines

In an earlier series the CLK_IS_CRITICAL flags was removed from
the TMU clock so if the thermal driver doesn't explicitly enable
it the system will hang on probe. This is what happens in linux-next right now!

The thermal driver should be built with module, so default kernel
should can boot up, do you modify the thermal driver as built-in?

Quoted 8 lines

Unless this patches is merged soon we'll end up with a 5.4- rc1
that doesn't boot on imx8mq. An easy fix would be to drop/revert
commit
951c1aef9691 ("clk: imx8mq: Remove CLK_IS_CRITICAL flag for IMX8MQ_CLK_TMU_ROOT") until the thermal patches are accepted.

Quoted 4 lines

If the thermal driver is built as module, I think no need to revert the commit, but if by default thermal driver is built- in or
mod probed, then yes, it should NOT break kernel boot up.

The qoriq_thermal driver is built as a module in defconfig and when
modules are properly installed in rootfs they will be automatically
be probed on boot and cause a hang.

Quoted 3 lines

I usually run nfsroot with modules:

make modules_install INSTALL_MOD_PATH=/srv/nfs/imx8-root

so we need this patch shipped in the beginning of the merge window,
right?
if there is hard dependency between patches, it's better to send them
in one series, and get shipped via either tree.

Quoted 7 lines
Quoted 7 lines

BTW, who is maintaining qoriq driver from NXP? If Anson is maintaining
and developing this driver, it's better to update this in the driver
or the MAINTAINER file, I will take the driver specific patches as
long as we have ACK/Reviewed-By from the driver maintainer.

I am NOT sure who is the qoriq driver from NXP, some of our i.MX SoCs use
qoriq thermal IP, so I have to add support for them. The first maintainer for
this driver is [email protected], but I can NOT find it from NXP's mail system,
NOT sure if he is still in NXP. The MAINTAINER file does NOT have info for this
Driver's maintainer, so how to update it? Just change the name in driver? Or leave
it as what it is?

Quoted 4 lines

MODULE_AUTHOR("Jia Hongtao <[email protected]>"); MODULE_DESCRIPTION("QorIQ Thermal Monitoring Unit driver"); MODULE_LICENSE("GPL v2");

I see several people are actively working on this driver from NXP. If you're okay, I'd like to get your comments on all the patches for this driver before I take them, and I can update the MAINTAINER file later so that you're CCed for all the qoriq thermal driver changes.

Quoted 3 lines
Quoted 3 lines

And also, can you provide your feedback for this one?

https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatch

Quoted 8 lines
Quoted 5 lines

work.kernel.org%2Fpatch%2F10974147%2F&amp;data=02%7C01%7Canson.h uang%40nxp.com%7C887e7c90f7c943ff0d9b08d72b92aea1%7C686ea1d3bc2 b4c6fa92cd99c5c301635%7C0%7C0%7C637025781325203384&amp;sdata=Xg tX6mPdA50Nbb%2FmnS2om2bJNepTd1th6HmfwGuU9Hw%3D&amp;reserve d=0

I can take a look at it later.

thanks!

-rui

Quoted 2 lines

Thanks,
Anson

#19 lore raw

Hi, Rui

Quoted 55 lines · Anson Huang
Quoted 54 lines

Hi, Rui

Quoted 38 lines · Zhang Rui
Quoted 37 lines · Leonard Crestez
Quoted 23 lines · Anson Huang
Quoted 17 lines
Quoted 4 lines

In an earlier series the CLK_IS_CRITICAL flags was removed from the TMU clock so if the thermal driver doesn't explicitly enable it the system will hang on probe. This is what happens in linux-next right now!

The thermal driver should be built with module, so default kernel should can boot up, do you modify the thermal driver as built-in?

Quoted 7 lines

Unless this patches is merged soon we'll end up with a 5.4- rc1
that doesn't boot on imx8mq. An easy fix would be to drop/revert commit
951c1aef9691 ("clk: imx8mq: Remove CLK_IS_CRITICAL flag for IMX8MQ_CLK_TMU_ROOT") until the thermal patches are accepted.

Quoted 4 lines

If the thermal driver is built as module, I think no need to revert the commit, but if by default thermal driver is built- in or mod probed, then yes, it should NOT break kernel boot up.

Quoted 7 lines

The qoriq_thermal driver is built as a module in defconfig and when modules are properly installed in rootfs they will be automatically be probed on boot and cause a hang.

I usually run nfsroot with modules:

make modules_install INSTALL_MOD_PATH=/srv/nfs/imx8-root

so we need this patch shipped in the beginning of the merge window, right?
if there is hard dependency between patches, it's better to send them in one series, and get shipped via either tree.

Quoted 5 lines
Quoted 5 lines

BTW, who is maintaining qoriq driver from NXP? If Anson is maintaining and developing this driver, it's better to update this in the driver or the MAINTAINER file, I will take the driver specific patches as long as we have ACK/Reviewed-By from the driver maintainer.

I am NOT sure who is the qoriq driver from NXP, some of our i.MX SoCs use qoriq thermal IP, so I have to add support for them. The first maintainer for this driver is [email protected], but I can NOT find it from NXP's mail system, NOT sure if he is still in NXP. The MAINTAINER file does NOT have info for this Driver's maintainer, so how to update it? Just change the name in driver? Or leave it as what it is?

Quoted 8 lines
Quoted 4 lines

MODULE_AUTHOR("Jia Hongtao <[email protected]>");
MODULE_DESCRIPTION("QorIQ Thermal Monitoring Unit driver"); MODULE_LICENSE("GPL v2");

I see several people are actively working on this driver from NXP. If you're okay, I'd like to get your comments on all the patches for this driver before I take them, and I can update the MAINTAINER file later so that you're CCed for all the qoriq thermal driver changes.

I am OK, but it may take me some days to do it, I will make it ASAP, thanks.

Anson

Quoted 22 lines
Quoted 4 lines
Quoted 4 lines

And also, can you provide your feedback for this one?

https://patch

Quoted 1 line
Quoted 1 line

work.kernel.org%2Fpatch%2F10974147%2F&amp;data=02%7C01%7Canson.h

Quoted 1 line
Quoted 1 line

uang%40nxp.com%7C887e7c90f7c943ff0d9b08d72b92aea1%7C686ea1d3bc2

Quoted 1 line
Quoted 1 line

b4c6fa92cd99c5c301635%7C0%7C0%7C637025781325203384&amp;sdata=Xg

Quoted 1 line
Quoted 1 line

tX6mPdA50Nbb%2FmnS2om2bJNepTd1th6HmfwGuU9Hw%3D&amp;reserve

Quoted 4 lines
Quoted 1 line

d=0

I can take a look at it later.

thanks!

-rui

Quoted 2 lines

Thanks,
Anson

#20 lore raw
In reply to Zhang Rui

Hi, Rui

Quoted 24 lines · Leonard Crestez
Quoted 23 lines · Anson Huang
Quoted 14 lines
Quoted 4 lines

In an earlier series the CLK_IS_CRITICAL flags was removed from the TMU clock so if the thermal driver doesn't explicitly enable it the system will hang on probe. This is what happens in linux-next right now!

The thermal driver should be built with module, so default kernel should can boot up, do you modify the thermal driver as built-in?

Quoted 5 lines

Unless this patches is merged soon we'll end up with a 5.4-rc1 that doesn't boot on imx8mq. An easy fix would be to drop/revert commit
951c1aef9691 ("clk: imx8mq: Remove CLK_IS_CRITICAL flag for IMX8MQ_CLK_TMU_ROOT") until the thermal patches are accepted.

Quoted 3 lines

If the thermal driver is built as module, I think no need to revert the commit, but if by default thermal driver is built-in or mod probed, then yes, it should NOT break kernel boot up.

The qoriq_thermal driver is built as a module in defconfig and when modules are properly installed in rootfs they will be automatically be probed on boot and cause a hang.

Quoted 7 lines
Quoted 3 lines

I usually run nfsroot with modules:

make modules_install INSTALL_MOD_PATH=/srv/nfs/imx8-root

so we need this patch shipped in the beginning of the merge window, right? if there is hard dependency between patches, it's better to send them in one series, and get shipped via either tree.

There is no hard dependency in this patch series. Previous for the TMU clock disabled patch, since thermal driver is built as module so I did NOT found the issue. The patch series is the correct fix.

Thanks,
Anson

Quoted 13 lines

BTW, who is maintaining qoriq driver from NXP? If Anson is maintaining and developing this driver, it's better to update this in the driver or the MAINTAINER file, I will take the driver specific patches as long as we have ACK/Reviewed-By from the driver maintainer.

thanks,
rui

Quoted 4 lines

--
Regards,
Leonard

reviewer
#21 lore raw
Quoted 45 lines · Anson Huang

Hi, Rui

Quoted 35 lines · Leonard Crestez
Quoted 34 lines · Anson Huang
Quoted 20 lines
Quoted 6 lines

In an earlier series the CLK_IS_CRITICAL flags was removed from
the TMU clock so if the thermal driver doesn't explicitly enable
it the system will hang on probe. This is what happens in linux-next right now!

The thermal driver should be built with module, so default kernel
should can boot up, do you modify the thermal driver as built- in?

Quoted 7 lines

Unless this patches is merged soon we'll end up with a 5.4- rc1
that doesn't boot on imx8mq. An easy fix would be to drop/revert
commit
951c1aef9691 ("clk: imx8mq: Remove CLK_IS_CRITICAL flag for IMX8MQ_CLK_TMU_ROOT") until the thermal patches are accepted.

Quoted 4 lines

If the thermal driver is built as module, I think no need to revert
the commit, but if by default thermal driver is built-in or mod probed, then yes, it should NOT break kernel boot up.

The qoriq_thermal driver is built as a module in defconfig and when
modules are properly installed in rootfs they will be automatically be
probed on boot and cause a hang.

I usually run nfsroot with modules:

Quoted 7 lines
Quoted 1 line

make modules_install INSTALL_MOD_PATH=/srv/nfs/imx8-root

so we need this patch shipped in the beginning of the merge window, right?
if there is hard dependency between patches, it's better to send them in one
series, and get shipped via either tree.

Quoted 6 lines

There is no hard dependency in this patch series. Previous for the TMU clock disabled
patch, since thermal driver is built as module so I did NOT found the issue. The patch
series is the correct fix.

Got it.
the clock patch is also queued for 5.4-rc1, right?
I will apply this series and try to push it as early as possible during the merge window.

thanks,
rui

Quoted 21 lines

Thanks,
Anson

Quoted 16 lines

BTW, who is maintaining qoriq driver from NXP? If Anson is maintaining and
developing this driver, it's better to update this in the driver or the
MAINTAINER file, I will take the driver specific patches as long as we have
ACK/Reviewed-By from the driver maintainer.

thanks,
rui

Quoted 4 lines

--
Regards,
Leonard

author Reviewed-by Abel Vesa Acked-by Stephen Boyd
#22 lore raw

Hi, Rui

Quoted 38 lines · Anson Huang
Quoted 37 lines

Hi, Rui

Quoted 34 lines · Leonard Crestez
Quoted 21 lines · Anson Huang
Quoted 16 lines
Quoted 4 lines

In an earlier series the CLK_IS_CRITICAL flags was removed from the TMU clock so if the thermal driver doesn't explicitly enable it the system will hang on probe. This is what happens in linux-next right now!

The thermal driver should be built with module, so default kernel should can boot up, do you modify the thermal driver as built- in?

Quoted 6 lines

Unless this patches is merged soon we'll end up with a 5.4- rc1
that doesn't boot on imx8mq. An easy fix would be to drop/revert commit
951c1aef9691 ("clk: imx8mq: Remove CLK_IS_CRITICAL flag for IMX8MQ_CLK_TMU_ROOT") until the thermal patches are accepted.

Quoted 3 lines

If the thermal driver is built as module, I think no need to revert the commit, but if by default thermal driver is built-in or mod probed, then yes, it should NOT break kernel boot up.

Quoted 7 lines

The qoriq_thermal driver is built as a module in defconfig and when modules are properly installed in rootfs they will be automatically be probed on boot and cause a hang.

I usually run nfsroot with modules:

make modules_install INSTALL_MOD_PATH=/srv/nfs/imx8-root

so we need this patch shipped in the beginning of the merge window, right?
if there is hard dependency between patches, it's better to send them in one series, and get shipped via either tree.

Quoted 8 lines
Quoted 4 lines

There is no hard dependency in this patch series. Previous for the TMU clock disabled patch, since thermal driver is built as module so I did NOT found the issue. The patch series is the correct fix.

Got it.
the clock patch is also queued for 5.4-rc1, right?
I will apply this series and try to push it as early as possible during the merge window.

The clock patch is as below in Linux-next tree, while I did NOT see it in v5.3-rc6, so it should be queued for 5.4-rc1, right?
Thanks for taking the patch series!

commit 951c1aef9691491ddf4dd5aab76f2665d56bd5d3

Author: Anson Huang <[email protected]>
Date:   Fri Jul 5 12:56:11 2019 +0800

clk: imx8mq: Remove CLK_IS_CRITICAL flag for IMX8MQ_CLK_TMU_ROOT

IMX8MQ_CLK_TMU_ROOT is ONLY used for thermal module, the driver should manage this clock, so no need to have CLK_IS_CRITICAL flag set.

drivers/clk/imx/clk-imx8mq.c

Thanks,
Anson

#23 lore raw

Hi, Rui

Quoted 44 lines
Quoted 14 lines · Anson Huang
Quoted 13 lines

Hi, Rui

Quoted 11 lines · Leonard Crestez
Quoted 10 lines · Anson Huang
Quoted 9 lines
Quoted 4 lines

In an earlier series the CLK_IS_CRITICAL flags was removed from the TMU clock so if the thermal driver doesn't explicitly enable it the system will hang on probe. This is what happens in linux-next right now!

The thermal driver should be built with module, so default kernel should can boot up, do you modify the thermal driver as built- in?

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

Unless this patches is merged soon we'll end up with a 5.4- rc1
that doesn't boot on imx8mq. An easy fix would be to drop/revert commit
951c1aef9691 ("clk: imx8mq: Remove CLK_IS_CRITICAL flag for IMX8MQ_CLK_TMU_ROOT") until the thermal patches are

accepted.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

If the thermal driver is built as module, I think no need to revert the commit, but if by default thermal driver is built-in or mod probed, then yes, it should NOT break kernel boot

up.

Quoted 18 lines
Quoted 18 lines
Quoted 5 lines
Quoted 5 lines

The qoriq_thermal driver is built as a module in defconfig and when modules are properly installed in rootfs they will be automatically be probed on boot and cause a hang.

Quoted 8 lines
Quoted 3 lines

I usually run nfsroot with modules:

make modules_install INSTALL_MOD_PATH=/srv/nfs/imx8-root

so we need this patch shipped in the beginning of the merge window, right?
if there is hard dependency between patches, it's better to send them in one series, and get shipped via either tree.

There is no hard dependency in this patch series. Previous for the TMU clock disabled patch, since thermal driver is built as module so I did NOT found the issue. The patch series is the correct fix.

Quoted 8 lines
Quoted 4 lines

Got it.
the clock patch is also queued for 5.4-rc1, right?
I will apply this series and try to push it as early as possible during the merge window.

The clock patch is as below in Linux-next tree, while I did NOT see it in v5.3- rc6, so it should be queued for 5.4-rc1, right?
Thanks for taking the patch series!

Sorry for pushing, so you will apply this patch series to avoid the i.MX8MQ kernel boot up hang caused by insmod qoriq thermal driver, right? Then we no need to revert that TMU clock patch 951c1aef9691 ("clk: imx8mq: Remove CLK_IS_CRITICAL flag for IMX8MQ_CLK_TMU_ROOT").

Thanks,
Anson

Quoted 22 lines

commit 951c1aef9691491ddf4dd5aab76f2665d56bd5d3

Author: Anson Huang <[email protected]>
Date:   Fri Jul 5 12:56:11 2019 +0800

clk: imx8mq: Remove CLK_IS_CRITICAL flag for IMX8MQ_CLK_TMU_ROOT

IMX8MQ_CLK_TMU_ROOT is ONLY used for thermal module, the driver should manage this clock, so no need to have CLK_IS_CRITICAL flag set.

drivers/clk/imx/clk-imx8mq.c

Thanks,
Anson

reviewer
#24 lore raw
Quoted 72 lines · Anson Huang

Hi, Rui

Quoted 65 lines
Quoted 18 lines · Anson Huang
Quoted 17 lines

Hi, Rui

Quoted 15 lines · Leonard Crestez
Quoted 14 lines · Anson Huang
Quoted 13 lines
Quoted 6 lines

In an earlier series the CLK_IS_CRITICAL flags was removed
from the TMU clock so if the thermal driver doesn't explicitly enable it the system will hang on probe. This is
what happens in linux-next right now!

The thermal driver should be built with module, so default
kernel should can boot up, do you modify the thermal driver as
built- in?

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Unless this patches is merged soon we'll end up with a 5.4-
rc1
that doesn't boot on imx8mq. An easy fix would be to drop/revert commit
951c1aef9691 ("clk: imx8mq: Remove CLK_IS_CRITICAL flag for
IMX8MQ_CLK_TMU_ROOT") until the thermal patches are

accepted.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

If the thermal driver is built as module, I think no need to
revert the commit, but if by default thermal driver is built-in or mod probed, then yes, it should NOT break kernel boot

up.

Quoted 24 lines
Quoted 17 lines
Quoted 8 lines
Quoted 8 lines

The qoriq_thermal driver is built as a module in defconfig and
when modules are properly installed in rootfs they will be automatically be probed on boot and cause a hang.

I usually run nfsroot with modules:

Quoted 8 lines
Quoted 2 lines

make modules_install INSTALL_MOD_PATH=/srv/nfs/imx8-
root

so we need this patch shipped in the beginning of the merge window, right?
if there is hard dependency between patches, it's better to send
them in one series, and get shipped via either tree.

Quoted 6 lines

There is no hard dependency in this patch series. Previous for the
TMU clock disabled patch, since thermal driver is built as module so
I did NOT found the issue. The patch series is the correct fix.

Quoted 4 lines

Got it.
the clock patch is also queued for 5.4-rc1, right?
I will apply this series and try to push it as early as possible during the merge window.

Quoted 4 lines

The clock patch is as below in Linux-next tree, while I did NOT see it in v5.3-
rc6, so it should be queued for 5.4-rc1, right?
Thanks for taking the patch series!

Quoted 7 lines

Sorry for pushing, so you will apply this patch series to avoid the i.MX8MQ kernel boot up hang
caused by insmod qoriq thermal driver, right? Then we no need to revert that TMU clock patch
951c1aef9691 ("clk: imx8mq: Remove CLK_IS_CRITICAL flag for IMX8MQ_CLK_TMU_ROOT").

right. I will queue it for 5.4-rc1.

thanks,
rui

Quoted 27 lines

Thanks,
Anson

Quoted 24 lines

commit 951c1aef9691491ddf4dd5aab76f2665d56bd5d3

Author: Anson Huang <[email protected]>
Date:   Fri Jul 5 12:56:11 2019 +0800

clk: imx8mq: Remove CLK_IS_CRITICAL flag for
IMX8MQ_CLK_TMU_ROOT

IMX8MQ_CLK_TMU_ROOT is ONLY used for thermal module, the driver should manage this clock, so no need to have CLK_IS_CRITICAL
flag
set.

drivers/clk/imx/clk-imx8mq.c

Thanks,
Anson