diff options
author | Lucas Stach <l.stach@pengutronix.de> | 2017-11-17 16:35:32 +0100 |
---|---|---|
committer | Lucas Stach <l.stach@pengutronix.de> | 2018-01-02 17:17:07 +0100 |
commit | fa67ac84a33eeb5a3702970fe75083be79f460f9 (patch) | |
tree | ce470f4d6cbce2bc20d05a1dfa85ce5bb46b6e66 /drivers/gpu/drm/etnaviv | |
parent | 3057e3f74516bd61d0aa3a44e169714b76616cfd (diff) | |
download | talos-obmc-linux-fa67ac84a33eeb5a3702970fe75083be79f460f9.tar.gz talos-obmc-linux-fa67ac84a33eeb5a3702970fe75083be79f460f9.zip |
drm/etnaviv: don't flush workqueue in etnaviv_gpu_wait_obj_inactive
There is no need to synchronize with oustanding retire jobs if the object
has gone idle. Retire jobs only ever change the object state from active to
idle, not the other way around.
The IOVA put race is uncritical, as the GEM_WAIT ioctl itself is holding
a reference to the GEM object, so the retire worker will not pull the
object into the CPU domain, which is the thing we are trying to guard
against with etnaviv_gpu_wait_obj_inactive. The ordering of the various
counts and waits may change a bit, but the userspace visible behavior at
the bounds of the syscall are unchanged.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Diffstat (limited to 'drivers/gpu/drm/etnaviv')
-rw-r--r-- | drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c index 95187ebe1660..3738383474fb 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c @@ -1295,17 +1295,12 @@ int etnaviv_gpu_wait_obj_inactive(struct etnaviv_gpu *gpu, ret = wait_event_interruptible_timeout(gpu->fence_event, !is_active(etnaviv_obj), remaining); - if (ret > 0) { - struct etnaviv_drm_private *priv = gpu->drm->dev_private; - - /* Synchronise with the retire worker */ - flush_workqueue(priv->wq); + if (ret > 0) return 0; - } else if (ret == -ERESTARTSYS) { + else if (ret == -ERESTARTSYS) return -ERESTARTSYS; - } else { + else return -ETIMEDOUT; - } } int etnaviv_gpu_pm_get_sync(struct etnaviv_gpu *gpu) |