Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3364866imu; Wed, 7 Nov 2018 09:11:44 -0800 (PST) X-Google-Smtp-Source: AJdET5f2VSkbCjk40YqEAQp+RpscHlX82R0l3Nu6UpaIrfYckDgDNFnCr+g97syDcI8IocOvrzmg X-Received: by 2002:a17:902:bc4a:: with SMTP id t10-v6mr967418plz.249.1541610704040; Wed, 07 Nov 2018 09:11:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541610704; cv=none; d=google.com; s=arc-20160816; b=ykoF4xU1nq0/IiGdsAMdAz1rHw09eEZVqsaifo3Gduf01sLgI/cQhxJNlrGzY9IoJp /mrVm1FFP8xjohcRqp+2wJm7YdW1hEWa8/W2Dmsb/pcc5Guoq90Na2U1g5djC/FrYKYK QwwM0QKuD4ucb9FkIa9yx+ParnxuNazBXkxbLMpXZOMTJNfIFIhXqxn8ofqcEe05Yl/k TMd58LjKe9sjcs/fDidfWRrIdtkLPFI01+QlKP6Q721IwLLy2ubA2bHQZRIOfMB+y9ST CbPjnHUdhSmPSbprIkZDjUxS1gD5j5UiBvsK3Y07D4skIlVpis3bCJSf3ljRHTXm063h epOQ== 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:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=iFKZQakylMpviaUmUA83uFWro70KslVTwpF9v5ThIbI=; b=w+U+J4ou0KhMusG6qUZhVNi8lgmWEf0rx5hEcDv6vpHXczyyJgYvjRyxMdvD2XMuQv mHkfaRHQfbJ719cNHN9As16ORvk4zT6s7LprKpm/2lJ7EC+BBBpWnU2CNc+vReGnIqkm 9S8kIjfyZBQEFM2d53KDSRDecyeGlbiahTDePbfwG4MqmXSEXLDRMUooFJsES0eg3nXM 2Mw+t1pM8ZdoQzPOsieBBGN8nAiJA/siJORCCIvSVTySWhdf/nR1PtZuBTivL754oof8 LzMod4mf2my59EIdyIEayixTNRZgXygVSfrDLGO72+Ad+3orRI7267sFpfKB0cnCNWeS TSeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=BDK9ygP8; 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 g12-v6si1130103pla.351.2018.11.07.09.11.29; Wed, 07 Nov 2018 09:11:44 -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; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=BDK9ygP8; 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 S1728155AbeKHCli (ORCPT + 99 others); Wed, 7 Nov 2018 21:41:38 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:57118 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727576AbeKHCli (ORCPT ); Wed, 7 Nov 2018 21:41:38 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20181107171021euoutp0229c8b7552bd9e13169b2321c8584f9c9~k5rFFOcbH0448104481euoutp028 for ; Wed, 7 Nov 2018 17:10:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20181107171021euoutp0229c8b7552bd9e13169b2321c8584f9c9~k5rFFOcbH0448104481euoutp028 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1541610621; bh=iFKZQakylMpviaUmUA83uFWro70KslVTwpF9v5ThIbI=; h=From:To:Cc:Subject:Date:References:From; b=BDK9ygP8Xe3gNHRFYC5XmqbB2BGZu3Z1MVTUoh3k2myQ1xwb1HKN14DSTyY5Zssoi YMhuagWTZLVfheMjuzBfaWpeCV/627lVksB/t2MHoIcxPJjoxRU1h7JN08zPIq9R4D jzSL5a7JlN7L92ZVvsc424JiKhWQfskhn81Nypag= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181107171020eucas1p261bf97dcb3947162dd9a8fc6736d3aec~k5rEbzFT52800928009eucas1p23; Wed, 7 Nov 2018 17:10:20 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 33.E9.04441.C7C13EB5; Wed, 7 Nov 2018 17:10:20 +0000 (GMT) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20181107171019eucas1p1fcb1f44e00265434548d901479f2ea94~k5rDE5Z4v2714327143eucas1p1Q; Wed, 7 Nov 2018 17:10:19 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20181107171019eusmtrp14b8f102ab933f2b437022ef1d4737b16~k5rC41y4l2472624726eusmtrp1Z; Wed, 7 Nov 2018 17:10:19 +0000 (GMT) X-AuditID: cbfec7f2-5e3ff70000001159-47-5be31c7c976a Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 3F.13.04128.B7C13EB5; Wed, 7 Nov 2018 17:10:19 +0000 (GMT) Received: from AMDC3778.DIGITAL.local (unknown [106.120.51.20]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20181107171018eusmtip286bafac1988a4551c134cd1dcb1eefe9~k5rCSAEO_0340803408eusmtip2G; Wed, 7 Nov 2018 17:10:18 +0000 (GMT) From: Lukasz Luba To: 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: rui.zhang@intel.com, 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, Lukasz Luba Subject: [PATCH v2 00/11] thermal: add new flag irq-mode for trip point Date: Wed, 7 Nov 2018 18:09:42 +0100 Message-Id: <1541610593-28542-1-git-send-email-l.luba@partner.samsung.com> X-Mailer: git-send-email 2.7.4 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrGKsWRmVeSWpSXmKPExsWy7djPc7o1Mo+jDSZ0KVtsnLGe1eLJgXZG i3mfZS3mHznHajH/yjVWi/PnN7Bb3GqQsdj0GMhb2LaExeLyrjlsFp97jzBaLL1+kcmide8R dosnD/vYHPg81sxbw+ixc9Zddo/Fe14yeWxa1cnmcefaHjaPzUvqPRb3TWb1OPhuD5NH35ZV jB6fN8kFcEVx2aSk5mSWpRbp2yVwZXRf3cRSsESmou1+B1sD4xKxLkZODgkBE4nWqRdYuhi5 OIQEVjBKfO26zAzhfGGU+Pz1KytIlZDAZ0aJc1+TYTpW7fvGBlG0HCg+p5EFruNSbwtTFyMH B5uAnsSOVYUgcRGB2UCT9i1mB3GYBe4wSpyaspgZZJSwgLtEW+s7RhCbRUBVYtqP/SwgNq+A l8SKWweYINbJSdw81wl2k4TAOnaJjd8Ps0EkXCQOn7jJCGELS7w6voUdwpaROD25hwXCLpY4 27EKqr5Gov3kDqgaa4nDxy+yglzKLKApsX6XPogpIeAo8XG1NYTJJ3HjrSBIMTOQOWnbdGaI MK9ER5sQxAwNiS09F6COFJNYvmYa1GwPifdTn7BDwi1W4tfC74wTGOVmIaxawMi4ilE8tbQ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tN7 nY5PTHsVEcOxMl6k8drO119u7jVSWLQue0FtyxJXnT7JBfIH8m9on9nx/b2OzzvFzm2ymeeK MjscrHpcnv5RtFq+Z/cn9XclNxsvWZm63/sw+VHOI0N/i+eH/xw3mdeicDVse/MrJZbijERD Leai4kQAC05W8ZECAAA= X-CMS-MailID: 20181107171019eucas1p1fcb1f44e00265434548d901479f2ea94 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20181107171019eucas1p1fcb1f44e00265434548d901479f2ea94 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181107171019eucas1p1fcb1f44e00265434548d901479f2ea94 References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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(-) -- 2.7.4