All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] thermal/drivers/mediatek: fix temperature on mt7986
@ 2023-09-01  6:37 ` Frank Wunderlich
  0 siblings, 0 replies; 6+ messages in thread
From: Frank Wunderlich @ 2023-09-01  6:37 UTC (permalink / raw)
  To: linux-mediatek
  Cc: Frank Wunderlich, Daniel Lezcano, Amit Kucheria, Zhang Rui,
	Matthias Brugger, AngeloGioacchino Del Regno, Amjad Ouled-Ameur,
	Daniel Golle, linux-pm, linux-kernel, linux-arm-kernel, stable

From: Frank Wunderlich <frank-w@public-files.de>

Reading thermal sensor on mt7986 devices returns invalid temperature:

bpi-r3 ~ # cat /sys/class/thermal/thermal_zone0/temp
 -274000

Fix this by adding missing members in mtk_thermal_data struct which were
used in mtk_thermal_turn_on_buffer after commit 33140e668b10.

Cc: stable@vger.kernel.org
Fixes: 33140e668b10 ("thermal/drivers/mediatek: Control buffer enablement tweaks")
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
 drivers/thermal/mediatek/auxadc_thermal.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/thermal/mediatek/auxadc_thermal.c b/drivers/thermal/mediatek/auxadc_thermal.c
index f59d36de20a0..ed08767eaa60 100644
--- a/drivers/thermal/mediatek/auxadc_thermal.c
+++ b/drivers/thermal/mediatek/auxadc_thermal.c
@@ -691,6 +691,9 @@ static const struct mtk_thermal_data mt7986_thermal_data = {
 	.adcpnp = mt7986_adcpnp,
 	.sensor_mux_values = mt7986_mux_values,
 	.version = MTK_THERMAL_V3,
+	.apmixed_buffer_ctl_reg = APMIXED_SYS_TS_CON1,
+	.apmixed_buffer_ctl_mask = GENMASK(31, 6) | BIT(3),
+	.apmixed_buffer_ctl_set = BIT(0),
 };
 
 static bool mtk_thermal_temp_is_valid(int temp)
-- 
2.34.1


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

* [RFC] thermal/drivers/mediatek: fix temperature on mt7986
@ 2023-09-01  6:37 ` Frank Wunderlich
  0 siblings, 0 replies; 6+ messages in thread
From: Frank Wunderlich @ 2023-09-01  6:37 UTC (permalink / raw)
  To: linux-mediatek
  Cc: Daniel Lezcano, linux-pm, Amit Kucheria, Daniel Golle, stable,
	linux-kernel, Amjad Ouled-Ameur, Matthias Brugger, Zhang Rui,
	linux-arm-kernel, AngeloGioacchino Del Regno

From: Frank Wunderlich <frank-w@public-files.de>

Reading thermal sensor on mt7986 devices returns invalid temperature:

bpi-r3 ~ # cat /sys/class/thermal/thermal_zone0/temp
 -274000

Fix this by adding missing members in mtk_thermal_data struct which were
used in mtk_thermal_turn_on_buffer after commit 33140e668b10.

Cc: stable@vger.kernel.org
Fixes: 33140e668b10 ("thermal/drivers/mediatek: Control buffer enablement tweaks")
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
 drivers/thermal/mediatek/auxadc_thermal.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/thermal/mediatek/auxadc_thermal.c b/drivers/thermal/mediatek/auxadc_thermal.c
index f59d36de20a0..ed08767eaa60 100644
--- a/drivers/thermal/mediatek/auxadc_thermal.c
+++ b/drivers/thermal/mediatek/auxadc_thermal.c
@@ -691,6 +691,9 @@ static const struct mtk_thermal_data mt7986_thermal_data = {
 	.adcpnp = mt7986_adcpnp,
 	.sensor_mux_values = mt7986_mux_values,
 	.version = MTK_THERMAL_V3,
+	.apmixed_buffer_ctl_reg = APMIXED_SYS_TS_CON1,
+	.apmixed_buffer_ctl_mask = GENMASK(31, 6) | BIT(3),
+	.apmixed_buffer_ctl_set = BIT(0),
 };
 
 static bool mtk_thermal_temp_is_valid(int temp)
-- 
2.34.1



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

