Skip to content

Commit

Permalink
Merge branch 'etnaviv/fixes' of https://git.pengutronix.de/git/lst/linux
Browse files Browse the repository at this point in the history
 into drm-fixes

etnaviv core dump locking fix

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Lucas Stach <l.stach@pengutronix.de>
Link: https://patchwork.freedesktop.org/patch/msgid/1558966666.4039.4.camel@pengutronix.de
  • Loading branch information
Dave Airlie committed May 30, 2019
2 parents cd6c84d + 1396500 commit b077dc2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/gpu/drm/etnaviv/etnaviv_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ void etnaviv_core_dump(struct etnaviv_gpu *gpu)
return;
etnaviv_dump_core = false;

mutex_lock(&gpu->mmu->lock);

mmu_size = etnaviv_iommu_dump_size(gpu->mmu);

/* We always dump registers, mmu, ring and end marker */
Expand Down Expand Up @@ -167,6 +169,7 @@ void etnaviv_core_dump(struct etnaviv_gpu *gpu)
iter.start = __vmalloc(file_size, GFP_KERNEL | __GFP_NOWARN | __GFP_NORETRY,
PAGE_KERNEL);
if (!iter.start) {
mutex_unlock(&gpu->mmu->lock);
dev_warn(gpu->dev, "failed to allocate devcoredump file\n");
return;
}
Expand Down Expand Up @@ -234,6 +237,8 @@ void etnaviv_core_dump(struct etnaviv_gpu *gpu)
obj->base.size);
}

mutex_unlock(&gpu->mmu->lock);

etnaviv_core_dump_header(&iter, ETDUMP_BUF_END, iter.data);

dev_coredumpv(gpu->dev, iter.start, iter.data - iter.start, GFP_KERNEL);
Expand Down

0 comments on commit b077dc2

Please sign in to comment.