From: Paul Walmsley <paul@pwsan.com> To: Kevin Hilman <khilman@deeprootsystems.com> Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 1/3] OMAP2+: powerdomain: add API to get context loss count Date: Tue, 21 Dec 2010 19:06:00 -0700 (MST) [thread overview] Message-ID: <alpine.DEB.2.00.1012211904290.1446@utopia.booyaka.com> (raw) In-Reply-To: <1292634855-14728-1-git-send-email-khilman@deeprootsystems.com> Hi Kevin On Fri, 17 Dec 2010, Kevin Hilman wrote: > Add new powerdomain API > > u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm) > > for checking how many times the powerdomain has lost context. The > loss count is the sum sum of the powerdomain off-mode counter, the > logic off counter and the per-bank memory off counter. > > Cc: Paul Walmsley <paul@pwsan.com> > Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com> I've updated this patch to tweak the function's comments and to remove the negative return code from a function returning an u32. Updated patch is below. - Paul From: Kevin Hilman <khilman@deeprootsystems.com> Date: Fri, 17 Dec 2010 17:14:13 -0800 Subject: [PATCH] OMAP2+: powerdomain: add API to get context loss count Add new powerdomain API u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm) for checking how many times the powerdomain has lost context. The loss count is the sum of the powerdomain off-mode counter, the logic off counter and the per-bank memory off counter. Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com> [paul@pwsan.com: removed bogus return value on error; improved kerneldoc; tweaked commit message] Signed-off-by: Paul Walmsley <paul@pwsan.com> --- arch/arm/mach-omap2/powerdomain.c | 29 +++++++++++++++++++++++++++++ arch/arm/mach-omap2/powerdomain.h | 1 + 2 files changed, 30 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index 06ef60ee..eaed0df 100644 --- a/arch/arm/mach-omap2/powerdomain.c +++ b/arch/arm/mach-omap2/powerdomain.c @@ -909,3 +909,32 @@ int pwrdm_post_transition(void) pwrdm_for_each(_pwrdm_post_transition_cb, NULL); return 0; } + +/** + * pwrdm_get_context_loss_count - get powerdomain's context loss count + * @pwrdm: struct powerdomain * to wait for + * + * Context loss count is the sum of powerdomain off-mode counter, the + * logic off counter and the per-bank memory off counter. Returns 0 + * (and WARNs) upon error, otherwise, returns the context loss count. + */ +u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm) +{ + int i, count; + + if (!pwrdm) { + WARN(1, "powerdomain: %s: pwrdm is null\n", __func__); + return 0; + } + + count = pwrdm->state_counter[PWRDM_POWER_OFF]; + count += pwrdm->ret_logic_off_counter; + + for (i = 0; i < pwrdm->banks; i++) + count += pwrdm->ret_mem_off_counter[i]; + + pr_debug("powerdomain: %s: context loss count = %u\n", + pwrdm->name, count); + + return count; +} diff --git a/arch/arm/mach-omap2/powerdomain.h b/arch/arm/mach-omap2/powerdomain.h index 35b5b48..c66431e 100644 --- a/arch/arm/mach-omap2/powerdomain.h +++ b/arch/arm/mach-omap2/powerdomain.h @@ -211,6 +211,7 @@ int pwrdm_clkdm_state_switch(struct clockdomain *clkdm); int pwrdm_pre_transition(void); int pwrdm_post_transition(void); int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm); +u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm); extern void omap2xxx_powerdomains_init(void); extern void omap3xxx_powerdomains_init(void); -- 1.7.2.3
WARNING: multiple messages have this Message-ID (diff)
From: paul@pwsan.com (Paul Walmsley) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/3] OMAP2+: powerdomain: add API to get context loss count Date: Tue, 21 Dec 2010 19:06:00 -0700 (MST) [thread overview] Message-ID: <alpine.DEB.2.00.1012211904290.1446@utopia.booyaka.com> (raw) In-Reply-To: <1292634855-14728-1-git-send-email-khilman@deeprootsystems.com> Hi Kevin On Fri, 17 Dec 2010, Kevin Hilman wrote: > Add new powerdomain API > > u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm) > > for checking how many times the powerdomain has lost context. The > loss count is the sum sum of the powerdomain off-mode counter, the > logic off counter and the per-bank memory off counter. > > Cc: Paul Walmsley <paul@pwsan.com> > Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com> I've updated this patch to tweak the function's comments and to remove the negative return code from a function returning an u32. Updated patch is below. - Paul From: Kevin Hilman <khilman@deeprootsystems.com> Date: Fri, 17 Dec 2010 17:14:13 -0800 Subject: [PATCH] OMAP2+: powerdomain: add API to get context loss count Add new powerdomain API u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm) for checking how many times the powerdomain has lost context. The loss count is the sum of the powerdomain off-mode counter, the logic off counter and the per-bank memory off counter. Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com> [paul at pwsan.com: removed bogus return value on error; improved kerneldoc; tweaked commit message] Signed-off-by: Paul Walmsley <paul@pwsan.com> --- arch/arm/mach-omap2/powerdomain.c | 29 +++++++++++++++++++++++++++++ arch/arm/mach-omap2/powerdomain.h | 1 + 2 files changed, 30 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index 06ef60ee..eaed0df 100644 --- a/arch/arm/mach-omap2/powerdomain.c +++ b/arch/arm/mach-omap2/powerdomain.c @@ -909,3 +909,32 @@ int pwrdm_post_transition(void) pwrdm_for_each(_pwrdm_post_transition_cb, NULL); return 0; } + +/** + * pwrdm_get_context_loss_count - get powerdomain's context loss count + * @pwrdm: struct powerdomain * to wait for + * + * Context loss count is the sum of powerdomain off-mode counter, the + * logic off counter and the per-bank memory off counter. Returns 0 + * (and WARNs) upon error, otherwise, returns the context loss count. + */ +u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm) +{ + int i, count; + + if (!pwrdm) { + WARN(1, "powerdomain: %s: pwrdm is null\n", __func__); + return 0; + } + + count = pwrdm->state_counter[PWRDM_POWER_OFF]; + count += pwrdm->ret_logic_off_counter; + + for (i = 0; i < pwrdm->banks; i++) + count += pwrdm->ret_mem_off_counter[i]; + + pr_debug("powerdomain: %s: context loss count = %u\n", + pwrdm->name, count); + + return count; +} diff --git a/arch/arm/mach-omap2/powerdomain.h b/arch/arm/mach-omap2/powerdomain.h index 35b5b48..c66431e 100644 --- a/arch/arm/mach-omap2/powerdomain.h +++ b/arch/arm/mach-omap2/powerdomain.h @@ -211,6 +211,7 @@ int pwrdm_clkdm_state_switch(struct clockdomain *clkdm); int pwrdm_pre_transition(void); int pwrdm_post_transition(void); int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm); +u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm); extern void omap2xxx_powerdomains_init(void); extern void omap3xxx_powerdomains_init(void); -- 1.7.2.3
next prev parent reply other threads:[~2010-12-22 2:06 UTC|newest] Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top 2010-12-18 1:14 [PATCH 1/3] OMAP2+: powerdomain: add API to get context loss count Kevin Hilman 2010-12-18 1:14 ` Kevin Hilman 2010-12-18 1:14 ` [PATCH 2/3] OMAP: PM: implement context loss count APIs Kevin Hilman 2010-12-18 1:14 ` Kevin Hilman 2010-12-18 1:14 ` [PATCH 3/3] OMAP: PM noop: implement context loss count for non-omap_devices Kevin Hilman 2010-12-18 1:14 ` Kevin Hilman 2010-12-22 4:38 ` Paul Walmsley 2010-12-22 4:38 ` Paul Walmsley 2010-12-22 5:38 ` Paul Walmsley 2010-12-22 5:38 ` Paul Walmsley 2010-12-22 2:06 ` Paul Walmsley [this message] 2010-12-22 2:06 ` [PATCH 1/3] OMAP2+: powerdomain: add API to get context loss count Paul Walmsley 2010-12-22 3:26 ` Paul Walmsley 2010-12-22 3:26 ` Paul Walmsley
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=alpine.DEB.2.00.1012211904290.1446@utopia.booyaka.com \ --to=paul@pwsan.com \ --cc=khilman@deeprootsystems.com \ --cc=linux-arm-kernel@lists.infradead.org \ --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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.