Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751207AbdHXBnF (ORCPT ); Wed, 23 Aug 2017 21:43:05 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:12287 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751005AbdHXBnB (ORCPT ); Wed, 23 Aug 2017 21:43:01 -0400 X-AuditID: b6c32a48-f79a16d00000362a-36-599e2f23769e 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 00/12] PM / devfreq: Use OPP interface to handle the frequency Date: Thu, 24 Aug 2017 10:42:47 +0900 Message-id: <1503538979-22693-1-git-send-email-cw00.choi@samsung.com> X-Mailer: git-send-email 1.8.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrJKsWRmVeSWpSXmKPExsWy7bCmqa6y/rxIg8XXxSwm3rjCYnH9y3NW i0n3J7BYnG16w25xedccNovPvUcYLW43rmCzeLziLbsDh8fiPS+ZPDat6mTz6NuyitHj8ya5 AJaoVJuM1MSU1CKF1Lzk/JTMvHRbJe/geOd4UzMDQ11DSwtzJYW8xNxUWyUXnwBdt8wcoDOU FMoSc0qBQgGJxcVK+nY2RfmlJakKGfnFJbZK0YaGRnqGBuZ6RkZGeibGsVZGpkAlCakZk2+0 sRSsE6uY/jimgXGeUBcjJ4eEgInEh2/dTBC2mMSFe+vZuhi5OIQEdjBKrDi4mBXC+c4ocXTT YnaYjhnnzrJDJDYwSmxduYgRwvnBKLFz934WkCo2AS2J/S9usIHYIgIBEp1rVzGBFDELNDFK 7L93A2yUMFBixYRDzCA2i4CqxJtHV4H2cXDwCrhKrFlUDLFNTuLDnkdg2yQEPrJK9E57wgqR cJHY8PsLM4QtLPHq+Bao86Qlnq3ayAjR0M4osXnOP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fitqge u7l1tXJa2v6egktsH14es5j6+ltpvX/gpRkOUZMOTt5+69WuQ7zrAqTYZncKz8o9NdUq1dqW 70G3cXzHrlCnQ4pa194w6POyT1RiKc5INNRiLipOBADHYJ3UBQIAAA== X-CMS-MailID: 20170824014259epcas2p4d92e5c404f54b629e7bdfb6a2c5ed0ed X-Msg-Generator: CA X-Sender-IP: 182.195.42.143 X-Local-Sender: =?UTF-8?B?7LWc7LCs7JqwG1RpemVuIFBsYXRmb3JtIExhYihTL1fshLw=?= =?UTF-8?B?7YSwKRvsgrzshLHsoITsnpAbU2VuaW9yIEVuZ2luZWVy?= X-Global-Sender: =?UTF-8?B?Q2hhbndvbyBDaG9pG1RpemVuIFBsYXRmb3JtIExhYi4bU2Ft?= =?UTF-8?B?c3VuZyBFbGVjdHJvbmljcxtTZW5pb3IgRW5naW5lZXI=?= X-Sender-Code: =?UTF-8?B?QzEwG1RFTEUbQzEwVjgxMTE=?= CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20170824014259epcas2p4d92e5c404f54b629e7bdfb6a2c5ed0ed X-RootMTR: 20170824014259epcas2p4d92e5c404f54b629e7bdfb6a2c5ed0ed References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2800 Lines: 60 These patches makes the devfreq to use the OPP interface as a mandatory and fix the bug, clean-up codes. - patch 1/2 fix the bug. - patch 3 refactors the private code. - patch 4~12 are related to the OPP interfaces 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 use the OPP interface when showing the minimum and maximum 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. So, these patches fix this issue. - /sys/class/devfreq/devfreq.X/min_freq - /sys/class/devfreq/devfreq.X/max_freq Second, the 'available_frequencies' should show the all supported frequencis 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/devfreq.X/available_frequencies Lastly, the devfreq uses the OPP interface as a mandatory method and so the devfreq has to support the OPP notifier in order to catch the OPP events. So, patch12 adds the new opp_notifier_cb() function pointer in the struct devfreq_dev_profile. The user can add the their own callback function to receive the OPP events. Also, the devfreq provides the default OPP notifeir callback in order to remake the frequency table when OPP events happen. - default_opp_notifier_cb() Chanwoo Choi (12): PM / devfreq: Fix memory leak when fail to register device PM / devfreq: Fix locking range for making the frequency table PM / devfreq: Move private devfreq_update_stats() into devfreq PM / devfreq: Add dependency on PM_OPP PM / devfreq: Set min/max_freq when adding the devfreq device PM / devfreq: Check the entered min/max_freq is supported or not Revert "PM / devfreq: Add show_one macro to delete the duplicate code" PM / devfreq: Show the available min/max frequency through sysfs node PM / devfreq: Show whole available frequencies PM / devfreq: Remove 'devfreq' prefix from helper function PM / devfreq: Remove exported opp_notifier function PM / devfreq: Add opp_notifier_cb() function pointer to support OPP notifier drivers/devfreq/Kconfig | 1 + drivers/devfreq/devfreq.c | 286 +++++++++++++++++++++++++------------------ drivers/devfreq/exynos-bus.c | 7 -- drivers/devfreq/governor.h | 4 + drivers/devfreq/rk3399_dmc.c | 1 - include/linux/devfreq.h | 56 ++------- 6 files changed, 181 insertions(+), 174 deletions(-) -- 1.9.1