[v1,2/2] xilinx_timer: Fixed deadlock issue

Message ID 76daa1ac80c24545ff82d85a8426cb6a61757c32.1339823397.git.peter.crosthwaite@petalogix.com
State New
Headers show

Commit Message

Peter A. G. Crosthwaite June 16, 2012, 5:20 a.m.
The timer was deadlocking when the interval was set too low. It would cause a
flood of timer events and the CPU would halt indefinately. This is a known issue
and theres a generic workaround in place in ptimer on ptimer_set_limit(),
however the Xilinx timer uses ptimer_set_count() instead of set_limit. Changed
the call to set_count() to an equivalent call of set_limit() instead, which
brings the workaround into play.

Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
 hw/xilinx_timer.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/hw/xilinx_timer.c b/hw/xilinx_timer.c
index e8b7a59..b562bd0 100644
--- a/hw/xilinx_timer.c
+++ b/hw/xilinx_timer.c
@@ -136,7 +136,7 @@  static void timer_enable(struct xlx_timer *xt)
         count = xt->regs[R_TLR];
         count = ~0 - xt->regs[R_TLR];
-    ptimer_set_count(xt->ptimer, count);
+    ptimer_set_limit(xt->ptimer, count, 1);
     ptimer_run(xt->ptimer, 1);