From: Axel Heider Date: Thu, 20 Apr 2023 09:21:14 +0000 (+0100) Subject: hw/timer/imx_epit: fix limit check X-Git-Tag: v8.0.1~70 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=134a1a33207723bf0adc35e2272b6a147484d4b8;p=thirdparty%2Fqemu.git 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 Message-id: 168070611775.20412.2883242077302841473-2@git.sr.ht Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell (cherry picked from commit 25d758175dfbfd53e02b4a52ac68cbd6eb05f648) Signed-off-by: Michael Tokarev --- diff --git a/hw/timer/imx_epit.c b/hw/timer/imx_epit.c index 0821c62cd1c..640e4399c24 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;