Commit b7ca3f33 authored by Lucas Stach's avatar Lucas Stach Committed by Greg Kroah-Hartman

drm/etnaviv: lock MMU while dumping core

[ Upstream commit 1396500d673bd027683a0609ff84dca7eb6ea2e7 ]

The devcoredump needs to operate on a stable state of the MMU while
it is writing the MMU state to the coredump. The missing lock
allowed both the userspace submit, as well as the GPU job finish
paths to mutate the MMU state while a coredump is under way.

Fixes: a8c21a54 (drm/etnaviv: add initial etnaviv DRM driver)
Reported-by: 's avatarDavid Jander <>
Signed-off-by: 's avatarLucas Stach <>
Tested-by: 's avatarDavid Jander <>
Reviewed-by: 's avatarPhilipp Zabel <>
Signed-off-by: 's avatarSasha Levin <>
parent ee61fb4d
......@@ -124,6 +124,8 @@ void etnaviv_core_dump(struct etnaviv_gpu *gpu)
etnaviv_dump_core = false;
mmu_size = etnaviv_iommu_dump_size(gpu->mmu);
/* We always dump registers, mmu, ring and end marker */
......@@ -166,6 +168,7 @@ void etnaviv_core_dump(struct etnaviv_gpu *gpu)
iter.start = __vmalloc(file_size, GFP_KERNEL | __GFP_NOWARN | __GFP_NORETRY,
if (!iter.start) {
dev_warn(gpu->dev, "failed to allocate devcoredump file\n");
......@@ -233,6 +236,8 @@ void etnaviv_core_dump(struct etnaviv_gpu *gpu)
etnaviv_core_dump_header(&iter, ETDUMP_BUF_END,;
dev_coredumpv(gpu->dev, iter.start, - iter.start, GFP_KERNEL);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment