drm/nouveau/tmr: ack interrupt before processing alarms
authorBen Skeggs <bskeggs@redhat.com>
Thu, 11 May 2017 06:53:42 +0000 (16:53 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 11 May 2017 22:32:57 +0000 (08:32 +1000)
Fixes a race where we can miss an alarm that triggers while we're already
processing previous alarms.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Cc: stable@vger.kernel.org
drivers/gpu/drm/nouveau/nvkm/subdev/timer/nv04.c

index 7b9ce87f061767ad25771074c3e88a34574b83a9..7f48249f41decea964d62790601b6be5d6d78f4c 100644 (file)
@@ -76,8 +76,8 @@ nv04_timer_intr(struct nvkm_timer *tmr)
        u32 stat = nvkm_rd32(device, NV04_PTIMER_INTR_0);
 
        if (stat & 0x00000001) {
-               nvkm_timer_alarm_trigger(tmr);
                nvkm_wr32(device, NV04_PTIMER_INTR_0, 0x00000001);
+               nvkm_timer_alarm_trigger(tmr);
                stat &= ~0x00000001;
        }