Skip to contentSkip to conversation

Xilinx Timer updates

PATCH Applied Peter A. G. Crosthwaite 2 participants 4 messages Jun 16, 2012 – Jun 21, 2012 Arm/Zynq architecture

lore
Share & tools
lore
#0 lore raw

cover Xilinx Timer updates

Patch 1 is trival, just deleted a redundant include that shouldn't be there. Patch 2 is a major bugfix for Microblaze platforms - the timer was deadlocking the system.

Peter A. G. Crosthwaite (2):
xilinx_timer: Removed include of qemu-timer
xilinx_timer: Fixed deadlock issue

 hw/xilinx_timer.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
Signature · 1 line
1.7.3.2
#1 lore raw

PATCH 1/2 xilinx_timer: Removed include of qemu-timer

The Xilinx timer does not interact with the qemu_timer API, so dont include it.

---
 hw/xilinx_timer.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
hw/xilinx_timer.c +0 -1
index 0683ce1..e8b7a59 100644
@@ -23,7 +23,6 @@
  */
 
 #include "sysbus.h"
-#include "qemu-timer.h"
 #include "ptimer.h"
 
 #define D(x)
Signature · 1 line
1.7.3.2
#2 lore raw

PATCH 2/2 xilinx_timer: Fixed deadlock issue

In reply to Peter A. G. Crosthwaite

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.

---
 hw/xilinx_timer.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/xilinx_timer.c +1 -1
index e8b7a59..b562bd0 100644
@@ -136,7 +136,7 @@ static void timer_enable(struct xlx_timer *xt)
         count = xt->regs[R_TLR];
     else
         count = ~0 - xt->regs[R_TLR];
-    ptimer_set_count(xt->ptimer, count);
+    ptimer_set_limit(xt->ptimer, count, 1);
     ptimer_run(xt->ptimer, 1);
 }
 
Signature · 1 line
1.7.3.2
#3 lore raw
In reply to Peter A. G. Crosthwaite
Quoted 7 lines · Peter A. G. Crosthwaite

Patch 1 is trival, just deleted a redundant include that shouldn't be there. Patch 2 is a major bugfix for Microblaze platforms - the timer was deadlocking the system.

Peter A. G. Crosthwaite (2):
xilinx_timer: Removed include of qemu-timer
xilinx_timer: Fixed deadlock issue

Applied, thanks Peter

Quoted 7 lines
 hw/xilinx_timer.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
Signature · 1 line
1.7.3.2