From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757204AbbGQMv0 (ORCPT ); Fri, 17 Jul 2015 08:51:26 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:55410 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753069AbbGQMvX (ORCPT ); Fri, 17 Jul 2015 08:51:23 -0400 X-AuditID: cbfee68e-f79c56d000006efb-cc-55a8fa497548 Message-id: <55A8FA48.4030304@samsung.com> Date: Fri, 17 Jul 2015 21:51:20 +0900 From: Chanwoo Choi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-version: 1.0 To: Punit Agrawal Cc: edubezval@gmail.com, rui.zhang@intel.com, myungjoo.ham@samsung.com, kyungmin.park@samsung.com, ulf.hansson@linaro.org, khilman@linaro.org, robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com, ijc+devicetree@hellion.org.uk, inki.dae@samsung.com, l.majewski@samsung.com, kgene.kim@samsung.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [RFC PATCH 0/2] thermal: Add generic devfreq cooling device References: <1437048173-23744-1-git-send-email-cw00.choi@samsung.com> <9hhh9p3caxm.fsf@e105922-lin.cambridge.arm.com> In-reply-to: <9hhh9p3caxm.fsf@e105922-lin.cambridge.arm.com> Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrCIsWRmVeSWpSXmKPExsWyRsSkWNfz14pQg2lnRC3mHznHajH/yjVW i3OvVjJaTLo/gcWid8FVNouvh1cwWpxtesNu8ebhZkaLy7vmsFl87j3CaLH0+kUmi9uNK9gs Jkxfy2Lx/P1pJovWvUfYLZ487GOzOL423EHQY828NYweO2fdZfdYufwLm8fiPS+ZPDat6mTz uHNtD5tH35Z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NJCwhjGj +9F7loI9JhWNL2azNTD+1+hi5OCQEDCRWH7CtYuRE8gUk7hwbz1bFyMXh5DAdEaJPVc3MUE4 Dxglbt1oYgSp4hXQklj6cw0ziM0ioCrRv3AGO4jNBhTf/+IGG4gtKhAmsXL6FRaIekGJH5Pv gdkiApoS+26dBhvKLNDLLPG1bTUrSEJYwENixdOLTCC2kEC5xOmTP8EGcQrYSLTNaAVbzCyg I7G/dRobhC0vsXnNW+YJjAKzkOyYhaRsFpKyBYzMqxhFUwuSC4qT0nON9IoTc4tL89L1kvNz NzGC08oz6R2MqxosDjEKcDAq8fA2uK4IFWJNLCuuzD3EKMHBrCTC+/caUIg3JbGyKrUoP76o NCe1+BCjKTAIJjJLiSbnA1NeXkm8obGJmZGlkbmhhZGxuZI478l8n1AhgfTEktTs1NSC1CKY PiYOTqkGxhTP3rwpGuzKaS8ML/19u/7/TtclvMzeDxQvlbKy1ynl1FjuEvuc6sKr+647devE Gm4vgfkMDrZmvzbb79nddqcq+vTLi/rOL0RzPv7fGBr3XlV9rcrST8v/f3fndTpjvZZBxS5v hobQUzUdkXP337VtNF/+JLrMxMr6FZ94hkG29PG7fYKPlFiKMxINtZiLihMBuW4nW0EDAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Punit, On 07/17/2015 07:53 PM, Punit Agrawal wrote: > Hi Chanwoo, > > Chanwoo Choi writes: > >> This patchset introduce the generic devfreq cooling device for generic thermal >> framework. The devfreq devices are used ad cooling device to reduce the >> overheating temperature. This patch is based on drivers/thermal/cpu_cooling.c. >> The devfreq cooling device can change the ragne of the frequency table of >> devfreq device according to cooling level in device tree file. >> > > Have you had a look at the devfreq cooling patches from Javi[0][1]? How > is the current patchset different? I didn't see Javi's patchset before. Thanks for your information. I reviewed ths Javi's patchset. Both Javi's patchset and my patchset has same concept except for applying the power allocator thermal governor as you below comment. But, there are some difference. First, I don't add new devfreq API (devfreq_set_max() / devfreq_set_min()). The my patchset used existing update_devfreq() to update the maximum frequency of devfreq device. Second, In my patchset, the devfreq cooling device will be operated as existing cpu cooling device. If sensor measure the overheating temperature, devfreq cooling device will limit the maximum frequency of devfreq device. As below example, the devicetree file includes the overheating temperature information of each trip-point. - Javi's patchset used the static power value calculated by devfreq_cooling_gen_power_table() instead of temperature. Third, Javi's patchset used the same string of type when calling the thermal_of_cooling_device_register() - Javi's patchset used always the same "devfreq" string. - My patchset used the different "thermal-devfreq-%d" string according to each devfreq cooling device. In my patchset, devfreq cooling device uses the same method to determine the throttling situation as existing cpu cooling device. It is just my opinion. > > At first glance, it seems that you are not implementing the extensions > that allow devfreq cooling devices to be used with power_allocator > thermal governor that got merged in v4.2-rc1. > > Thanks, > Punit > > [0] http://article.gmane.org/gmane.linux.power-management.general/61936 > [1] http://article.gmane.org/gmane.linux.power-management.general/62417 Thanks, Chanwoo Choi > > >> To verify the devfreq cooling device driver, I testd it with following platform: >> >> For example, >> - The Mali GPU of Exynos5433 SoC uses the devfreq framework to support the DVFS >> feature and Exynos5433 contains the G3D (GPU) thermal sensor. Following example >> explain the correlation between mali dt node and thermal sensor/zone. >> : thermal sensor : G3D sensor of Samsung Exynos5433 [1][2] >> : devfreq cooling device : Mali GPU [3] >> >> According to the temperature of g3d thermal sensor inclued in Exynos5433, >> devfreq cooling device can change the maximum frequency of Mali GPU. >> >> 1. In Exynos5433-based board dts file, Mali GPU dt node uses the devfreq >> framework to suppot the DVFS feature. Following dt node includes the >> both 'cooling-cells' and 'operating-points' which means the supported >> frequency entries: >> >> mali: mali@14AC0000 { >> compatible = "arm,mali-midgard"; >> reg = <0x14AC0000 0x5000>; >> interrupts = <0 282 0>, <0 283 0>, <0 281 0>; >> interrupt-names = "JOB", "MMU", "GPU"; >> clocks = <&cmu_g3d CLK_ACLK_G3D>; >> clock-names = "clk_mali"; >> power-domains = <&pd_g3d>; >> status = "disabled"; >> >> #cooling-cells = <2>; >> >> operating-points = < >> 700000 1150000 >> 600000 1150000 >> 550000 1125000 >> 500000 1075000 >> 420000 1025000 >> 350000 1025000 >> 266000 1000000 >> 160000 1000000 >> >; >> }; >> >> 2. In exynos5433.dtsi, G3D thermal sensor measure the temperature of Mali GPU: >> >> tmu_g3d: tmu@10070000 { >> compatible = "samsung,exynos5433-tmu"; >> reg = <0x10070000 0x200>; >> interrupts = <0 99 0>; >> clocks = <&cmu_peris CLK_PCLK_TMU1_APBIF>, >> <&cmu_peris CLK_SCLK_TMU1>; >> clock-names = "tmu_apbif", "tmu_sclk"; >> #include "exynos5433-tmu-sensor-conf.dtsi" >> status = "disabled"; >> }; >> >> 3. In exynos5433-tmu.dtsi, thermal-zones includes both trip points and >> cooling-maps of g3d thermal sensor. Following cooling-maps show the match >> between each trip point and each cooling device (devfreq device of mali): >> >> thermal-zones { >> /* ...... */ >> g3d_thermal: g3d-thermal { >> thermal-sensors = <&tmu_g3d>; >> polling-delay-passive = <0>; >> polling-delay = <0>; >> trips { >> g3d_alert_0: g3d-alert-0 { >> temperature = <30000>; /* millicelsius */ >> hysteresis = <10000>; /* millicelsius */ >> type = "active"; >> }; >> g3d_alert_1: g3d-alert-1 { >> temperature = <40000>; /* millicelsius */ >> hysteresis = <10000>; /* millicelsius */ >> type = "active"; >> }; >> >> /* ...... */ >> }; >> >> cooling-maps { >> map0 { >> /* Set maximum frequency as 550MHz */ >> trip = <&g3d_alert_0>; >> cooling-device = <&mali 2 2>; >> }; >> map1 { >> /* Set maximum frequency as 420MHz */ >> trip = <&g3d_alert_1>; >> cooling-device = <&mali 4 4>; >> }; >> >> /* ...... */ >> }; >> }; >> >> ...... >> }; >> >> [1] https://git.kernel.org/cgit/linux/kernel/git/kgene/linux-samsung.git/commit/?h=v4.3-next/dt64-samsung&id=ac008f6b537703bb9a6fcc3882ca4af3331aa24f >> [2] https://git.kernel.org/cgit/linux/kernel/git/kgene/linux-samsung.git/commit/?h=v4.3-next/dt64-samsung&id=bcddc3a84e49ca1c646cf2081687a544a15f9218 >> [3] malideveloper.arm.com/downloads/drivers/TX041/r5p0-06rel0/TX041-SW-99002-r5p0-06rel0.tgz >> >> Chanwoo Choi (2): >> PM: devfreq: Add the prototype of update_devfreq() to export >> thermal: devfreq_cooling: Add generic devfreq cooling device implementaion >> >> .../devicetree/bindings/thermal/thermal.txt | 8 +- >> drivers/devfreq/devfreq.c | 22 +- >> drivers/thermal/Kconfig | 11 + >> drivers/thermal/Makefile | 3 + >> drivers/thermal/devfreq-cooling.c | 309 +++++++++++++++++++++ >> include/linux/devfreq-cooling.h | 80 ++++++ >> include/linux/devfreq.h | 7 + >> 7 files changed, 425 insertions(+), 15 deletions(-) >> create mode 100644 drivers/thermal/devfreq-cooling.c >> create mode 100644 include/linux/devfreq-cooling.h >