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 11:16:25 +0000 (13:16 +0200)
commit5dffc1be6552bff51a99ef78820fc85fc84277e2
treee0b36b279d7b9a80516ba29803fec5484bda8538
parent74276868b45585f77eae2372c95e016aacfd0d3c
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