Commit 07fcad0d authored by Iskren Chernev's avatar Iskren Chernev Committed by Rob Clark

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: default avatarIskren Chernev <iskren.chernev@gmail.com>
Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
parent a694ffed
...@@ -96,6 +96,8 @@ static struct page **get_pages(struct drm_gem_object *obj) ...@@ -96,6 +96,8 @@ static struct page **get_pages(struct drm_gem_object *obj)
{ {
struct msm_gem_object *msm_obj = to_msm_bo(obj); struct msm_gem_object *msm_obj = to_msm_bo(obj);
WARN_ON(!msm_gem_is_locked(obj));
if (!msm_obj->pages) { if (!msm_obj->pages) {
struct drm_device *dev = obj->dev; struct drm_device *dev = obj->dev;
struct page **p; struct page **p;
...@@ -1114,8 +1116,9 @@ static struct drm_gem_object *_msm_gem_new(struct drm_device *dev, ...@@ -1114,8 +1116,9 @@ static struct drm_gem_object *_msm_gem_new(struct drm_device *dev,
to_msm_bo(obj)->vram_node = &vma->node; to_msm_bo(obj)->vram_node = &vma->node;
msm_gem_lock(obj);
pages = get_pages(obj); pages = get_pages(obj);
msm_gem_unlock(obj);
if (IS_ERR(pages)) { if (IS_ERR(pages)) {
ret = PTR_ERR(pages); ret = PTR_ERR(pages);
goto fail; goto fail;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment