From patchwork Wed Apr 4 20:12:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 7642 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 5B76523E47 for ; Wed, 4 Apr 2012 20:13:15 +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 24F05A1869F for ; Wed, 4 Apr 2012 20:13:15 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so1063293iag.11 for ; Wed, 04 Apr 2012 13:13:14 -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=Y2Kw7qZrQasQvn4irpOkgzju/MzsVh3NgfILy1vfeS8=; b=h+ZfFUnYHtKBD00OIgJ6G0wpHznj/vkvM3LCsqKmLHJ4wJ/gc5fF/mG9kervgRDjkf a8BOyfSRGoE2LEgdzKeQ3IhHj22LzmN7nUOKCzIZQsqyNmQpMMjSpoYCISrE+1J+uwyk zbODzqcOmiasgsK8zP42ITzqIG8nhHXTt7kNDn18CZ6QrK7j6LXyz0lXSltP1E0h0Ffr MAHwxBn0B8DqPTCk5Ai7htsBbsZVPFaB9eBHK5kKvpxWx7mYfCiJ6W9AzihXh88PVHFQ pwPMcsDJTdFKog8K0MYgOvqYtSidD0SnCzw6tXy0IQlFSYKiZheCGrEzLXxNDw/fwtJe WWHQ== Received: by 10.50.168.67 with SMTP id zu3mr2852151igb.28.1333570394936; Wed, 04 Apr 2012 13:13:14 -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 f25csp56478iby; Wed, 4 Apr 2012 13:13:14 -0700 (PDT) Received: by 10.14.127.204 with SMTP id d52mr3594665eei.18.1333570393489; Wed, 04 Apr 2012 13:13:13 -0700 (PDT) Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by mx.google.com with ESMTPS id n52si1979021wed.91.2012.04.04.13.13.12 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 04 Apr 2012 13:13:13 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.50 is neither permitted nor denied by best guess record for domain of daniel.lezcano@linaro.org) client-ip=74.125.82.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.50 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-wg0-f50.google.com with SMTP id ds12so644793wgb.31 for ; Wed, 04 Apr 2012 13:13:12 -0700 (PDT) Received: by 10.216.203.146 with SMTP id f18mr2212398weo.21.1333570392622; Wed, 04 Apr 2012 13:13:12 -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 gd4sm6869495wib.6.2012.04.04.13.13.10 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 04 Apr 2012 13:13:11 -0700 (PDT) From: Daniel Lezcano To: santosh.shilimkar@ti.com, jean.pihet@newoldbits.com, khilman@ti.com, tony@atomide.com Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, rob.lee@linaro.org, linaro-dev@lists.linaro.org, patches@linaro.org Subject: [PATCH 10/17][V2] ARM: OMAP3: cpuidle - remove the 'valid' field Date: Wed, 4 Apr 2012 22:12:44 +0200 Message-Id: <1333570371-1389-11-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1333570371-1389-1-git-send-email-daniel.lezcano@linaro.org> References: <1333570371-1389-1-git-send-email-daniel.lezcano@linaro.org> X-Gm-Message-State: ALoCoQkfXh3mWDjUiQsNXdboKQOUxHu4pTDt73TTpyNEmYmoKRYt3YnVHrz5rtmvcE5JbsOjVl8Y 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 Reviewed-by: Jean Pihet --- 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)) {