drm/msm/submit: Move copy_from_user ahead of locking bos
authorRob Clark <robdclark@chromium.org>
Fri, 23 Oct 2020 16:51:08 +0000 (09:51 -0700)
committerRob Clark <robdclark@chromium.org>
Thu, 5 Nov 2020 00:00:56 +0000 (16:00 -0800)
commit20224d715a882210428ea62bba93f1bc4a0afe23
treecab4d2b0e55f4b85672eb1d61f3d3b76b76ae162
parent599089c6af68300207ee1823230d31eda1f15959
drm/msm/submit: Move copy_from_user ahead of locking bos

We cannot switch to using obj->resv for locking without first moving all
the copy_from_user() ahead of submit_lock_objects().  Otherwise in the
mm fault path we aquire mm->mmap_sem before obj lock, but in the submit
path the order is reversed.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Signed-off-by: Rob Clark <robdclark@chromium.org>
drivers/gpu/drm/msm/msm_gem.h
drivers/gpu/drm/msm/msm_gem_submit.c