79c4324644
Change-Id: I2d302dda68298877c65c99147f5bf22186a59aac
44 lines
1.7 KiB
Diff
44 lines
1.7 KiB
Diff
From bdd1741cf18959e70cdfc6f46bb41d9209e86315 Mon Sep 17 00:00:00 2001
|
|
From: jianchunfu <jianchunfu_yewu@cmss.chinamobile.com>
|
|
Date: Thu, 24 Nov 2022 17:18:00 +0800
|
|
Subject: [PATCH 18/29] target/imx: reload cmp timer outside of the reload
|
|
ptimer transaction
|
|
|
|
When running seL4 tests (https://docs.sel4.systems/projects/sel4test)
|
|
on the sabrelight platform, the timer tests fail. The arm/imx6 EPIT
|
|
timer interrupt does not fire properly, instead of a e.g. second in
|
|
can take up to a minute to finally see the interrupt.
|
|
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1263
|
|
|
|
Signed-off-by: Axel Heider <axel.heider@hensoldt.net>
|
|
Signed-off-by: jianchunfu <jianchunfu_yewu@cmss.chinamobile.com>
|
|
---
|
|
hw/timer/imx_epit.c | 9 +++++++--
|
|
1 file changed, 7 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/hw/timer/imx_epit.c b/hw/timer/imx_epit.c
|
|
index ebd58254d1..a78b625d15 100644
|
|
--- a/hw/timer/imx_epit.c
|
|
+++ b/hw/timer/imx_epit.c
|
|
@@ -275,10 +275,15 @@ static void imx_epit_write(void *opaque, hwaddr offset, uint64_t value,
|
|
/* If IOVW bit is set then set the timer value */
|
|
ptimer_set_count(s->timer_reload, s->lr);
|
|
}
|
|
-
|
|
+ /*
|
|
+ * Commit the change to s->timer_reload, so it can propagate. Otherwise
|
|
+ * the timer interrupt may not fire properly. The commit must happen
|
|
+ * before calling imx_epit_reload_compare_timer(), which reads
|
|
+ * s->timer_reload internally again.
|
|
+ */
|
|
+ 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 */
|
|
--
|
|
2.27.0
|
|
|