]> git.baikalelectronics.ru Git - kernel.git/commit
drm/etnaviv: take GPU lock later in the submit process
authorLucas Stach <l.stach@pengutronix.de>
Thu, 28 Jul 2016 09:50:48 +0000 (11:50 +0200)
committerLucas Stach <l.stach@pengutronix.de>
Mon, 15 Aug 2016 12:00:40 +0000 (14:00 +0200)
commit576f3b3b78bd6b5d6f896483e6e051c99e33611e
treec62d62968d3319d6eac312e9c0cad4d0119d1756
parentb482605f7939bd4035b2d11a7952dc3da5821c6d
drm/etnaviv: take GPU lock later in the submit process

Both the fence and event alloc are safe to be done without holding the GPU
lock, as they either don't need any locking (fences) or are protected by
their own lock (events).

This solves a bad locking interaction between the submit path and the
recover worker. If userspace manages to exhaust all available events while
the GPU is hung, the submit will wait for events to become available
holding the GPU lock. The recover worker waits for this lock to become
available before trying to recover the GPU which frees up the allocated
events. Essentially both paths are deadlocked until the submit path
times out waiting for available events, failing the submit that could
otherwise be handled just fine if the recover worker had the chance to
bring the GPU back in a working state.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
drivers/gpu/drm/etnaviv/etnaviv_gpu.c