drm/nouveau/tmr: fully separate alarm execution/pending lists
authorBen Skeggs <bskeggs@redhat.com>
Mon, 5 Jun 2017 07:23:32 +0000 (17:23 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jun 2017 13:06:04 +0000 (15:06 +0200)
commitaae14f569f5dbd13f9a7f34db8110e1658ef2c48
tree05b5930bac8584523a635d639cb020a672061f0c
parent7860d0e5e2bf986d4bd06e7b029786747b5dc766
drm/nouveau/tmr: fully separate alarm execution/pending lists

commit b4e382ca7586a63b6c1e5221ce0863ff867c2df6 upstream.

Reusing the list_head for both is a bad idea.  Callback execution is done
with the lock dropped so that alarms can be rescheduled from the callback,
which means that with some unfortunate timing, lists can get corrupted.

The execution list should not require its own locking, the single function
that uses it can only be called from a single context.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/nouveau/include/nvkm/subdev/timer.h
drivers/gpu/drm/nouveau/nvkm/subdev/timer/base.c