Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9582811imu; Wed, 5 Dec 2018 07:09:21 -0800 (PST) X-Google-Smtp-Source: AFSGD/Up2CiAAqW87NL/ZgtMoZuPdnGWliUJofR6f3vF8hEwUcbZMwWsMnnuEerarEdt8RgSrmDC X-Received: by 2002:a17:902:bd92:: with SMTP id q18mr24751508pls.167.1544022561237; Wed, 05 Dec 2018 07:09:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544022561; cv=none; d=google.com; s=arc-20160816; b=VNpuF5s6II1K3L6UzQoDOVZkmRiaYPkMD+Fd7OIKsvm+BcfwMRv4K58pCsyMoLzXCP Qw6DcB98SHa4WbYTGdl4bbm/NrZRBQ0QtnK6wwlBmTIZEb2cxGjsjCknG7Y0ls3M3ud8 adozoicIEfBkSOcJQwMjGauMsFmQ6VfEbA+WbUOqTk5sANHGjbX9N6aCP1scpkUJFWGu XZ0KWT9l9U3yQruDzBWljRx4eZ/bO7RKnQtL1ipD5pRKzTzn1VZY2dnCJhgryuRw/KCn zCgVYPUd/qAacZ0ys6NKF+49nSBEJ7WG5vg5R8WVJpN3zEfwfhmIv1Fn+sAP/AR8vZeW 02Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=OCpUGaGxq+t2+5LpK3unKTRfuQETv8AU/ozrjh53Oo8=; b=0Whc3rmuGnA2f1aYAtKneera8Vq8TRQ6oCNVz/slgZ3JtkhkODbanLZqJQmOkWuo7O lz3g7Pfoz76AWMpGeD3W6XO1QTcLyP81RFJueI/0J0TeMLBWJ0JX0asoKCC0jAvPHniG aKaUG2ExQgQCxVE/7z0LjUi8swIHupbAOVEv6iwZEp/hL+fJi0dITzD4G5IaPCZj2vkf CNW2sAE+bi/w4tmgYpGmExqptvfLvWim1v8fe2TyMptVICaBEifIvC1gNgbL8aNjh/Xb 7CMJKXnmmVFkWK34puFmkTvQe0TiVBZ1M9iWQZ1Z8yYRpihIhjo3SL8/oWvBjtOwxglm NRyA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w2si18474975pgh.565.2018.12.05.07.09.05; Wed, 05 Dec 2018 07:09:21 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727861AbeLEPIS (ORCPT + 99 others); Wed, 5 Dec 2018 10:08:18 -0500 Received: from mga09.intel.com ([134.134.136.24]:18831 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727177AbeLEPIS (ORCPT ); Wed, 5 Dec 2018 10:08:18 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Dec 2018 07:08:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,317,1539673200"; d="scan'208";a="96339107" Received: from jinbaowa-mobl1.ccr.corp.intel.com ([10.249.170.100]) by orsmga007.jf.intel.com with ESMTP; 05 Dec 2018 07:08:13 -0800 Message-ID: <1544022486.2841.42.camel@intel.com> Subject: Re: [PATCH v2 00/11] thermal: add new flag irq-mode for trip point From: Zhang Rui To: Lukasz Luba , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Cc: edubezval@gmail.com, daniel.lezcano@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, corbet@lwn.net, b.zolnierkie@samsung.com, krzk@kernel.org Date: Wed, 05 Dec 2018 23:08:06 +0800 In-Reply-To: <1541610593-28542-1-git-send-email-l.luba@partner.samsung.com> References: <1541610593-28542-1-git-send-email-l.luba@partner.samsung.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.5.2-0ubuntu3.2 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 三, 2018-11-07 at 18:09 +0100, Lukasz Luba wrote: > Hi all, > > This patch set adds a new flag and mechanism in thermal trip points > in > DT.  The old implementation in thermal zone in DT sets the same > configuration for all internal trip points. It does not work for all > HW.  There are SoCs which support IRQs for some trip points (i.e. > Exynos 4 has 4 trip points with IRQs). For additional one defined > inside the thermal zone there is a need of 'polling'. When developer > adds polling mode settings inside the thermal zone, all the trip > points will be registered for polling, even those supporting IRQs, > which does not make sense. we have two timers, one for polling, and one for passive cooling. I think we are talking about passive cooling timer only, right? And the real problem is that we have multiple passive trip points and only part of them support irq_mode, and we don't want to start the passive polling timer for all of the passive trip points. thanks, rui > Thus, developers create workarounds, which > are confusing for some other developers.  To workaround,  > people declare some trip points as 'active' (those with IRQ support). > It allows to bypass polling mode in thermal framework applied for  > all thermal zone's trip points. > > Thermal framework defines 4 types of trip points. The 'passive' means > passive cooling using DVFS, 'active' is designed for fan and other > devices actively changing the outside conditions. Therefore, a > workaround > mentioned earlier is confusing when someone does not know about the > framework limitations. > > This patch set tries to solve the issue by adding one flag inside the > trip point: 'irq-mode;'.  The trip point 'passive' declared in DT > with > explicit flag 'irq-mode;' will not register itself as polling mode. > Thermal framework will skip it during scheduling next read out work. > The old global-polling-mode-configuration-inside-thermal-zone is > still > valid.  Patch set does not break existing design for trip points > which > do not have 'irq-mode' flag - they will use polling. > > As an example please check patch #10 for Exynos4 SoC family, where > there > is 4 HW supported trip points and there is a need of 6. The rest 2 > are > declared as 'passive' without 'irq-mode;' flag, which means polling > mode needed for them. > > Patch #1 is a small cleanup in thermal framework. > > Change log: > v2 > - changed description in cover letter > - change commit messages according to Krzysztof comments > - rebase on top of current mainline (v4.20-rc1) > > Regards, > Lukasz Luba > > Lukasz Luba (11): >   thermal: remove unused function parameter >   thermal: add irq-mode configuration for trip point >   thermal: add new sysfs file for irq-mode >   Doc: thermal: new irq-mode for trip point >   Doc: DT: thermal: new irq-mode for trip point >   arm64: dts: exynos5433: add support for thermal trip irq-mode >   arm64: dts: exynos7: add support for thermal trip irq-mode >   arm: dts: exynos4: add support for thermal trip irq-mode >   arm: dts: exynos5420: add support for thermal trip irq-mode >   arm: dts: exynos5422: add support for thermal trip irq-mode >   arm: dts: exynos5410: add support for thermal trip irq-mode > >  .../devicetree/bindings/thermal/thermal.txt        |   7 ++ >  Documentation/thermal/sysfs-api.txt                |   9 ++ >  arch/arm/boot/dts/exynos4-cpu-thermal.dtsi         |  10 +- >  arch/arm/boot/dts/exynos5410-odroidxu.dts          |  10 +- >  arch/arm/boot/dts/exynos5420-trip-points.dtsi      |  10 +- >  arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi |  40 +++++--- >  arch/arm64/boot/dts/exynos/exynos5433-tmu.dtsi     | 105 > ++++++++++++++------- >  .../arm64/boot/dts/exynos/exynos7-trip-points.dtsi |   8 ++ >  drivers/thermal/of-thermal.c                       |  17 ++++ >  drivers/thermal/thermal_core.c                     |  16 ++-- >  drivers/thermal/thermal_sysfs.c                    |  53 ++++++++++- >  include/linux/thermal.h                            |   5 + >  12 files changed, 226 insertions(+), 64 deletions(-) >