]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Fix lock order reversal in GTT pwrite path.
authorEric Anholt <eric@anholt.net>
Mon, 9 Mar 2009 16:42:23 +0000 (09:42 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 27 Mar 2009 21:45:52 +0000 (14:45 -0700)
commit743cabaa2b8348f3cd55b768c73c99402a222346
tree9434d262168de074b76cce179562c3bd3afcb449
parentb0baf8b94ee57b0bc47eaddea8f589a024096ff8
drm/i915: Fix lock order reversal in GTT pwrite path.

Since the pagefault path determines that the lock order we use has to be
mmap_sem -> struct_mutex, we can't allow page faults to occur while the
struct_mutex is held.  To fix this in pwrite, we first try optimistically to
see if we can copy from user without faulting.  If it fails, fall back to
using get_user_pages to pin the user's memory, and map those pages
atomically when copying it to the GPU.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
drivers/gpu/drm/i915/i915_gem.c