summaryrefslogtreecommitdiff
path: root/drivers/gpu/host1x/syncpt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/host1x/syncpt.c')
-rw-r--r--drivers/gpu/host1x/syncpt.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/gpu/host1x/syncpt.c b/drivers/gpu/host1x/syncpt.c
index 2d2007760eac..f63d14a57a1d 100644
--- a/drivers/gpu/host1x/syncpt.c
+++ b/drivers/gpu/host1x/syncpt.c
@@ -248,7 +248,13 @@ int host1x_syncpt_wait(struct host1x_syncpt *sp, u32 thresh, long timeout,
if (value)
*value = host1x_syncpt_load(sp);
- if (wait_err == 0)
+ /*
+ * Don't rely on dma_fence_wait_timeout return value,
+ * since it returns zero both on timeout and if the
+ * wait completed with 0 jiffies left.
+ */
+ host1x_hw_syncpt_load(sp->host, sp);
+ if (wait_err == 0 && !host1x_syncpt_is_expired(sp, thresh))
return -EAGAIN;
else if (wait_err < 0)
return wait_err;