From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mikulas Patocka Subject: Re: [PATCH] thermal: armada: fix broken temperature sensor in 4.19 Date: Sat, 24 Nov 2018 18:53:13 -0500 (EST) Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Miquel Raynal , Zhang Rui , Eduardo Valentin Cc: Russell King , linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org List-Id: linux-pm@vger.kernel.org On Sat, 24 Nov 2018, Mikulas Patocka wrote: > 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@vger.kernel.org # 4.19 I should have added: Signed-off-by: Mikulas Patocka > --- > drivers/thermal/armada_thermal.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > Index: linux-4.19.4/drivers/thermal/armada_thermal.c > =================================================================== > --- linux-4.19.4.orig/drivers/thermal/armada_thermal.c 2018-11-25 00:19:20.000000000 +0100 > +++ linux-4.19.4/drivers/thermal/armada_thermal.c 2018-11-25 00:39:49.000000000 +0100 > @@ -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; > From mboxrd@z Thu Jan 1 00:00:00 1970 From: mpatocka@redhat.com (Mikulas Patocka) Date: Sat, 24 Nov 2018 18:53:13 -0500 (EST) Subject: [PATCH] thermal: armada: fix broken temperature sensor in 4.19 In-Reply-To: References: Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Sat, 24 Nov 2018, Mikulas Patocka wrote: > 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 I should have added: Signed-off-by: Mikulas Patocka > --- > drivers/thermal/armada_thermal.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > Index: linux-4.19.4/drivers/thermal/armada_thermal.c > =================================================================== > --- linux-4.19.4.orig/drivers/thermal/armada_thermal.c 2018-11-25 00:19:20.000000000 +0100 > +++ linux-4.19.4/drivers/thermal/armada_thermal.c 2018-11-25 00:39:49.000000000 +0100 > @@ -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; >