From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756954AbcJXBIQ (ORCPT ); Sun, 23 Oct 2016 21:08:16 -0400 Received: from bear.ext.ti.com ([198.47.19.11]:34428 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756728AbcJXBIO (ORCPT ); Sun, 23 Oct 2016 21:08:14 -0400 From: Dave Gerlach Subject: Re: [PATCH V2 0/8] PM / OPP: Multiple regulator support To: Viresh Kumar , "Rafael J. Wysocki" References: CC: Rafael Wysocki , Nishanth Menon , Stephen Boyd , Lists linaro-kernel , Linux PM , Linux Kernel Mailing List , Vincent Guittot , Rob Herring , Mark Brown Message-ID: <41a8b4a1-94d3-e086-a328-495f69815d1c@ti.com> Date: Sun, 23 Oct 2016 20:08:02 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [128.247.83.19] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 10/21/2016 10:40 AM, Viresh Kumar wrote: > On 21 October 2016 at 19:09, Rafael J. Wysocki wrote: >> On Thu, Oct 20, 2016 at 10:44 AM, Viresh Kumar wrote: >>> Hi, >>> >>> Some platforms (like TI) have complex DVFS configuration for CPU >>> devices, where multiple regulators are required to be configured to >>> change DVFS state of the device. This was explained well by Nishanth >>> earlier [1]. >>> >>> Some thoughts went into it few months back but then it all got lost. I >>> am trying to get that back on track with this thread. >>> >>> One of the major complaints around multiple regulators case was that the >>> DT isn't responsible in any way to represent the ordering in which >>> multiple supplies need to be programmed, before or after frequency >>> change. It was considered in this patch and such information is left to >>> the platform specific OPP driver now, which can register its own >>> opp_set_rate() callback with the OPP core and the OPP core will then >>> call it during DVFS. >>> >>> The patches are tested on Exynos5250 (Dual A15). I have hacked around DT >>> and code to pass values for multiple regulators and verified that they >>> are all properly read by the kernel (using debugfs interface). >>> >>> Though more testing on real (TI) platforms would be useful. >>> >>> This is rebased over: linux-next branch in the PM tree. >>> >>> V1->V2: >>> - Ack from Rob for 1st patch >>> - Moved the supplies structure to pm_opp.h (Dave) >>> - Fixed an compilation warning. >> >> I need somebody from the OPP camp to review patches [2-8/8] for me. > > Sure, I have already asked Stephen yesterday to do that. Overall this series looks good to me apart from a few small things. Most importantly I was able to get a working implementation using two regulators on ti dra7xx platform with proper sequencing built on top of this series. We have cpu regulator and Adaptive body bias (abb) regulator that must be scaled in a certain order before or after clock scaling and I was able to implement a rough custom set_rate to perform this and ran some dvfs stress tests that all worked fine. First comment, I think the platform specific set_rate is a good place to hook in for adaptive voltage scaling as well. I was able to implement TI Class0 AVS in the same code by using the requested transition voltage as a reference and programming AVS voltage using that, along with scaling the additional regulators in sequence (the original multi regulator functionality). I would think some people would want to use this even with single regulator platforms, no? cpufreq-dt works as is for that, we just swap out the regulators. This raises some concerns about dependencies/probe sequencing. Right now we just need to make sure the cpufreq-dt driver probes after we have called _set_regulators, but if our platform code fails cpufreq-dt currently will treat this as no regulator needed for the platform and operate without one, which will likely hang the system. Is there a good way to to guarantee this doesn't happen? My main concern is that if we plan to provide a platform specific set-rate function, we should have a way to indicate this and prevent things from progressing if it isn't yet ready. Again, overall I think it solves the multi regulator problem, and it works well for AVS as well. For the series: Tested-by: Dave Gerlach Regards, Dave > > -- > viresh >