From: shawn.guo@linaro.org (Shawn Guo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 1/4] ARM: imx: return zero in case next event gets a large increment
Date: Thu, 6 Dec 2012 22:54:41 +0800 [thread overview]
Message-ID: <1354805681-29436-1-git-send-email-shawn.guo@linaro.org> (raw)
In-Reply-To: <1354632915-27134-2-git-send-email-shawn.guo@linaro.org>
The return of v2_set_next_event() will lead to an infinite loop in
tick_handle_oneshot_broadcast() - "goto again;" with imx6q WAIT mode
(to be enabled). This happens because when global event did not expire
any CPU local events, the broadcast device will be rearmed to a CPU
local next_event, which could be far away from now and result in a
max_delta_tick programming in set_next_event().
Fix the problem by detecting those next events with increments larger
than 0x7fffffff, and simply return zero in that case.
It leaves mx1_2_set_next_event() unchanged since only v2_set_next_event()
will be running with imx6q WAIT mode support.
Thanks Russell King for helping understand the problem.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
arch/arm/mach-imx/time.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c
index f017302..5d7eb48 100644
--- a/arch/arm/mach-imx/time.c
+++ b/arch/arm/mach-imx/time.c
@@ -152,7 +152,8 @@ static int v2_set_next_event(unsigned long evt,
__raw_writel(tcmp, timer_base + V2_TCMP);
- return (int)(tcmp - __raw_readl(timer_base + V2_TCN)) < 0 ?
+ return evt < 0x7fffffff &&
+ (int)(tcmp - __raw_readl(timer_base + V2_TCN)) < 0 ?
-ETIME : 0;
}
--
1.7.9.5
next prev parent reply other threads:[~2012-12-06 14:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-04 14:55 [PATCH v2 0/4] Support imx6q WAIT mode Shawn Guo
2012-12-04 14:55 ` [PATCH v2 1/4] ARM: imx: allow timer counter to roll over Shawn Guo
2012-12-04 15:44 ` Russell King - ARM Linux
2012-12-05 12:14 ` Shawn Guo
2012-12-05 12:09 ` Russell King - ARM Linux
2012-12-06 9:34 ` Shawn Guo
2012-12-06 14:54 ` Shawn Guo [this message]
2012-12-04 14:55 ` [PATCH v2 2/4] ARM: imx: mask gpc interrupts initially Shawn Guo
2012-12-04 14:55 ` [PATCH v2 3/4] ARM: imx: move imx6q_cpuidle_driver into a separate file Shawn Guo
2012-12-04 14:55 ` [PATCH v2 4/4] ARM: imx6q: support WAIT mode using cpuidle Shawn Guo
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=1354805681-29436-1-git-send-email-shawn.guo@linaro.org \
--to=shawn.guo@linaro.org \
--cc=linux-arm-kernel@lists.infradead.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).