* [PATCH] thermal/drivers/tegra: Fix crash when getting critical temp
@ 2022-10-10 15:03 Jon Hunter
2022-10-21 9:49 ` Jon Hunter
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Jon Hunter @ 2022-10-10 15:03 UTC (permalink / raw)
To: Rafael J . Wysocki, Daniel Lezcano, Thierry Reding
Cc: linux-pm, linux-tegra, Jon Hunter
Commit 13bea86623be ("thermal/of: Remove of_thermal_get_crit_temp()")
removed the function of_thermal_get_crit_temp() and this is causing a
NULL pointer deference crash when attempting to call the 'get_crit_temp'
function pointer because this function pointer is no longer initialised.
Fix this by replacing the call to the 'get_crit_temp' function pointer
with a call to the function thermal_zone_get_crit_temp() instead.
Fixes: 13bea86623be ("thermal/of: Remove of_thermal_get_crit_temp()")
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
drivers/thermal/tegra/soctherm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/thermal/tegra/soctherm.c b/drivers/thermal/tegra/soctherm.c
index d2e454902689..4203e74e2f79 100644
--- a/drivers/thermal/tegra/soctherm.c
+++ b/drivers/thermal/tegra/soctherm.c
@@ -742,7 +742,7 @@ static int tegra_soctherm_set_hwtrips(struct device *dev,
/* Get thermtrips. If missing, try to get critical trips. */
temperature = tsensor_group_thermtrip_get(ts, sg->id);
if (min_low_temp == temperature)
- if (tz->ops->get_crit_temp(tz, &temperature))
+ if (thermal_zone_get_crit_temp(tz, &temperature))
temperature = max_high_temp;
ret = thermtrip_program(dev, sg, temperature);
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] thermal/drivers/tegra: Fix crash when getting critical temp
2022-10-10 15:03 [PATCH] thermal/drivers/tegra: Fix crash when getting critical temp Jon Hunter
@ 2022-10-21 9:49 ` Jon Hunter
2022-10-21 10:41 ` Daniel Lezcano
2022-10-21 10:51 ` Daniel Lezcano
2022-12-09 15:26 ` [thermal: thermal/next] " thermal-bot for Jon Hunter
2 siblings, 1 reply; 5+ messages in thread
From: Jon Hunter @ 2022-10-21 9:49 UTC (permalink / raw)
To: Rafael J . Wysocki, Daniel Lezcano, Thierry Reding; +Cc: linux-pm, linux-tegra
Hi Rafael,
On 10/10/2022 16:03, Jon Hunter wrote:
> Commit 13bea86623be ("thermal/of: Remove of_thermal_get_crit_temp()")
> removed the function of_thermal_get_crit_temp() and this is causing a
> NULL pointer deference crash when attempting to call the 'get_crit_temp'
> function pointer because this function pointer is no longer initialised.
> Fix this by replacing the call to the 'get_crit_temp' function pointer
> with a call to the function thermal_zone_get_crit_temp() instead.
>
> Fixes: 13bea86623be ("thermal/of: Remove of_thermal_get_crit_temp()")
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
> ---
> drivers/thermal/tegra/soctherm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/thermal/tegra/soctherm.c b/drivers/thermal/tegra/soctherm.c
> index d2e454902689..4203e74e2f79 100644
> --- a/drivers/thermal/tegra/soctherm.c
> +++ b/drivers/thermal/tegra/soctherm.c
> @@ -742,7 +742,7 @@ static int tegra_soctherm_set_hwtrips(struct device *dev,
> /* Get thermtrips. If missing, try to get critical trips. */
> temperature = tsensor_group_thermtrip_get(ts, sg->id);
> if (min_low_temp == temperature)
> - if (tz->ops->get_crit_temp(tz, &temperature))
> + if (thermal_zone_get_crit_temp(tz, &temperature))
> temperature = max_high_temp;
>
> ret = thermtrip_program(dev, sg, temperature);
Any feedback on this? OK to take this fix?
Thanks
Jon
--
nvpublic
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] thermal/drivers/tegra: Fix crash when getting critical temp
2022-10-21 9:49 ` Jon Hunter
@ 2022-10-21 10:41 ` Daniel Lezcano
0 siblings, 0 replies; 5+ messages in thread
From: Daniel Lezcano @ 2022-10-21 10:41 UTC (permalink / raw)
To: Jon Hunter, Rafael J . Wysocki, Thierry Reding; +Cc: linux-pm, linux-tegra
On 21/10/2022 11:49, Jon Hunter wrote:
> Hi Rafael,
>
> On 10/10/2022 16:03, Jon Hunter wrote:
>> Commit 13bea86623be ("thermal/of: Remove of_thermal_get_crit_temp()")
>> removed the function of_thermal_get_crit_temp() and this is causing a
>> NULL pointer deference crash when attempting to call the 'get_crit_temp'
>> function pointer because this function pointer is no longer initialised.
>> Fix this by replacing the call to the 'get_crit_temp' function pointer
>> with a call to the function thermal_zone_get_crit_temp() instead.
>>
>> Fixes: 13bea86623be ("thermal/of: Remove of_thermal_get_crit_temp()")
>> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
>> ---
>> drivers/thermal/tegra/soctherm.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/thermal/tegra/soctherm.c
>> b/drivers/thermal/tegra/soctherm.c
>> index d2e454902689..4203e74e2f79 100644
>> --- a/drivers/thermal/tegra/soctherm.c
>> +++ b/drivers/thermal/tegra/soctherm.c
>> @@ -742,7 +742,7 @@ static int tegra_soctherm_set_hwtrips(struct
>> device *dev,
>> /* Get thermtrips. If missing, try to get critical trips. */
>> temperature = tsensor_group_thermtrip_get(ts, sg->id);
>> if (min_low_temp == temperature)
>> - if (tz->ops->get_crit_temp(tz, &temperature))
>> + if (thermal_zone_get_crit_temp(tz, &temperature))
>> temperature = max_high_temp;
>> ret = thermtrip_program(dev, sg, temperature);
>
I'll take it
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] thermal/drivers/tegra: Fix crash when getting critical temp
2022-10-10 15:03 [PATCH] thermal/drivers/tegra: Fix crash when getting critical temp Jon Hunter
2022-10-21 9:49 ` Jon Hunter
@ 2022-10-21 10:51 ` Daniel Lezcano
2022-12-09 15:26 ` [thermal: thermal/next] " thermal-bot for Jon Hunter
2 siblings, 0 replies; 5+ messages in thread
From: Daniel Lezcano @ 2022-10-21 10:51 UTC (permalink / raw)
To: Jon Hunter, Rafael J . Wysocki, Thierry Reding; +Cc: linux-pm, linux-tegra
On 10/10/2022 17:03, Jon Hunter wrote:
> Commit 13bea86623be ("thermal/of: Remove of_thermal_get_crit_temp()")
> removed the function of_thermal_get_crit_temp() and this is causing a
> NULL pointer deference crash when attempting to call the 'get_crit_temp'
> function pointer because this function pointer is no longer initialised.
> Fix this by replacing the call to the 'get_crit_temp' function pointer
> with a call to the function thermal_zone_get_crit_temp() instead.
>
> Fixes: 13bea86623be ("thermal/of: Remove of_thermal_get_crit_temp()")
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
> ---
Applied, thanks
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
^ permalink raw reply [flat|nested] 5+ messages in thread
* [thermal: thermal/next] thermal/drivers/tegra: Fix crash when getting critical temp
2022-10-10 15:03 [PATCH] thermal/drivers/tegra: Fix crash when getting critical temp Jon Hunter
2022-10-21 9:49 ` Jon Hunter
2022-10-21 10:51 ` Daniel Lezcano
@ 2022-12-09 15:26 ` thermal-bot for Jon Hunter
2 siblings, 0 replies; 5+ messages in thread
From: thermal-bot for Jon Hunter @ 2022-12-09 15:26 UTC (permalink / raw)
To: linux-pm; +Cc: Jon Hunter, Daniel Lezcano, rui.zhang, amitk
The following commit has been merged into the thermal/next branch of thermal:
Commit-ID: 340e74d08972239f8ec6ad3bed706b360162f293
Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//340e74d08972239f8ec6ad3bed706b360162f293
Author: Jon Hunter <jonathanh@nvidia.com>
AuthorDate: Mon, 10 Oct 2022 16:03:11 +01:00
Committer: Daniel Lezcano <daniel.lezcano@kernel.org>
CommitterDate: Thu, 08 Dec 2022 14:30:43 +01:00
thermal/drivers/tegra: Fix crash when getting critical temp
Commit 13bea86623be ("thermal/of: Remove of_thermal_get_crit_temp()")
removed the function of_thermal_get_crit_temp() and this is causing a
NULL pointer deference crash when attempting to call the 'get_crit_temp'
function pointer because this function pointer is no longer initialised.
Fix this by replacing the call to the 'get_crit_temp' function pointer
with a call to the function thermal_zone_get_crit_temp() instead.
Fixes: 13bea86623be ("thermal/of: Remove of_thermal_get_crit_temp()")
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Link: https://lore.kernel.org/r/20221010150311.40384-1-jonathanh@nvidia.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
drivers/thermal/tegra/soctherm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/thermal/tegra/soctherm.c b/drivers/thermal/tegra/soctherm.c
index d2e4549..4203e74 100644
--- a/drivers/thermal/tegra/soctherm.c
+++ b/drivers/thermal/tegra/soctherm.c
@@ -742,7 +742,7 @@ static int tegra_soctherm_set_hwtrips(struct device *dev,
/* Get thermtrips. If missing, try to get critical trips. */
temperature = tsensor_group_thermtrip_get(ts, sg->id);
if (min_low_temp == temperature)
- if (tz->ops->get_crit_temp(tz, &temperature))
+ if (thermal_zone_get_crit_temp(tz, &temperature))
temperature = max_high_temp;
ret = thermtrip_program(dev, sg, temperature);
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-12-09 15:27 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-10 15:03 [PATCH] thermal/drivers/tegra: Fix crash when getting critical temp Jon Hunter
2022-10-21 9:49 ` Jon Hunter
2022-10-21 10:41 ` Daniel Lezcano
2022-10-21 10:51 ` Daniel Lezcano
2022-12-09 15:26 ` [thermal: thermal/next] " thermal-bot for Jon Hunter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox