diff options
author | Iskren Chernev <iskren.chernev@gmail.com> | 2020-12-29 00:31:31 +0300 |
---|---|---|
committer | Rob Clark <robdclark@chromium.org> | 2020-12-29 20:12:46 +0300 |
commit | 07fcad0d726d5da7c43f1c8e8fdb66c93a140ca5 (patch) | |
tree | eaa515b74333c90176027cb8dd936844ccc6a76f /drivers/gpu | |
parent | a694ffed876575d1df1a47067444047182de4354 (diff) | |
download | linux-07fcad0d726d5da7c43f1c8e8fdb66c93a140ca5.tar.xz |
drm/msm: Ensure get_pages is called when locked
get_pages is only called in a locked context. Add a WARN_ON to make sure
it stays that way.
Signed-off-by: Iskren Chernev <iskren.chernev@gmail.com>
Signed-off-by: Rob Clark <robdclark@chromium.org>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/msm/msm_gem.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c index d9a5a1895f3d..114c0711a302 100644 --- a/drivers/gpu/drm/msm/msm_gem.c +++ b/drivers/gpu/drm/msm/msm_gem.c @@ -96,6 +96,8 @@ static struct page **get_pages(struct drm_gem_object *obj) { struct msm_gem_object *msm_obj = to_msm_bo(obj); + WARN_ON(!msm_gem_is_locked(obj)); + if (!msm_obj->pages) { struct drm_device *dev = obj->dev; struct page **p; @@ -1114,8 +1116,9 @@ static struct drm_gem_object *_msm_gem_new(struct drm_device *dev, to_msm_bo(obj)->vram_node = &vma->node; - + msm_gem_lock(obj); pages = get_pages(obj); + msm_gem_unlock(obj); if (IS_ERR(pages)) { ret = PTR_ERR(pages); goto fail; |