Skip to content

Commit

Permalink
drm/lima: fix lima_gem_wait() return value
Browse files Browse the repository at this point in the history
commit 21670bd upstream.

drm_gem_reservation_object_wait() returns 0 if it succeeds and -ETIME
if it timeouts, but lima driver assumed that 0 is error.

Cc: stable@vger.kernel.org
Fixes: a1d2a63 ("drm/lima: driver for ARM Mali4xx GPUs")
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190908024800.23229-1-anarsoul@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
anarsoul authored and gregkh committed Sep 19, 2019
1 parent 46d1c96 commit 8eb5a78
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/lima/lima_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ int lima_gem_wait(struct drm_file *file, u32 handle, u32 op, s64 timeout_ns)
timeout = drm_timeout_abs_to_jiffies(timeout_ns);

ret = drm_gem_reservation_object_wait(file, handle, write, timeout);
if (ret == 0)
if (ret == -ETIME)
ret = timeout ? -ETIMEDOUT : -EBUSY;

return ret;
Expand Down

0 comments on commit 8eb5a78

Please sign in to comment.