]> git.proxmox.com Git - mirror_qemu.git/commitdiff
hw/timer/imx_epit: update interrupt state on CR write access
authorAxel Heider <axel.heider@hensoldt.net>
Tue, 25 Oct 2022 18:32:30 +0000 (20:32 +0200)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 5 Jan 2023 12:14:43 +0000 (12:14 +0000)
The interrupt state can change due to:
- reset clears both SR.OCIF and CR.OCIE
- write to CR.EN or CR.OCIE

Signed-off-by: Axel Heider <axel.heider@hensoldt.net>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/timer/imx_epit.c

index f148868b8cb72951204ae593b34852faf0d38081..7af3a8b10e8233ca16c58317b54af031d6a0f59f 100644 (file)
@@ -206,12 +206,20 @@ static void imx_epit_write(void *opaque, hwaddr offset, uint64_t value,
         if (s->cr & CR_SWR) {
             /* handle the reset */
             imx_epit_reset(DEVICE(s));
-            /*
-             * TODO: could we 'break' here? following operations appear
-             * to duplicate the work imx_epit_reset() already did.
-             */
         }
 
+        /*
+         * The interrupt state can change due to:
+         * - reset clears both SR.OCIF and CR.OCIE
+         * - write to CR.EN or CR.OCIE
+         */
+        imx_epit_update_int(s);
+
+        /*
+         * TODO: could we 'break' here for reset? following operations appear
+         * to duplicate the work imx_epit_reset() already did.
+         */
+
         ptimer_transaction_begin(s->timer_cmp);
         ptimer_transaction_begin(s->timer_reload);