From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lorenzo Pieralisi Subject: Re: [PATCH RFC 2/2] Documentation: arm: define DT C-states bindings Date: Wed, 4 Dec 2013 16:31:41 +0000 Message-ID: <20131204163141.GA26534@e102568-lin.cambridge.arm.com> References: <1386001205-11978-1-git-send-email-lorenzo.pieralisi@arm.com> <1386001205-11978-3-git-send-email-lorenzo.pieralisi@arm.com> <3AA6B169-C4C8-474B-B110-B912510B834E@codeaurora.org> <20131203104004.GA5694@e102568-lin.cambridge.arm.com> <24A59FCA-88E5-42BB-9AEC-CDA07841A6ED@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: 8BIT Return-path: In-Reply-To: <24A59FCA-88E5-42BB-9AEC-CDA07841A6ED@codeaurora.org> Content-Disposition: inline Sender: linux-pm-owner@vger.kernel.org To: Kumar Gala Cc: Mark Rutland , devicetree , Daniel Lezcano , Vincent Guittot , "linux-pm@vger.kernel.org" , Sudeep KarkadaNagesha , Amit Kucheria , Peter De Schrijver , Nicolas Pitre , "rob.herring@calxeda.com" , Santosh Shilimkar , Hanjun Guo , Mark Hambleton , "grant.likely@linaro.org" , Dave P Martin , "linux-arm-kernel@lists.infradead.org" , Charles Garcia-Tobin List-Id: devicetree@vger.kernel.org On Wed, Dec 04, 2013 at 03:36:08PM +0000, Kumar Gala wrote: > > On Dec 3, 2013, at 4:40 AM, Lorenzo Pieralisi wrote: > > > On Mon, Dec 02, 2013 at 06:08:16PM +0000, Kumar Gala wrote: > >> > >> On Dec 2, 2013, at 10:20 AM, Lorenzo Pieralisi wrote: > >> > >>> ARM based platforms implement a variety of power management schemes that > >>> allow processors to enter at run-time low-power states, aka C-states > >>> in ACPI jargon. The parameters defining these C-states vary on a per-platform > >>> basis forcing the OS to hardcode the state parameters in platform > >>> specific static tables whose size grows as the number of platforms supported > >>> in the kernel increases and hampers device drivers standardization. > >>> > >>> Therefore, this patch aims at standardizing C-state device tree bindings for > >>> ARM platforms. Bindings define C-state parameters inclusive of entry methods > >>> and state latencies, to allow operating systems to retrieve the > >>> configuration entries from the device tree and initialize the related > >>> power management drivers, paving the way for common code in the kernel > >>> to deal with power states and removing the need for static data in current > >>> and previous kernel versions. > >> > >> Where is this spec'd today in the kernel? > > > > How can it be in the kernel given that these bindings have just been posted ? > > I started coding the layer managing the C-states in the kernel, even > > though I would avoid writing it and then restart from scratch if these > > bindings are scrapped. Bindings should not depend on kernel code, it > > is the other way around, right ? > > I was guessing that there is existing code in the kernel that uses some platform data structures. I was wondering what that code looked like today. All C-states (struct cpuidle_driver.states) in drivers in drivers/cpuidle are examples of static data that would disappear. But there is more to it. Most of the information added by these bindings is implicit nowadays in the kernel (cache levels to flush, peripheral state to save/restore); it works today (but it is not optimized in some cases), it will not tomorrow given that the complexity of systems is on the rise. Lorenzo