Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1742825imm; Fri, 7 Sep 2018 05:33:50 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZGKbqdxo/Sh7z5e5jTCvD1Sx33YjBlV/lFfCwfkVdtSUxK0uNK/a5Cgt2qFJOjGA2w3+zE X-Received: by 2002:a62:9b46:: with SMTP id r67-v6mr8225842pfd.105.1536323630601; Fri, 07 Sep 2018 05:33:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536323630; cv=none; d=google.com; s=arc-20160816; b=XT/tlITcnlu+gJbvZjDGK/5WGbRwpaP7bHzu5FL1vmqmE+/AtWOn/OhLaqzJdiba7N NTHHyeEUtFea3BwrB78Cl3pLsneyO0BrLP/+wPPejmw4EKb/YZQ2i0gNllCaLeTa0K3J 3eHIhmsEW/kjv+0zsL5JkVURlRfohOAPrS3USBB2az7g3ze3dKZ4Ytcr53c1Bm7PdVlK Y6U6qxqIcOiIKdv8kOyIeM7sL+fGtytbGr34NeAAi3AdCaGuFXWh2Mb6c7VoZFNzstm5 oy9SdzbNh7xq9AZnNs8xNvIPOBkThpIAUt2U+U4w+Fgai+wjDLMS1Z3inJ6g1pdMNEyB 0qVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=LYrc8IKn7rSv/p3ceJbS3mXhFV2T5pWwm2SJNHKqeFk=; b=CtBEtmSJLaSecSpRq9hunWmeOPjZul8u7CgRV28XMFPjICqfq/q7bN6ku6MnbyyFYJ /pp5ikLrexllJr3tFbQj4NYEv52O3evBvRcEmY9sn58ktGo7xb9gYhxkEwhiIOdaolKp z+QNZt96s03dBN/RroBqgKJEWjX6sB9QtIahtJc0D+s+Tmy6Ln2G/Bag/N7K8acNSS+k Ar94f0X3KB+RHxxeLeEHqaXZYTfmluGuyoX5tBBzqd42n+TFUuFhK2DCYbShqzvtuFZs z9kz23uQaybWwJfKdKrVg7kyyfWzh/yi0mMP4Z+2WbUazly4/Z1tUq4bQZu5tLh5vgMl oTww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@verdurent-com.20150623.gappssmtp.com header.s=20150623 header.b=H+jLhHyu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f29-v6si8549631pgl.570.2018.09.07.05.33.32; Fri, 07 Sep 2018 05:33:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@verdurent-com.20150623.gappssmtp.com header.s=20150623 header.b=H+jLhHyu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728248AbeIGNuC (ORCPT + 99 others); Fri, 7 Sep 2018 09:50:02 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:37229 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727704AbeIGNuC (ORCPT ); Fri, 7 Sep 2018 09:50:02 -0400 Received: by mail-oi0-f65.google.com with SMTP id p84-v6so26014396oic.4 for ; Fri, 07 Sep 2018 02:10:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=verdurent-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=LYrc8IKn7rSv/p3ceJbS3mXhFV2T5pWwm2SJNHKqeFk=; b=H+jLhHyu+W+ABq8HYW86DD8aLNzHUdDPDEUs587+pP3d9nDl41mc1WYfM8pon533MW KotlJjss3uPGN9wV75BTWY0lN2tr9X0zufo7dCAvBrTxaHaWFI1/oX7kA3J5NqNxyhH7 CChJKpaHDyV9yVJSaqmI05P+9EDcIKEFKsC26LkHpbEL8/OkCE2816BclFfJFReUE6Sk 3IL4rJ+ze9vtGq/IlM6YvI2foDkBAEFH/QufY0cuRYdq2MflA1aJKhBMIIYKp1Mbstig BrUUhWyqru3/gvGErQyO3ySWnTvZW0e59pDyPSfsj/wY0VsBv1yWrF0bMDb3GMA6M9/d RcBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=LYrc8IKn7rSv/p3ceJbS3mXhFV2T5pWwm2SJNHKqeFk=; b=k6E4D3sb2SyC4tMlCh6XUhNt1kXt4x+m9hwBazhiYVkrmoZC+EheFnajtObh6bF1JM Y9aGhKxEv83f1D6PEhgo5QRWlNOHLd8a0ncotl+9+QRSF0WINa8JjkC0tCxUG2024rZD vMib29Jf4GHDVqX8pEGlaY25jRh28UQiLEO8KrDZ0Zm20LBsT5nIPxhHy6/5VTbz8pne QfMSxm0kxeDXx38EnXOE5vCSKggbiplxgNQ57s1jjjVR+gNr9w2vvmx1z+jMzua600aX 0xFqt5+jBoVq5PcTNmu95FklkFBiNhGIbk3cEnlB89gwoKBd98jIVxzaTgdKx4HxzxYX IOug== X-Gm-Message-State: APzg51CVYeOUzOd4nt7aal+TnYse4j1iyrNXv8tNdLu/2ALL8sPPRb0J IqBzh8a1G2Kea4kv7yFYnNaEnxvcsy2pnbdNhnC7JA== X-Received: by 2002:aca:a6d4:: with SMTP id t81-v6mr6821424oij.113.1536311401722; Fri, 07 Sep 2018 02:10:01 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4a:684a:0:0:0:0:0 with HTTP; Fri, 7 Sep 2018 02:10:00 -0700 (PDT) In-Reply-To: <1523364131-31059-1-git-send-email-b.zolnierkie@samsung.com> References: <1523364131-31059-1-git-send-email-b.zolnierkie@samsung.com> From: Amit Kucheria Date: Fri, 7 Sep 2018 14:40:00 +0530 Message-ID: Subject: Re: [PATCH 00/17] thermal: enable/check sensor after its setup is finished To: Bartlomiej Zolnierkiewicz Cc: Zhang Rui , Eduardo Valentin , Eric Anholt , Stefan Wahren , Markus Mayer , bcm-kernel-feedback-list@broadcom.com, Heiko Stuebner , Thierry Reding , Jonathan Hunter , Keerthy , Masahiro Yamada , Jun Nie , Baoyou Xie , Shawn Guo , Linux PM list , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Bartlomiej, Do you have an updated version of this patchset on 4.19-rc1 somewhere that I can look at? I might be seeing this issue on the QCom TSENS driver and would like to verify. Regards, Amit On Tue, Apr 10, 2018 at 6:11 PM, Bartlomiej Zolnierkiewicz wrote: > Hi, > > [devm]_thermal_zone_of_sensor_register() is used to register > thermal sensor by thermal drivers using DeviceTree. Besides > registering sensor this function also immediately enables it > (using ->set_mode method) and then checks it with a update call > to the thermal core (which ends up using ->get_temp method). > For many DT thermal drivers this causes a problem because > [devm]_thermal_zone_of_sensor_register() need to be called in > order to obtain data about thermal trips which are then used to > finish hardware sensor setup (only after which ->get_temp can > be used). The issue has been observed when using Samsung Exynos > thermal driver and fixed internally in the driver in commit > d8efad71e5b6 ("thermal: exynos: Reading temperature makes sense > only when TMU is turned on"). However after this commit there > are now following warnings from the thermal core visible: > > [ 3.453602] thermal thermal_zone0: failed to read out thermal zone (-22) > [ 3.483468] thermal thermal_zone1: failed to read out thermal zone (-22) > [ 3.505965] thermal thermal_zone2: failed to read out thermal zone (-22) > [ 3.528455] thermal thermal_zone3: failed to read out thermal zone (-22) > [ 3.550939] thermal thermal_zone4: failed to read out thermal zone (-22) > > This patchset attempts to directly address the thermal core > problem with [devm]_thermal_zone_of_sensor_register() and > affected DT thermal drivers. In order to achieve this sensor > registration, enable and check operations are separated and > corresponding drivers are modified to use the new helpers to > enable and check sensor explicitly. > > Tested on Exynos5422 based Odroid-XU3 Lite board (aforementioned > warnings from the thermal core are now gone). > > Best regards, > -- > Bartlomiej Zolnierkiewicz > Samsung R&D Institute Poland > Samsung Electronics > > > Bartlomiej Zolnierkiewicz (17): > thermal: add thermal_zone_device_toggle() helper > thermal: separate sensor registration and enable > thermal: add thermal_zone_device_check() helper > thermal: do sensor checking explicitly in drivers > thermal: bcm2835: enable/check sensor after its setup is finished > thermal: brcmstb: enable/check sensor after its setup is finished > thermal: hisi_thermal: enable/check sensor after its setup is finished > thermal: qcom: tsens: enable/check sensor after its setup is finished > thermal: qoriq: enable/check sensor after its setup is finished > thermal: rcar_gen3_thermal: enable/check sensor after its setup is > finished > thermal: rockchip_thermal: enable/check sensor after its setup is > finished > thermal: exynos: enable/check sensor after its setup is finished > thermal: tegra: enable/check sensor after its setup is finished > thermal: ti-soc-thermal: enable/check sensor after its setup is > finished > thermal: uniphier: enable/check sensor after its setup is > finished > thermal: zx2967: enable/check sensor after its setup is finished > thermal: warn on attempts to read temperature on disabled sensors > > drivers/acpi/thermal.c | 5 ++-- > drivers/net/ethernet/mellanox/mlxsw/core_thermal.c | 1 - > drivers/platform/x86/acerhdf.c | 6 +++- > drivers/regulator/max8973-regulator.c | 3 +- > drivers/thermal/broadcom/bcm2835_thermal.c | 3 ++ > drivers/thermal/broadcom/brcmstb_thermal.c | 3 ++ > drivers/thermal/broadcom/ns-thermal.c | 3 ++ > drivers/thermal/da9062-thermal.c | 7 ++--- > drivers/thermal/db8500_thermal.c | 5 +++- > drivers/thermal/hisi_thermal.c | 22 ++++---------- > drivers/thermal/imx_thermal.c | 3 +- > drivers/thermal/int340x_thermal/int3400_thermal.c | 1 + > drivers/thermal/intel_bxt_pmic_thermal.c | 3 +- > drivers/thermal/intel_soc_dts_iosf.c | 3 +- > drivers/thermal/max77620_thermal.c | 6 ++-- > drivers/thermal/mtk_thermal.c | 3 ++ > drivers/thermal/of-thermal.c | 6 ++-- > drivers/thermal/qcom-spmi-temp-alarm.c | 5 +++- > drivers/thermal/qcom/tsens.c | 6 ++++ > drivers/thermal/qoriq_thermal.c | 3 ++ > drivers/thermal/rcar_gen3_thermal.c | 7 +++-- > drivers/thermal/rcar_thermal.c | 8 +++-- > drivers/thermal/rockchip_thermal.c | 34 ++++++++++------------ > drivers/thermal/samsung/exynos_tmu.c | 7 ++++- > drivers/thermal/st/st_thermal_memmap.c | 3 +- > drivers/thermal/tango_thermal.c | 5 ++++ > drivers/thermal/tegra/soctherm.c | 3 ++ > drivers/thermal/tegra/tegra-bpmp-thermal.c | 3 ++ > drivers/thermal/thermal-generic-adc.c | 3 ++ > drivers/thermal/thermal_core.c | 14 ++++----- > drivers/thermal/thermal_helpers.c | 33 +++++++++++++++++++++ > drivers/thermal/thermal_sysfs.c | 17 +++++++---- > drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 7 ++++- > drivers/thermal/uniphier_thermal.c | 6 +++- > drivers/thermal/x86_pkg_temp_thermal.c | 2 +- > drivers/thermal/zx2967_thermal.c | 3 ++ > include/linux/thermal.h | 5 ++++ > 37 files changed, 173 insertions(+), 84 deletions(-) > > -- > 1.9.1