From patchwork Wed Apr 4 09:42:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 7607 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id E6C0423E4C for ; Wed, 4 Apr 2012 09:42:41 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id B0A40A1846F for ; Wed, 4 Apr 2012 09:42:41 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so109604iag.11 for ; Wed, 04 Apr 2012 02:42:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=LaahM//Nm+AW7lkCx/y5UI/ttbwfdh5afQMuU1QuZv4=; b=HWHLCBGuFxTr8cWyaqfAbXh9v7hEDM0MKFoh5YMKbLLb2KPb/yexTfVqXtOLtN5ATI +28FQY7yq9b4+las4LpYhxuJbWePQfmjNgD/qsRb1JyPSRDM60c2QC51/vD0JW1j5n87 gs/Kp973QUFUXdlwwLEkGGxrtfzwF0RiLT7WTD4+aqEE6tYycgwZluyR6pZZ1oW5QGcS GWZ3YZYUcm3cxPeu6k80SPtQCAKyQp4DgpG7bDT1kP0HnOM08eSdpxk+76xttZUWuqZW Rm2yMNJn8ed6alHYMCqKQDXoCcYI6tq93Y6DOWs/mWjLIoIEcdX7SrTbPiZU7VJ0m4QZ qcFQ== Received: by 10.50.194.232 with SMTP id hz8mr915384igc.38.1333532561509; Wed, 04 Apr 2012 02:42:41 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.164.217 with SMTP id f25csp31250iby; Wed, 4 Apr 2012 02:42:41 -0700 (PDT) Received: by 10.180.104.231 with SMTP id gh7mr3642442wib.10.1333532558555; Wed, 04 Apr 2012 02:42:38 -0700 (PDT) Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by mx.google.com with ESMTPS id g9si86178wee.142.2012.04.04.02.42.38 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 04 Apr 2012 02:42:38 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.178 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=209.85.212.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.178 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) smtp.mail=daniel.lezcano@linaro.org Received: by mail-wi0-f178.google.com with SMTP id hq7so61598wib.13 for ; Wed, 04 Apr 2012 02:42:38 -0700 (PDT) Received: by 10.180.24.35 with SMTP id r3mr3644776wif.7.1333532558111; Wed, 04 Apr 2012 02:42:38 -0700 (PDT) Received: from localhost.localdomain (AToulouse-159-1-7-136.w90-60.abo.wanadoo.fr. [90.60.242.136]) by mx.google.com with ESMTPS id bx13sm3462265wib.10.2012.04.04.02.42.36 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 04 Apr 2012 02:42:37 -0700 (PDT) From: Daniel Lezcano To: tony@atomide.com, khilman@ti.com Cc: j-pihet@ti.com, santosh.shilimkar@ti.com, rob.lee@linaro.org, linaro-dev@lists.linaro.org, patches@linaro.org Subject: [PATCH 10/17] ARM: OMAP3: cpuidle - remove the 'valid' field Date: Wed, 4 Apr 2012 11:42:12 +0200 Message-Id: <1333532539-10298-11-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1333532539-10298-1-git-send-email-daniel.lezcano@linaro.org> References: <1333532539-10298-1-git-send-email-daniel.lezcano@linaro.org> X-Gm-Message-State: ALoCoQmDSr9jzDAVRoJuW/ZfS11DP4Uy4DYXsZff75b5awyfN9ibX8b7W7skkovkRnwegzK2zQAj With the previous changes all the states are valid, except the last state which can be handled by decreasing the number of states. Signed-off-by: Daniel Lezcano --- arch/arm/mach-omap2/cpuidle34xx.c | 12 +++--------- 1 files changed, 3 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c index 11a2c23..3f46e45 100644 --- a/arch/arm/mach-omap2/cpuidle34xx.c +++ b/arch/arm/mach-omap2/cpuidle34xx.c @@ -67,7 +67,6 @@ static struct cpuidle_params cpuidle_params_table[] = { struct omap3_idle_statedata { u32 mpu_state; u32 core_state; - u8 valid; }; struct omap3_idle_statedata omap3_idle_data[OMAP3_NUM_STATES]; @@ -191,8 +190,7 @@ static int next_valid_state(struct cpuidle_device *dev, } /* Check if current state is valid */ - if ((cx->valid) && - (cx->mpu_state >= mpu_deepest_state) && + if ((cx->mpu_state >= mpu_deepest_state) && (cx->core_state >= core_deepest_state)) { return index; } else { @@ -216,8 +214,7 @@ static int next_valid_state(struct cpuidle_device *dev, idx--; for (; idx >= 0; idx--) { cx = cpuidle_get_statedata(&dev->states_usage[idx]); - if ((cx->valid) && - (cx->mpu_state >= mpu_deepest_state) && + if ((cx->mpu_state >= mpu_deepest_state) && (cx->core_state >= core_deepest_state)) { next_index = idx; break; @@ -371,7 +368,6 @@ static inline struct omap3_idle_statedata *_fill_cstate_usage( struct omap3_idle_statedata *cx = &omap3_idle_data[idx]; struct cpuidle_state_usage *state_usage = &dev->states_usage[idx]; - cx->valid = cpuidle_params_table[idx].valid; cpuidle_set_statedata(state_usage, cx); return cx; @@ -399,7 +395,6 @@ int __init omap3_idle_init(void) /* C1 . MPU WFI + Core active */ cx = _fill_cstate_usage(dev, 0); - cx->valid = 1; /* C1 is always valid */ cx->mpu_state = PWRDM_POWER_ON; cx->core_state = PWRDM_POWER_ON; @@ -436,14 +431,13 @@ int __init omap3_idle_init(void) * We disable C7 state as a result. */ if (IS_PM34XX_ERRATUM(PM_SDRC_WAKEUP_ERRATUM_i583)) { - cx->valid = 0; + drv->state_count = OMAP3_NUM_STATES - 1; pr_warn("%s: core off state C7 disabled due to i583\n", __func__); } cx->mpu_state = PWRDM_POWER_OFF; cx->core_state = PWRDM_POWER_OFF; - drv->state_count = OMAP3_NUM_STATES; cpuidle_register_driver(&omap3_idle_driver); if (cpuidle_register_device(dev)) {