Skip to contentSkip to conversation

thermal: armada: fix broken temperature sensor in 4.19

PATCH New Mikulas Patocka 3 participants 4 messages Nov 24, 2018 – Dec 5, 2018

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

PATCH 1/1 thermal: armada: fix broken temperature sensor in 4.19

The patch 8c0e64ac4075b7ca870098ed2ad6089868f5fa7b ("thermal: armada: get rid of the ->is_valid() pointer") breaks temperature readings on the MacchiatoBIN board. Reading the temperature with
cat /sys/devices/virtual/thermal/thermal_zone*/temp
results in errors:

armada_thermal f06f808c.thermal: Temperature sensor reading not valid armada_thermal f2400078.thermal: Temperature sensor reading not valid armada_thermal f4400078.thermal: Temperature sensor reading not valid

The patch was meant as simple refactoring, but unfortunatelly, it reverses the condition in armada_get_temp_legacy, so that the error is reported if armada_is_valid returns true.

Fixes 8c0e64ac4075 ("thermal: armada: get rid of the ->is_valid() pointer")
Cc stable at vger.kernel.org # 4.19
---
 drivers/thermal/armada_thermal.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/armada_thermal.c +1 -1
Index: linux-4.19.4/drivers/thermal/armada_thermal.c
===================================================================
@@ -357,7 +357,7 @@ static int armada_get_temp_legacy(struct
 	int ret;
 
 	/* Valid check */
-	if (armada_is_valid(priv)) {
+	if (!armada_is_valid(priv)) {
 		dev_err(priv->dev,
 			"Temperature sensor reading not valid\n");
 		return -EIO;
#1 lore raw

PATCH 1/1 thermal: armada: fix broken temperature sensor in 4.19

Quoted 10 lines · Mikulas Patocka

The patch 8c0e64ac4075b7ca870098ed2ad6089868f5fa7b ("thermal: armada: get rid of the ->is_valid() pointer") breaks temperature readings on the MacchiatoBIN board. Reading the temperature with
cat /sys/devices/virtual/thermal/thermal_zone*/temp
results in errors:

armada_thermal f06f808c.thermal: Temperature sensor reading not valid armada_thermal f2400078.thermal: Temperature sensor reading not valid armada_thermal f4400078.thermal: Temperature sensor reading not valid

Quoted 6 lines

The patch was meant as simple refactoring, but unfortunatelly, it reverses the condition in armada_get_temp_legacy, so that the error is reported if armada_is_valid returns true.

Fixes 8c0e64ac4075 ("thermal: armada: get rid of the ->is_valid() pointer")
Cc stable at vger.kernel.org # 4.19

I should have added:

Quoted 18 lines
---
 drivers/thermal/armada_thermal.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-4.19.4/drivers/thermal/armada_thermal.c
===================================================================

drivers/thermal/armada_thermal.c +1 -1
@@ -357,7 +357,7 @@ static int armada_get_temp_legacy(struct
 	int ret;
 
 	/* Valid check */
-	if (armada_is_valid(priv)) {
+	if (!armada_is_valid(priv)) {
 		dev_err(priv->dev,
 			"Temperature sensor reading not valid\n");
 		return -EIO;
#2 lore raw

PATCH 1/1 thermal: armada: fix broken temperature sensor in 4.19

In reply to Mikulas Patocka
Quoted 6 lines · Mikulas Patocka

The patch 8c0e64ac4075b7ca870098ed2ad6089868f5fa7b ("thermal: armada: get rid of the ->is_valid() pointer") breaks temperature readings on the MacchiatoBIN board. Reading the temperature with
cat /sys/devices/virtual/thermal/thermal_zone*/temp
results in errors:

Quoted 7 lines

armada_thermal f06f808c.thermal: Temperature sensor reading not valid armada_thermal f2400078.thermal: Temperature sensor reading not valid armada_thermal f4400078.thermal: Temperature sensor reading not valid

The patch was meant as simple refactoring, but unfortunatelly, it reverses the condition in armada_get_temp_legacy, so that the error is reported if armada_is_valid returns true.

I sent a patch for exactly this issue on 9th November... it doesn't seem to have made it into mainline yet.

Quoted 21 lines
Fixes 8c0e64ac4075 ("thermal: armada: get rid of the ->is_valid() pointer")
Cc stable at vger.kernel.org # 4.19
---
 drivers/thermal/armada_thermal.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-4.19.4/drivers/thermal/armada_thermal.c
===================================================================

drivers/thermal/armada_thermal.c +1 -1
@@ -357,7 +357,7 @@ static int armada_get_temp_legacy(struct
 	int ret;
 
 	/* Valid check */
-	if (armada_is_valid(priv)) {
+	if (!armada_is_valid(priv)) {
 		dev_err(priv->dev,
 			"Temperature sensor reading not valid\n");
 		return -EIO;
Signature · 3 lines
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up
#3 lore raw
Quoted 11 lines · Russell King - ARM Linux
Quoted 10 lines · Mikulas Patocka

The patch 8c0e64ac4075b7ca870098ed2ad6089868f5fa7b ("thermal: armada: get rid of the ->is_valid() pointer") breaks temperature readings on the MacchiatoBIN board. Reading the temperature with
cat /sys/devices/virtual/thermal/thermal_zone*/temp
results in errors:

armada_thermal f06f808c.thermal: Temperature sensor reading not valid armada_thermal f2400078.thermal: Temperature sensor reading not valid armada_thermal f4400078.thermal: Temperature sensor reading not valid

Quoted 6 lines
Quoted 3 lines

The patch was meant as simple refactoring, but unfortunatelly, it reverses the condition in armada_get_temp_legacy, so that the error is reported if armada_is_valid returns true.

I sent a patch for exactly this issue on 9th November... it doesn't seem to have made it into mainline yet.

I applied Russell's patch.

Quoted 27 lines
Quoted 22 lines
Fixes 8c0e64ac4075 ("thermal: armada: get rid of the ->is_valid() pointer")
---
 drivers/thermal/armada_thermal.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-4.19.4/drivers/thermal/armada_thermal.c
===================================================================

drivers/thermal/armada_thermal.c +1 -1
@@ -357,7 +357,7 @@ static int armada_get_temp_legacy(struct
 	int ret;
 
 	/* Valid check */
-	if (armada_is_valid(priv)) {
+	if (!armada_is_valid(priv)) {
 		dev_err(priv->dev,
 			"Temperature sensor reading not valid\n");
 		return -EIO;
Signature · 3 lines
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up