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: 10696619 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 360D515A8 for ; Sat, 24 Nov 2018 23:45:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2437329F01 for ; Sat, 24 Nov 2018 23:45:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1708029F66; Sat, 24 Nov 2018 23:45:23 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BE00729F01 for ; Sat, 24 Nov 2018 23:45:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From :Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=HihUrEKd6dgvncWOJTceFZcURU+huihcVkRZTuANJ8Y=; b=RPWsER96XNE3mV SAb0tUyKP3OrgH+jr/fzjEhc2JD46ATOXPDND6TYo7qbAz57091peDDL0HbSrEbEjA9AMIySKRSBP uWiC8mcvTEzlT3ARU4H0dTBxK+5YRonVDvWsEeiJc6IFhi7/XvQNtuY28m2WSdjbxxCZzCzSV714g 30KTJjNRMny3R8VLBiEg6fXyE+wOHYML3Zfkqv7Vv7Slar3dUUrfFXhmXwkDUT0BJroraBReqYGv4 nx7qd69CUilvTLvAsYU984XElgSAdW1cyecb71sbbbnAAdO2MpCwUI1ys74PI610erlOi4Z+hG9+4 OYIw26w1kZjeOe83c4bA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gQhby-0003ei-WA; Sat, 24 Nov 2018 23:45:19 +0000 Received: from mx1.redhat.com ([209.132.183.28]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gQhbv-0002aj-E0 for linux-arm-kernel@lists.infradead.org; Sat, 24 Nov 2018 23:45:17 +0000 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 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) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181124_154515_514657_2EFB0904 X-CRM114-Status: GOOD ( 17.45 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Russell King , linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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;