Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3076882imm; Mon, 10 Sep 2018 10:37:50 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYx7DwWc2l9kd/1YKOp151BCGttGrCDuH7+16Y0AE5/DUfkZ8ixJ769++ppNNZThQjIflIG X-Received: by 2002:a17:902:32f:: with SMTP id 44-v6mr22761201pld.15.1536601070420; Mon, 10 Sep 2018 10:37:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536601070; cv=none; d=google.com; s=arc-20160816; b=o62c4/7AGA7otbIXShAnRecvTkDxgjh1umU5IPlNEynXkK32fdF1bn+HPFMFYk9Aey 1MqJuVTIAkj2QteTljFD2/InfNu0l5ifrxMcJBmw7xPBeIRm61NSyxIvS3cUavKQ8IXK tOEKsAYEbxr7iCISRlbo/xgkGRLYLbVHikQzRVek7vJ7uX/vj6dVB7cqt7bhcqG3G9kn 8LGQp2sVvPa/efq2lI9mBdkR4NQ2KnSM3nuXfGOzH6IaYfvSUsdZUKSb57y5hVl2dsbV 6HlzK1instpsIAUxId6X/pIAO3bPwe83ar4PgwZY58QFzygiiv4GjKZDUCbq2XsCSQPi adrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=wagdiQetN/Iu6/tFPaSkBGalyN/sKqtafqZlGQJhCak=; b=utvMgOjtI31d1g6jQq3w0oQ/RlXEcEwBPD1ehY8iYBmjXDsZV43HQhNWjqG9VFIWk2 LBSaiPCPR6BhmYNcwQA+LhpIHNORhNtngku0xPxQHo6Jz/zQOVrnNugqIwC4AA6xYOFp QV4tcB3hdyhXr5dbPZangz1RUA4yDKgHx+UdS7YsD1lSG8FoTxAAd5hrXqDiLzMPaCoY A/YV/Rpj9kmqgHttQk/9G3Gb6Ouxxc8hLJ0CQ5z/Gzjp1wP7B3RaS016zzov9CrTi2Xt bjDVrFnyuCFaY/ep6p+5rGRuWS6OWgdvl5MrSpBfDO5OtrmsEJ2Y8dBI1JHxcvTuq5u3 XB5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UFozTeRP; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 78-v6si18630883pfm.264.2018.09.10.10.37.30; Mon, 10 Sep 2018 10:37: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=@gmail.com header.s=20161025 header.b=UFozTeRP; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728366AbeIJWcT (ORCPT + 99 others); Mon, 10 Sep 2018 18:32:19 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:46311 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726603AbeIJWcT (ORCPT ); Mon, 10 Sep 2018 18:32:19 -0400 Received: by mail-pg1-f195.google.com with SMTP id b129-v6so10803727pga.13; Mon, 10 Sep 2018 10:37:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=wagdiQetN/Iu6/tFPaSkBGalyN/sKqtafqZlGQJhCak=; b=UFozTeRP19I2Y48nr7UVZa65B/ii8cl2fFVV0A0yYhxE/5T/Fc4RzygDYmVVkbTUkV Y2lOOA5SkNlZ8g+17LkFiqwUlwihaYjUGm1qYyVU5fJ4z+aUlIWiEuz0fZ0r0+ZXXmPF grqPfpD1i0LF6A/xfjxyLHXsFPxU5c2KdpE52KAygPQoCrTTSELHWTkXxsd1ac0iu9+Y nwegvt9qkmoE3I8tjsp7zMGvxrHM1PlY0WZhPyuG6cDZLCO99hW/6lkXQhNSl2L+25uT Lz8KiLaZmvRPUtYVHvCNc1RaNOwZ5BA6yDf1DNAZsC57PSRgffr8bG1Djerp8BMUCftd TAzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=wagdiQetN/Iu6/tFPaSkBGalyN/sKqtafqZlGQJhCak=; b=qDjOq3zS5AveYAbtO5QvuJBKnOtMiEHBD8ohrrqMpPO34gSiukfdtJ2oTVT8OoX7g3 wGutjM8INy0WRyNO2W96OPBW6kaCAsRnfOSV1onWTp6lyY2wpRNHnefnNVZy74ZzmMWb +EHB4y1t2hkwwCwKz4nBOP+RFd2k63tdzTQEkx4Zr34ViJjx7GFJVqjjgS0CM+RYyc0L HAdfpKFlLYJBXhT4Dr2cXlG0B99EA0pz51kByR4w40P6V80gNDiwHdPs0L+L53uSRrEf 8W/JXk9GKwFRbrgl1vN9O6+RFA/D+/kWtQ0BX2yc7nbdCuNayzGHFNqJqpH+H75ghgle aJAQ== X-Gm-Message-State: APzg51C+GkJbpunviChtz4vnsVCij5CCoxoxesnePGP2vqaCcFLkERgw 6PebwsRe383z8E1qukU4tQg= X-Received: by 2002:a63:66c7:: with SMTP id a190-v6mr24298443pgc.411.1536601028912; Mon, 10 Sep 2018 10:37:08 -0700 (PDT) Received: from localhost.localdomain ([12.251.228.178]) by smtp.gmail.com with ESMTPSA id f184-v6sm36046747pfc.88.2018.09.10.10.37.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Sep 2018 10:37:08 -0700 (PDT) Date: Mon, 10 Sep 2018 10:37:01 -0700 From: Eduardo Valentin To: Bartlomiej Zolnierkiewicz Cc: Zhang Rui , 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@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 00/17] thermal: enable/check sensor after its setup is finished Message-ID: <20180910173659.GB4196@localhost.localdomain> References: <1523364131-31059-1-git-send-email-b.zolnierkie@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1523364131-31059-1-git-send-email-b.zolnierkie@samsung.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 10, 2018 at 02:41:54PM +0200, 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). Yeah, pretty much the driver needs to be ready to answer to callbacks once it calls thermal_*_register() method. > For many DT thermal drivers this causes a problem because Can you be more specific? Are you seeing this problem in samsung driver or in other drivers too? > [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 Oh I see, this is because trip info is read by the of thermal thermal then, correct? > 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. > Ok. Up to this point I followed that this is a samsung driver issue, not we need to change the core to fix adapt to it? And adapting the core should be fine to fit a new use/fix something, as long the issue is well described.. > 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