From patchwork Sat Nov 24 23:45:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikulas Patocka X-Patchwork-Id: 10696617 X-Patchwork-Delegate: eduardo.valentin@ti.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0BEBB15A8 for ; Sat, 24 Nov 2018 23:45:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0C3229F01 for ; Sat, 24 Nov 2018 23:45:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D99D729F68; Sat, 24 Nov 2018 23:45:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 839B129F01 for ; Sat, 24 Nov 2018 23:45:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726692AbeKYKem (ORCPT ); Sun, 25 Nov 2018 05:34:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59972 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726639AbeKYKek (ORCPT ); Sun, 25 Nov 2018 05:34:40 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0CA5CA4D21; Sat, 24 Nov 2018 23:45:03 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (file01.intranet.prod.int.rdu2.redhat.com [10.11.5.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A5E18BF674; Sat, 24 Nov 2018 23:45:02 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (localhost [127.0.0.1]) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4) with ESMTP id wAONj2rl008664; Sat, 24 Nov 2018 18:45:02 -0500 Received: from localhost (mpatocka@localhost) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4/Submit) with ESMTP id wAONj0fv008660; Sat, 24 Nov 2018 18:45:01 -0500 X-Authentication-Warning: file01.intranet.prod.int.rdu2.redhat.com: mpatocka owned process doing -bs Date: Sat, 24 Nov 2018 18:45:00 -0500 (EST) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: Miquel Raynal , Zhang Rui , Eduardo Valentin cc: Russell King , linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Subject: [PATCH] thermal: armada: fix broken temperature sensor in 4.19 Message-ID: User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Sat, 24 Nov 2018 23:45:03 +0000 (UTC) Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 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;