* [RFC] thermal/drivers/mediatek: fix temperature on mt7986
@ 2023-09-01  6:37 ` Frank Wunderlich
  0 siblings, 0 replies; 6+ messages in thread
From: Frank Wunderlich @ 2023-09-01  6:37 UTC (permalink / raw)
  To: linux-mediatek
  Cc: Frank Wunderlich, Daniel Lezcano, Amit Kucheria, Zhang Rui,
	Matthias Brugger, AngeloGioacchino Del Regno, Amjad Ouled-Ameur,
	Daniel Golle, linux-pm, linux-kernel, linux-arm-kernel, stable

From: Frank Wunderlich <frank-w@public-files.de>

Reading thermal sensor on mt7986 devices returns invalid temperature:

bpi-r3 ~ # cat /sys/class/thermal/thermal_zone0/temp
 -274000

Fix this by adding missing members in mtk_thermal_data struct which were
used in mtk_thermal_turn_on_buffer after commit 33140e668b10.

Cc: stable@vger.kernel.org
Fixes: 33140e668b10 ("thermal/drivers/mediatek: Control buffer enablement tweaks")
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
 drivers/thermal/mediatek/auxadc_thermal.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/thermal/mediatek/auxadc_thermal.c b/drivers/thermal/mediatek/auxadc_thermal.c
index f59d36de20a0..ed08767eaa60 100644
--- a/drivers/thermal/mediatek/auxadc_thermal.c
+++ b/drivers/thermal/mediatek/auxadc_thermal.c
@@ -691,6 +691,9 @@ static const struct mtk_thermal_data mt7986_thermal_data = {
 	.adcpnp = mt7986_adcpnp,
 	.sensor_mux_values = mt7986_mux_values,
 	.version = MTK_THERMAL_V3,
+	.apmixed_buffer_ctl_reg = APMIXED_SYS_TS_CON1,
+	.apmixed_buffer_ctl_mask = GENMASK(31, 6) | BIT(3),
+	.apmixed_buffer_ctl_set = BIT(0),
 };
 
 static bool mtk_thermal_temp_is_valid(int temp)
-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [RFC] thermal/drivers/mediatek: fix temperature on mt7986
  2023-09-01  6:37 ` Frank Wunderlich
  (?)
