From: Mike Chan <mike@android.com>
Cc: khilman@deeprootsystems.com, linux-omap@vger.kernel.org,
Mike Chan <mike@android.com>
Subject: [PATCH 2/2] [ARM] omap-pm: resource: Only update resource level if there is a change
Date: Mon, 3 May 2010 17:34:31 -0700 [thread overview]
Message-ID: <1272933271-12937-2-git-send-email-mike@android.com> (raw)
In-Reply-To: <1272933271-12937-1-git-send-email-mike@android.com>
Previosuly update_resource_level() would always call the change_level()
function, even if there was no change necessary.
Signed-off-by: Mike Chan <mike@android.com>
---
arch/arm/plat-omap/resource.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/arch/arm/plat-omap/resource.c b/arch/arm/plat-omap/resource.c
index 6d3bba6..ff5a938 100644
--- a/arch/arm/plat-omap/resource.c
+++ b/arch/arm/plat-omap/resource.c
@@ -104,7 +104,7 @@ static int update_resource_level(struct shared_resource *resp)
{
struct users_list *user;
unsigned long target_level;
- int ret;
+ int ret = 0;
mutex_lock(&resp->resource_mutex);
/* Regenerate the target_value for the resource */
@@ -125,6 +125,9 @@ static int update_resource_level(struct shared_resource *resp)
}
mutex_unlock(&resp->resource_mutex);
+ if (resp->curr_level == target_level)
+ return ret;
+
pr_debug("SRF: Changing Level for resource %s to %ld\n",
resp->name, target_level);
ret = resp->ops->change_level(resp, target_level);
--
1.7.0.1
prev parent reply other threads:[~2010-05-04 0:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-04 0:34 [PATCH 1/2] [ARM] omap-pm: resource: Lock resource list in update_resource_level Mike Chan
2010-05-04 0:34 ` Mike Chan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1272933271-12937-2-git-send-email-mike@android.com \
--to=mike@android.com \
--cc=khilman@deeprootsystems.com \
--cc=linux-omap@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).