]> git.baikalelectronics.ru Git - kernel.git/commit
drm/etnaviv: fix deadlock in GPU coredump
authorLucas Stach <l.stach@pengutronix.de>
Wed, 16 Oct 2019 13:37:06 +0000 (15:37 +0200)
committerLucas Stach <l.stach@pengutronix.de>
Tue, 29 Oct 2019 17:11:06 +0000 (18:11 +0100)
commit38086d309d49f2d4b81b81373ab9b97b46e51c82
tree7b1ed8511a171c764b141dc9700c39e2aef25165
parentf5c4776cd5b591eea4e9be9f421e34f61b98ebb2
drm/etnaviv: fix deadlock in GPU coredump

The GPU coredump function violates the locking order by holding the MMU
context lock while trying to acquire the etnaviv_gem_object lock. This
results in a possible ABBA deadlock with other codepaths which follow
the established locking order.
Fortunately this is easy to fix by dropping the MMU context lock
earlier, as the BO dumping doesn't need the MMU context to be stable.
The only thing the BO dumping cares about are the BO mappings, which
are stable across the lifetime of the job.

Fixes: 65880117619a (drm/etnaviv: rework MMU handling)
[ Not really the first bad commit, but the one where this fix applies
  cleanly. Stable kernels need a manual backport. ]
Reported-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Tested-by: Christian Gmeiner <christian.gmeiner@gmail.com>
drivers/gpu/drm/etnaviv/etnaviv_dump.c