Ver código fonte

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>
Axel Heider 2 anos atrás
pai
commit
25d758175d
1 arquivos alterados com 1 adições e 1 exclusões
  1. 1 1
      hw/timer/imx_epit.c

+ 1 - 1
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
          * the compare value. Otherwise it may fire at most once in the
          * current round.
          * current round.
          */
          */
-        is_oneshot = (limit >= s->cmp);
+        is_oneshot = (limit < s->cmp);
         if (counter >= s->cmp) {
         if (counter >= s->cmp) {
             /* The compare timer fires in the current round. */
             /* The compare timer fires in the current round. */
             counter -= s->cmp;
             counter -= s->cmp;