drm/vmwgfx: Replace the hw mutex with a hw spinlock
authorThomas Hellstrom <thellstrom@vmware.com>
Wed, 14 Jan 2015 10:33:39 +0000 (02:33 -0800)
committerThomas Hellstrom <thellstrom@vmware.com>
Mon, 19 Jan 2015 11:02:13 +0000 (03:02 -0800)
commit496eb6fd2c3fd13f4b914e537598e5c86ce4f52a
treed2c1fc2d9384e197f54da6196223d7e640c5e0e9
parent79305ec6e60d320832505e95c1a028d309fcd2b6
drm/vmwgfx: Replace the hw mutex with a hw spinlock

Fixes a case where we call vmw_fifo_idle() from within a wait function with
task state !TASK_RUNNING, which is illegal.

In addition, make the locking fine-grained, so that it is performed once
for every read- and write operation. This is of course more costly, but we
don't perform much register access in the timing critical paths anyway. Instead
we have the extra benefit of being sure that we don't forget the hw lock around
register accesses. I think currently the kms code was quite buggy w r t this.

This fixes Red Hat Bugzilla Bug 1180796

Cc: stable@vger.kernel.org
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c
drivers/gpu/drm/vmwgfx/vmwgfx_irq.c
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c