Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp343529imm; Wed, 17 Oct 2018 00:43:49 -0700 (PDT) X-Google-Smtp-Source: ACcGV62s943TrMgb/7ImHuC9vsAjnBfYA7Kc05IEbfnPxTXTSCVpGXulzFYn3uVfeqRKXFUkKts0 X-Received: by 2002:a63:181:: with SMTP id 123-v6mr791541pgb.149.1539762229603; Wed, 17 Oct 2018 00:43:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539762229; cv=none; d=google.com; s=arc-20160816; b=S0lzK731QCBZlKMrhzVrXTkE7hcQ9gqE/9K+ZGGIzh2GChn/PVzX45d9L4gcYQFeIS sXDzo9C5PyraCziaA2WpNfKIMtHc2XlpTWP+3VXEY2JDVpJXNq+47QIDzRzJxFnrC7Az 5+jUiHJsG8kLxmCEendbSXF3eAGUhoKG81ZpgEZ1uZvj8DKWHtSUh/Mdqc685xXD1/J+ 96I9xG+BOM0eCbbrOWBmTi1I3bOaszQ88I6nZeDxCjG0I3k9q6vSuKnbwBnB+IysUJ9Q 3pUMxxzGb0wL9f0mTOxJ9MyOpmV7/MuDgXb630cZnKv68EHia5IRNcy6G2FilwY9+Mec hnKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:message-id :content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:from:cc:to:subject:dkim-signature:dkim-filter; bh=j4SQJ9VsTeMrPh2VksxZC1FqU5eBAu9JCpV/+zpvtZ0=; b=QI2pEA7b4doyl6CsCXxgteMDlmQQE4aWiOjHMdtedcxURX7RQlLhQTfa0UiA5a9mJm 3sX76FQ+WgdVz5OUBpa6E/PXFEL/sVOOSHqzrv0rA0QPN4vIsE1c4ZPzjVvKyZFaZc2v QkYejfg1EDcBYHfLTy54uyKMCyB+amzwO/1JQcvGaBNAy6ojr9hti66cw88g1qSj9ftB uOFtGzGNVRpuxLHWILA5oDPt+BFM6DwfekU1dRh0yxBuP2uHSZ/G9Fq2n1f92vMdjPyR D1rBUZEcKnnXirVHGJhKyKziS1BIQ5AN54h0QA48GC+ZQ8hAXZyud5YAP5dI9WAN4qpE UOww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=L+LoXm+2; 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=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l72-v6si609732pge.541.2018.10.17.00.43.34; Wed, 17 Oct 2018 00:43:49 -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=@samsung.com header.s=mail20170921 header.b=L+LoXm+2; 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=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727577AbeJQPhM (ORCPT + 99 others); Wed, 17 Oct 2018 11:37:12 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:56904 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727553AbeJQPhK (ORCPT ); Wed, 17 Oct 2018 11:37:10 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20181017074246euoutp0124bf9d80a47c66c386341733a1f72a73~eVYgxynHu1009710097euoutp01V for ; Wed, 17 Oct 2018 07:42:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20181017074246euoutp0124bf9d80a47c66c386341733a1f72a73~eVYgxynHu1009710097euoutp01V DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1539762166; bh=j4SQJ9VsTeMrPh2VksxZC1FqU5eBAu9JCpV/+zpvtZ0=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=L+LoXm+2dY8sVxtwcWpaQ2Si3vjL9fvx9BEsru3S5yw+QDsDRW8DUMMv3sMSx3WKA X1iH920O7l76C5SMetB4f5bSNDm4isZFlqIDzb9gAoPwPpuvYpLNvr3so8ST0jEMjY l82+LX2rvzBIMXvSGSHP7xpJ3QZs534a94nDZGb8= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181017074245eucas1p2c48edf221c1e028227961813be366b22~eVYf4xyJK2023320233eucas1p2w; Wed, 17 Oct 2018 07:42:45 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 3B.56.04441.4F7E6CB5; Wed, 17 Oct 2018 08:42:44 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20181017074244eucas1p2487ff3bccf50d6f4fd7a99cd7d8d2bb4~eVYe84jXW0904509045eucas1p2q; Wed, 17 Oct 2018 07:42:44 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20181017074243eusmtrp16ccb0d3b3a3010349729a360d94191d8~eVYesb-eU0953109531eusmtrp1V; Wed, 17 Oct 2018 07:42:43 +0000 (GMT) X-AuditID: cbfec7f2-5c9ff70000001159-23-5bc6e7f4199a Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 04.FB.04284.3F7E6CB5; Wed, 17 Oct 2018 08:42:43 +0100 (BST) Received: from [106.120.51.20] (unknown [106.120.51.20]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20181017074243eusmtip2b9cefd6d465f0d0100268048838507f9~eVYeLtl032237622376eusmtip2A; Wed, 17 Oct 2018 07:42:43 +0000 (GMT) Subject: Re: [PATCH 00/11] thermal: add new flag irq-mode for trip point To: =?UTF-8?Q?Krzysztof_Koz=c5=82owski?= Cc: 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, rui.zhang@intel.com, edubezval@gmail.com, daniel.lezcano@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, corbet@lwn.net, =?UTF-8?Q?Bart=c5=82omiej_=c5=bbo=c5=82nierkiewicz?= From: Lukasz Luba Date: Wed, 17 Oct 2018 09:42:41 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA02Se0hTYRjG+XYuO1qT4zR98ZIxSjTwhoUHKikIO1BG/WORhU09OUun7aRm VAqat0xCpdnKGzOVociWLl3e0OEtLC0tsYLClRUtsxlkYuU8Sv73e5/3eb/nfeGjMOk04UEl Ki9xKqU8SUY64saBxWcBC7MD0cFjlSGMvqKFYCy9+Yipsnkz1eanBFM98ZJgWmcXScYws0K1 eXU488J0n2Rst8yIefBqXMTc6DKLGcv7EnK/hG2qakJsh+atmNV2fhaxBl0hyb552UmyD+uy WG1JGcGWtOoQazNsPeZwynFvPJeUmM6pgsLPOiq0E5Vk6lzo5cZBK5aNen2KkAMF9C4YmrOK i5AjJaUbEeTUfhIJxQKC8cLGtcKGYGlqhlgfMd43EUKjAcHXaSMpFFYE7+ZLkd3lQrPQMjS7 yq70IVDnjuJ2E0bPi+Bt8/BKIkWRdCC06y7aPTi9A/6qi1YTttAnwfy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nFjCTmLf5ITOELS5x68l8JghbXqJ562zmCYxCs5C0z0LSMgtJyywkLQsYWVYxiqSWFuem 5xYb6hUn5haX5qXrJefnbmIExvW2Yz8372C8tDH4EKMAB6MSD+8OsWPRQqyJZcWVuYcYJTiY lUR4MxcDhXhTEiurUovy44tKc1KLDzGaAj03kVlKNDkfmHLySuINTQ3NLSwNzY3Njc0slMR5 zxtURgkJpCeWpGanphakFsH0MXFwSjUwyjKzVxXOOm1xq/vxm7i4kIN36gQt5Tv++ZzX+8Sq fjtzqs6lqT7S7a97Kudv2bQ2vqk5en0wy2IP9tb6fLP92btnMPm3OvYdmHb//NJ8+cYFR2yW H2sOLv98yrTc/bXInIjwmtmh4q+aTFP4HEtiD59/JhQ772LZUeX29A8RDFs6E6SYbJ2UWIoz Eg21mIuKEwFEIEArAQMAAA== Message-Id: <20181017074244eucas1p2487ff3bccf50d6f4fd7a99cd7d8d2bb4~eVYe84jXW0904509045eucas1p2q@eucas1p2.samsung.com> X-CMS-MailID: 20181017074244eucas1p2487ff3bccf50d6f4fd7a99cd7d8d2bb4 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20181016145637eucas1p2dfa78042b9fd4fd27af7cc8537b7f485 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181016145637eucas1p2dfa78042b9fd4fd27af7cc8537b7f485 References: <20181016145637eucas1p2dfa78042b9fd4fd27af7cc8537b7f485~eHqCoEO-42133821338eucas1p2F@eucas1p2.samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Krzysztof, On 10/17/2018 09:03 AM, Krzysztof Kozłowski wrote: > On Tue, 16 Oct 2018 at 16:56, Lukasz Luba wrote: >> >> Hi all, >> >> This patch set adds new flag and mechanism in thermal trip point in DT. >> The current situation with 'passive' (passive cooling - DVFS) >> trip point is that it enables polling mode in thermal framework. > > For DT platform, I checked it some months ago... and that time I was > pretty sure - passive mode does not enable polling (unless you tell it > explicitly with "polling-delay-passive"). Maybe something changed... > but quick look at the code tell me that not. Passive does not indicate > polling mode. > > Why do you think that passive enables polling? Please check dt file which implements 2 more trip points that HW supports: arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi In that file we have this trick with 'active' present. Yes, you are right, 'polling-delay-passive' enables it in the thermal code (for whole thermal zone). Unfortunately, if you change the bellow 'active' to 'passive' in that file, they will start polling, which is not what we want. --------8<------------------------- thermal-zones { cpu0_thermal: cpu0-thermal { thermal-sensors = <&tmu_cpu0 0>; polling-delay-passive = <250>; polling-delay = <0>; trips { cpu0_alert0: cpu-alert-0 { temperature = <50000>; /* millicelsius */ hysteresis = <5000>; /* millicelsius */ type = "active"; }; cpu0_alert1: cpu-alert-1 { temperature = <60000>; /* millicelsius */ hysteresis = <5000>; /* millicelsius */ type = "active"; }; cpu0_alert2: cpu-alert-2 { temperature = <70000>; /* millicelsius */ hysteresis = <5000>; /* millicelsius */ type = "active"; }; cpu0_crit0: cpu-crit-0 { temperature = <120000>; /* millicelsius */ hysteresis = <0>; /* millicelsius */ type = "critical"; }; /* * Exynos542x supports only 4 trip-points * so for these polling mode is required. * Start polling at temperature level of last * interrupt-driven trip: cpu0_alert2 */ cpu0_alert3: cpu-alert-3 { temperature = <70000>; /* millicelsius */ hysteresis = <10000>; /* millicelsius */ type = "passive"; }; cpu0_alert4: cpu-alert-4 { temperature = <85000>; /* millicelsius */ hysteresis = <10000>; /* millicelsius */ type = "passive"; }; }; ---------------->8----------------------------- If you have some other ideas how to handle this case, I am happy to discuss. Regards, Lukasz > > Best regards > > >> If the device supports irqs fired when the desired temerature is met, >> thermal framwork should be notifed from driver's irq routine. >> This is sufficent and there is no need of polling. >> As a workaround, people declare trip point as 'active' >> (active cooling, i.e. fan) to bypass polling mode setup in thermal >> framework. >> >> With this patch set trip point 'passive' declared in DT with explicit flag: >> 'irq-mode;' will not register itself as polling mode. >> >> A good example is 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, thus polling needed. >> >> It does not break existing design for trip points which do not have 'irq-mode' >> flag - they will use polling. >> >> For consistency this flag should be added to all trip point types('active', >> 'passive', 'hot', 'critical') when need (meaning, when irq will notify thermal >> framework). >> >> 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 >> DT: arm64: exynos: add support for thermal trip irq-mode >> DT: arm64: exynos7: add support for thermal trip irq-mode >> DT: arm: exynos4: add support for thermal trip irq-mode >> DT: arm: exynos: add support for thermal trip irq-mode >> DT: arm: exynos: add support for thermal trip irq-mode >> DT: arm: exynos: 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(-) >> >> -- >> 2.7.4 >> > >