Skip to contentSkip to conversation

target/imx: reload cmp timer outside of the reload ptimer transaction

PATCH New ~axelheider 1 participant 2 messages Oct 19, 2022 Arm i.MX and Layerscape

lore
Share & tools
lore
#0 lore raw

cover target/imx: reload cmp timer outside of the reload ptimer transaction

When testing with seL4 and a timer driver, without this patch the the interrupt takes up to a minute to arrived when the timer is set to fire after 1 second. This patch fixes the timer interrupt triggering.

regards, Axel

Axel Heider (1):
target/imx: reload cmp timer outside of the reload ptimer transaction

 hw/timer/imx_epit.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
Signature · 1 line
2.34.4
#1 lore raw

PATCH 1/1 target/imx: reload cmp timer outside of the reload ptimer transaction

From: Axel Heider <[email protected]>

---
 hw/timer/imx_epit.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
hw/timer/imx_epit.c +4 -1
index 2bf8c754b2..0b13c1eab0 100644
@@ -276,9 +276,12 @@ static void imx_epit_write(void *opaque, hwaddr offset, uint64_t value,
             ptimer_set_count(s->timer_reload, s->lr);
         }
 
+        // commit s->timer_reload before imx_epit_reload_compare_timer
+        // as timer_reload is read in imx_epit_reload_compare_timer
+        ptimer_transaction_commit(s->timer_reload);
+
         imx_epit_reload_compare_timer(s);
         ptimer_transaction_commit(s->timer_cmp);
-        ptimer_transaction_commit(s->timer_reload);
         break;
 
     case 3: /* CMP */
Signature · 1 line
2.34.4