Commit f4589f7bdc83ec0b908645f7d6bc30cbf2f9a559
Committed by
Greg Kroah-Hartman
1 parent
f34d67febf
drm/nouveau/nouveau: Do not BUG_ON(!spin_is_locked()) on UP
commit ff4c0d5213b015e60aa87c1352604f10ba9c3e12 upstream. On !SMP systems spinlocks do not exist. Thus checking of they are active will always fail. Use assert_spin_locked(lock); instead of BUG_ON(!spin_is_locked(lock)); to not BUG() on all UP systems. Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Showing 2 changed files with 3 additions and 3 deletions Side-by-side Diff
drivers/gpu/drm/nouveau/core/core/event.c
... | ... | @@ -26,7 +26,7 @@ |
26 | 26 | void |
27 | 27 | nvkm_event_put(struct nvkm_event *event, u32 types, int index) |
28 | 28 | { |
29 | - BUG_ON(!spin_is_locked(&event->refs_lock)); | |
29 | + assert_spin_locked(&event->refs_lock); | |
30 | 30 | while (types) { |
31 | 31 | int type = __ffs(types); types &= ~(1 << type); |
32 | 32 | if (--event->refs[index * event->types_nr + type] == 0) { |
... | ... | @@ -39,7 +39,7 @@ |
39 | 39 | void |
40 | 40 | nvkm_event_get(struct nvkm_event *event, u32 types, int index) |
41 | 41 | { |
42 | - BUG_ON(!spin_is_locked(&event->refs_lock)); | |
42 | + assert_spin_locked(&event->refs_lock); | |
43 | 43 | while (types) { |
44 | 44 | int type = __ffs(types); types &= ~(1 << type); |
45 | 45 | if (++event->refs[index * event->types_nr + type] == 1) { |
drivers/gpu/drm/nouveau/core/core/notify.c
... | ... | @@ -98,7 +98,7 @@ |
98 | 98 | struct nvkm_event *event = notify->event; |
99 | 99 | unsigned long flags; |
100 | 100 | |
101 | - BUG_ON(!spin_is_locked(&event->list_lock)); | |
101 | + assert_spin_locked(&event->list_lock); | |
102 | 102 | BUG_ON(size != notify->size); |
103 | 103 | |
104 | 104 | spin_lock_irqsave(&event->refs_lock, flags); |