From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932277AbdJWBgE (ORCPT ); Sun, 22 Oct 2017 21:36:04 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:31149 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932177AbdJWBgC (ORCPT ); Sun, 22 Oct 2017 21:36:02 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20171023013600epoutp015dffff218b24652c4a21cc09c560f1e3~wDyzPNwjl0719207192epoutp01B X-AuditID: b6c32a39-981ff7000000102b-54-59ed469e7b27 From: Chanwoo Choi To: myungjoo.ham@samsung.com, kyungmin.park@samsung.com, cw00.choi@samsung.com Cc: rafael.j.wysocki@intel.com, chanwoo@kernel.org, inki.dae@samsung.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH v5 0/7] PM / devfreq: Use OPP interface to handle the frequency Date: Mon, 23 Oct 2017 10:32:05 +0900 Message-id: <1508722332-10628-1-git-send-email-cw00.choi@samsung.com> X-Mailer: git-send-email 1.8.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprDKsWRmVeSWpSXmKPExsWy7bCmvu48t7eRBpvesVtMvHGFxeL6l+es FpPuT2CxONv0ht3i8q45bBafe48wWtxuXMFm8XjFW3YHDo/Fe14yeWxa1cnm0bdlFaPH501y ASxRqTYZqYkpqUUKqXnJ+SmZeem2St7B8c7xpmYGhrqGlhbmSgp5ibmptkouPgG6bpk5QGco KZQl5pQChQISi4uV9O1sivJLS1IVMvKLS2yVog0NjfQMDcz1jIyM9EyMY62MTIFKElIzXk7b y1pwXani7r8zrA2Mj6W7GDk5JARMJJb3dDB2MXJxCAnsYJRoXXeDFcL5zihxZMIsVpiq/ytv s4HYQgIbGCUOTo+AKPrBKHHo2EZ2kASbgJbE/hc3wIpEBAIkOteuYgIpYhZoYpTYf+8GUBEH h7BAoM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wSjUwTnu9RXvX F7vFb5Oehl52nHYzIKVdP+lWtY38gahCl0Wvr584WXP1unRKKtfmSRrSpnbGhje3/zK8bC7P Ghdh2ZhuL5SnFzw1L2DT7TcKoo/upz/I6do360qA9lavyK2a+w9ndr2YvsEiivtZxXQxV4eb FpcmM1+v+pZRmmkgw/koRJyT5/55JZbijERDLeai4kQAKOaJKggCAAA= X-CMS-MailID: 20171023013213epcas1p165faa416f69659b60ec4c3f18ea251d8 X-Msg-Generator: CA CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20171023013213epcas1p165faa416f69659b60ec4c3f18ea251d8 X-RootMTR: 20171023013213epcas1p165faa416f69659b60ec4c3f18ea251d8 References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org These patches makes the devfreq to use the OPP interface and clean-up codes. [Detaild Descripion] The commit a76caf55e5b3 ("thermal: Add devfreq cooling") provides the devfreq cooling device by using the OPP interface such as dev_pm_opp_disable() and dev_pm_opp_enable(). It means that the OPP interface is able to change the available status of the frequency. Firstly, the existing devfreq doesn't reflect the result of OPP behavior when showing the min/max frequency through the following sysfs nodes: It shows the wrong frequency value because min_freq/max_freq don't consider the frequency status by handling OPP interface (opp_dev_pm_opp_ {disable|add}()). So, these patches fix this issue. - /sys/class/devfreq/devfreqX/min_freq - /sys/class/devfreq/devfreqX/max_freq Second, the 'available_frequencies' should show the all supported frequencies even if the specific frequency is not available. It doesn't matter whether frequneyc is available or not. Because the role of 'available_frequencies' shows the all frequencies. Also, these patches fix this issue. - /sys/class/devfreq/devfreqX/available_frequencies Third, update_devfreq() get the available next frequency by using new 'scaling_min/max_frewq' variables in order to consider the disabled OPP. For example, - devfreq's min_freq is 100Mhz and max_freq is 700Mhz. - OPP disabled 500/600/700Mhz due to devfreq-cooling.c. - simple_ondemand govenor decided the next target_freq (600Mhz) |----------|-------------------------------------------------------------| |Freq(MHz) |100 |200 |300 |400 |500 |600 |70 0 | |Devfreq |min_freq| | | | | |max_freq| |OPP avail |enabled |enabled|enabled|enabled |Disabled| Disabled|Disabled| |Ondmenad | | | | | |next_freq| | |------------------------------------------------------------------------| In result, - Before this patch, target_freq is 600Mhz and TRANSITION_NOTIFIER sends the next_freq is 600Mhz to the notifiee. - After this patch, target_freq is 400Mhz because 500/600 were disabled by OPP. and TRANSITION_NOTIFIER sends the next_freq is 400Mhz to the notifiee. Lastly, - patch6/7 fix the minor issue and cleanup codes. Changes from v4: (https://lkml.org/lkml/2017/10/13/78) - Add acked-by tag from Myungjoo Ham on patch4/5/6/7. - Fix the typo and bug of min/max_freq_show() on patch3. - Drop the exynos-bus.c patch for using it as a cooling device. Changes from v3: - Add the new 'scaling_min/max_freq' to 'struct devfreq' in order to reflect the OPP behavior such as dev_pm_opp_disable/enable(). - Drop the call of devfreq_recommended_opp() in the update_devfreq(). - Show the available frequencies in an ascending order. - Check '#cooling-cells' property before registering cooling device on exynos-bus.c. - Change the return type of devfreq_set_freq_table() and remvoe 'devfreq' prefix from function name. - Add acked-by tag from Myungjoo Ham on patch1. Changes from v2: (https://lkml.org/lkml/2017/9/20/886) - Fix the exynos-bus.c for the cooling device on patch8 Changes from v1: (https://lkml.org/lkml/2017/8/23/785) - Show the available frequencies as an ascending order - Change the author info from cwchoi00@gmail.com to cw00.choi@samsung.com - Drop the patches related to opp_notifier - Add new patch5/6/7/8 Chanwoo Choi (7): PM / devfreq: Set min/max_freq when adding the devfreq device Revert "PM / devfreq: Add show_one macro to delete the duplicate code" PM / devfreq: Use the available min/max frequency PM / devfreq: Change return type of devfreq_set_freq_table() PM / devfreq: Show the all available frequencies PM / devfreq: Remove unneeded conditional statement PM / devfreq: Define the constant governor name drivers/devfreq/devfreq.c | 139 +++++++++++++++++++++--------- drivers/devfreq/exynos-bus.c | 5 +- drivers/devfreq/governor_passive.c | 2 +- drivers/devfreq/governor_performance.c | 2 +- drivers/devfreq/governor_powersave.c | 2 +- drivers/devfreq/governor_simpleondemand.c | 2 +- drivers/devfreq/governor_userspace.c | 2 +- drivers/devfreq/rk3399_dmc.c | 2 +- include/linux/devfreq.h | 16 +++- 9 files changed, 123 insertions(+), 49 deletions(-) -- 1.9.1