aboutsummaryrefslogtreecommitdiff
path: root/hw/timer
diff options
context:
space:
mode:
authorAxel Heider <axel.heider@hensoldt.net>2023-04-20 10:21:14 +0100
committerPeter Maydell <peter.maydell@linaro.org>2023-04-20 10:21:14 +0100
commit25d758175dfbfd53e02b4a52ac68cbd6eb05f648 (patch)
treec7c5be273e0a2cbcbc000b727bf73b10bed4561c /hw/timer
parent542fd43d79327dabe62e49ff584ca60b6184923a (diff)
hw/timer/imx_epit: fix limit check
Fix the limit check. If the limit is less than the compare value, the timer can never reach this value, thus it will never fire. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1491 Signed-off-by: Axel Heider <axel.heider@hensoldt.net> Message-id: 168070611775.20412.2883242077302841473-2@git.sr.ht Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/timer')
-rw-r--r--hw/timer/imx_epit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/timer/imx_epit.c b/hw/timer/imx_epit.c
index 0821c62cd1..640e4399c2 100644
--- a/hw/timer/imx_epit.c
+++ b/hw/timer/imx_epit.c
@@ -179,7 +179,7 @@ static void imx_epit_update_compare_timer(IMXEPITState *s)
* the compare value. Otherwise it may fire at most once in the
* current round.
*/
- is_oneshot = (limit >= s->cmp);
+ is_oneshot = (limit < s->cmp);
if (counter >= s->cmp) {
/* The compare timer fires in the current round. */
counter -= s->cmp;