From patchwork Wed Apr 20 17:33:25 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 722571 Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3KHZcex027107 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 20 Apr 2011 17:36:05 GMT Received: from dlep34.itg.ti.com ([157.170.170.115]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id p3KHXenm015222 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 20 Apr 2011 12:33:40 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep34.itg.ti.com (8.13.7/8.13.7) with ESMTP id p3KHXdC8007700; Wed, 20 Apr 2011 12:33:39 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 41F3480627; Wed, 20 Apr 2011 12:33:39 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp52.itg.ti.com (dflp52.itg.ti.com [128.247.22.96]) by linux.omap.com (Postfix) with ESMTP id 1C86B80626 for ; Wed, 20 Apr 2011 12:33:37 -0500 (CDT) Received: from red.ext.ti.com (localhost [127.0.0.1]) by dflp52.itg.ti.com (8.13.7/8.13.7) with ESMTP id p3KHXan4004100 for ; Wed, 20 Apr 2011 12:33:36 -0500 (CDT) Received: from psmtp.com (na3sys009amx223.postini.com [74.125.149.63]) by red.ext.ti.com (8.13.7/8.13.7) with SMTP id p3KHXaMr031922 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 20 Apr 2011 12:33:36 -0500 Received: from na3sys009aog116.obsmtp.com ([74.125.83.176]) (using TLSv1) by na3sys009amx223.postini.com ([74.125.148.10]) with SMTP; Wed, 20 Apr 2011 08:33:36 HDT Received: from mail-pv0-f176.google.com ([74.125.83.176]) (using TLSv1) by na3sys009aob116.postini.com ([74.125.148.12]) with SMTP ID DSNKTa8Y6SZSzR3t0RIypoGKrPbSKSKCF0tI@postini.com; Wed, 20 Apr 2011 10:33:36 PDT Received: by mail-pv0-f176.google.com with SMTP id 37so632775pve.7 for ; Wed, 20 Apr 2011 10:33:29 -0700 (PDT) Received: by 10.68.54.1 with SMTP id f1mr11076484pbp.302.1303320809264; Wed, 20 Apr 2011 10:33:29 -0700 (PDT) Received: from localhost (c-24-18-179-55.hsd1.wa.comcast.net [24.18.179.55]) by mx.google.com with ESMTPS id j3sm749762pbe.17.2011.04.20.10.33.26 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 20 Apr 2011 10:33:28 -0700 (PDT) From: Kevin Hilman To: Trinabh Gupta Subject: Re: [linux-pm] [RFC PATCH V3 4/4] cpuidle: Single/Global registration of idle states Organization: Texas Instruments, Inc. References: <20110420065445.332.13688.stgit@tringupt.in.ibm.com> <20110420065608.332.30043.stgit@tringupt.in.ibm.com> Date: Wed, 20 Apr 2011 10:33:25 -0700 In-Reply-To: <20110420065608.332.30043.stgit@tringupt.in.ibm.com> (Trinabh Gupta's message of "Wed, 20 Apr 2011 12:26:34 +0530") Message-ID: <87k4eo6d5m.fsf@ti.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) MIME-Version: 1.0 X-pstn-neptune: 0/0/0.00/0 X-pstn-levels: (S:86.42212/99.90000 CV:99.9000 FC:95.5390 LC:95.5390 R:95.9108 P:95.9108 M:97.0282 C:98.6951 ) X-pstn-settings: 2 (0.5000:0.0750) s cv GT3 gt2 gt1 r p m c X-pstn-addresses: from [db-null] Cc: venki@google.com, davinci-linux-open-source@linux.davincidsp.com, ak@linux.intel.com, len.brown@intel.com, peterz@infradead.org, linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-pm@lists.linux-foundation.org, linux-omap@vger.kernel.org, arjan@linux.intel.com, linux-arm-kernel@lists.infradead.org, lenb@kernel.org X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com X-Greylist: Sender succeeded STARTTLS authentication, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 20 Apr 2011 17:36:05 +0000 (UTC) Trinabh Gupta writes: > With this patch there is single copy of cpuidle_states structure > instead of per-cpu. The statistics needed on per-cpu basis > by the governor are kept per-cpu. This simplifies the cpuidle > subsystem as state registration is done by single cpu only. > Having single copy of cpuidle_states saves memory. Rare case > of asymmetric C-states can be handled within the cpuidle driverand > architectures such as POWER do not have asymmetric C-states. I haven't actually tested this series on OMAP yet, but it currently doesn't compile. The patch below (on top of your series) is required to compile on OMAP, I think it's doing what you intended, but please confirm. Kevin diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c index 6641574..ab77ba3 100644 --- a/arch/arm/mach-omap2/cpuidle34xx.c +++ b/arch/arm/mach-omap2/cpuidle34xx.c @@ -512,6 +512,7 @@ static int omap3_cpuidle_driver_init(void) int i, retval, count = 0; struct omap3_processor_cx *cx; struct cpuidle_state *state; + struct cpuidle_driver *drv = &omap3_idle_driver; mpu_pd = pwrdm_lookup("mpu_pwrdm"); core_pd = pwrdm_lookup("core_pwrdm"); @@ -532,7 +533,7 @@ static int omap3_cpuidle_driver_init(void) state->enter = (state->flags & CPUIDLE_FLAG_CHECK_BM) ? omap3_enter_idle_bm : omap3_enter_idle; if (cx->type == OMAP3_STATE_C1) - dev->safe_state_index = count; + drv->safe_state_index = count; sprintf(state->name, "C%d", count+1); strncpy(state->desc, cx->desc, CPUIDLE_DESC_LEN); count++;