@ 2023-09-07  9:12   ` AngeloGioacchino Del Regno
  -1 siblings, 0 replies; 6+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-09-07  9:12 UTC (permalink / raw)
  To: Frank Wunderlich, linux-mediatek
  Cc: Daniel Lezcano, linux-pm, Amit Kucheria, Daniel Golle, stable,
	linux-kernel, Amjad Ouled-Ameur, Matthias Brugger, Zhang Rui,
	linux-arm-kernel

Il 01/09/23 08:37, Frank Wunderlich ha scritto:
> From: Frank Wunderlich <frank-w@public-files.de>
> 
> Reading thermal sensor on mt7986 devices returns invalid temperature:
> 
> bpi-r3 ~ # cat /sys/class/thermal/thermal_zone0/temp
>   -274000
> 
> Fix this by adding missing members in mtk_thermal_data struct which were
> used in mtk_thermal_turn_on_buffer after commit 33140e668b10.
> 
> Cc: stable@vger.kernel.org
> Fixes: 33140e668b10 ("thermal/drivers/mediatek: Control buffer enablement tweaks")
> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>

If you resend this commit without the RFC tag I can give you a R-b.

This is totally correct, as the buffer control is for version >= THERMAL_V2, and
the others being V1 don't need it - the only one that was left out is effectively
just mt7986 (probably because the commits landed around the same time).

Though, since you have to anyway resend this, I would suggest to change the commit
title to something more effective, like

thermal/drivers/mediatek: Fix control buffer enablement on MT7896

Cheers,
Angelo

> ---
>   drivers/thermal/mediatek/auxadc_thermal.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/thermal/mediatek/auxadc_thermal.c b/drivers/thermal/mediatek/auxadc_thermal.c
> index f59d36de20a0..ed08767eaa60 100644
> --- a/drivers/thermal/mediatek/auxadc_thermal.c
> +++ b/drivers/thermal/mediatek/auxadc_thermal.c
> @@ -691,6 +691,9 @@ static const struct mtk_thermal_data mt7986_thermal_data = {
>   	.adcpnp = mt7986_adcpnp,
>   	.sensor_mux_values = mt7986_mux_values,
>   	.version = MTK_THERMAL_V3,
> +	.apmixed_buffer_ctl_reg = APMIXED_SYS_TS_CON1,
> +	.apmixed_buffer_ctl_mask = GENMASK(31, 6) | BIT(3),
> +	.apmixed_buffer_ctl_set = BIT(0),
>   };
>   
>   static bool mtk_thermal_temp_is_valid(int temp)




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

* Re: [RFC] thermal/drivers/mediatek: fix temperature on mt7986
@ 2023-09-07  9:12   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 6+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-09-07  9:12 UTC (permalink / raw)
  To: Frank Wunderlich, linux-mediatek
  Cc: Frank Wunderlich, Daniel Lezcano, Amit Kucheria, Zhang Rui,
	Matthias Brugger, Amjad Ouled-Ameur, Daniel Golle, linux-pm,
	linux-kernel, linux-arm-kernel, stable

Il 01/09/23 08:37, Frank Wunderlich ha scritto:
> From: Frank Wunderlich <frank-w@public-files.de>
> 
> Reading thermal sensor on mt7986 devices returns invalid temperature:
> 
> bpi-r3 ~ # cat /sys/class/thermal/thermal_zone0/temp
>   -274000
> 
> Fix this by adding missing members in mtk_thermal_data struct which were
> used in mtk_thermal_turn_on_buffer after commit 33140e668b10.
> 
> Cc: stable@vger.kernel.org
> Fixes: 33140e668b10 ("thermal/drivers/mediatek: Control buffer enablement tweaks")
> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>

If you resend this commit without the RFC tag I can give you a R-b.

This is totally correct, as the buffer control is for version >= THERMAL_V2, and
the others being V1 don't need it - the only one that was left out is effectively
just mt7986 (probably because the commits landed around the same time).

Though, since you have to anyway resend this, I would suggest to change the commit
title to something more effective, like

thermal/drivers/mediatek: Fix control buffer enablement on MT7896

Cheers,
Angelo

> ---
>   drivers/thermal/mediatek/auxadc_thermal.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/thermal/mediatek/auxadc_thermal.c b/drivers/thermal/mediatek/auxadc_thermal.c
> index f59d36de20a0..ed08767eaa60 100644
> --- a/drivers/thermal/mediatek/auxadc_thermal.c
> +++ b/drivers/thermal/mediatek/auxadc_thermal.c
> @@ -691,6 +691,9 @@ static const struct mtk_thermal_data mt7986_thermal_data = {
>   	.adcpnp = mt7986_adcpnp,
>   	.sensor_mux_values = mt7986_mux_values,
>   	.version = MTK_THERMAL_V3,
> +	.apmixed_buffer_ctl_reg = APMIXED_SYS_TS_CON1,
> +	.apmixed_buffer_ctl_mask = GENMASK(31, 6) | BIT(3),
> +	.apmixed_buffer_ctl_set = BIT(0),
>   };
>   
>   static bool mtk_thermal_temp_is_valid(int temp)



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [RFC] thermal/drivers/mediatek: fix temperature on mt7986
@ 2023-09-07  9:12   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 6+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-09-07  9:12 UTC (permalink / raw)
  To: Frank Wunderlich, linux-mediatek
  Cc: Frank Wunderlich, Daniel Lezcano, Amit Kucheria, Zhang Rui,
	Matthias Brugger, Amjad Ouled-Ameur, Daniel Golle, linux-pm,
	linux-kernel, linux-arm-kernel, stable

Il 01/09/23 08:37, Frank Wunderlich ha scritto:
> From: Frank Wunderlich <frank-w@public-files.de>
> 
> Reading thermal sensor on mt7986 devices returns invalid temperature:
> 
> bpi-r3 ~ # cat /sys/class/thermal/thermal_zone0/temp
>   -274000
> 
> Fix this by adding missing members in mtk_thermal_data struct which were
> used in mtk_thermal_turn_on_buffer after commit 33140e668b10.
> 
> Cc: stable@vger.kernel.org
> Fixes: 33140e668b10 ("thermal/drivers/mediatek: Control buffer enablement tweaks")
> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>

If you resend this commit without the RFC tag I can give you a R-b.

This is totally correct, as the buffer control is for version >= THERMAL_V2, and
the others being V1 don't need it - the only one that was left out is effectively
just mt7986 (probably because the commits landed around the same time).

Though, since you have to anyway resend this, I would suggest to change the commit
title to something more effective, like

thermal/drivers/mediatek: Fix control buffer enablement on MT7896

Cheers,
Angelo

> ---
>   drivers/thermal/mediatek/auxadc_thermal.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/thermal/mediatek/auxadc_thermal.c b/drivers/thermal/mediatek/auxadc_thermal.c
> index f59d36de20a0..ed08767eaa60 100644
> --- a/drivers/thermal/mediatek/auxadc_thermal.c
> +++ b/drivers/thermal/mediatek/auxadc_thermal.c
> @@ -691,6 +691,9 @@ static const struct mtk_thermal_data mt7986_thermal_data = {
>   	.adcpnp = mt7986_adcpnp,
>   	.sensor_mux_values = mt7986_mux_values,
>   	.version = MTK_THERMAL_V3,
> +	.apmixed_buffer_ctl_reg = APMIXED_SYS_TS_CON1,
> +	.apmixed_buffer_ctl_mask = GENMASK(31, 6) | BIT(3),
> +	.apmixed_buffer_ctl_set = BIT(0),
>   };
>   
>   static bool mtk_thermal_temp_is_valid(int temp)



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

end of thread, other threads:[~2023-09-07 16:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-01  6:37 [RFC] thermal/drivers/mediatek: fix temperature on mt7986 Frank Wunderlich
2023-09-01  6:37 ` Frank Wunderlich
2023-09-01  6:37 ` Frank Wunderlich
2023-09-07  9:12 ` AngeloGioacchino Del Regno
2023-09-07  9:12   ` AngeloGioacchino Del Regno
2023-09-07  9:12   ` AngeloGioacchino Del Regno

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.