Skip to content

Commit 20faf20

Browse files
committed
drm/etnaviv: fix dumping of active MMU context
gpu->mmu_context is the MMU context of the last job in the HW queue, which isn't necessarily the same as the context from the bad job. Dump the MMU context from the scheduler determined bad submit to make it work as intended. Fixes: 17e4660 ("drm/etnaviv: implement per-process address spaces on MMUv2") Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
1 parent 295b6c0 commit 20faf20

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/gpu/drm/etnaviv/etnaviv_dump.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ void etnaviv_core_dump(struct etnaviv_gem_submit *submit)
130130
return;
131131
etnaviv_dump_core = false;
132132

133-
mutex_lock(&gpu->mmu_context->lock);
133+
mutex_lock(&submit->mmu_context->lock);
134134

135-
mmu_size = etnaviv_iommu_dump_size(gpu->mmu_context);
135+
mmu_size = etnaviv_iommu_dump_size(submit->mmu_context);
136136

137137
/* We always dump registers, mmu, ring, hanging cmdbuf and end marker */
138138
n_obj = 5;
@@ -162,7 +162,7 @@ void etnaviv_core_dump(struct etnaviv_gem_submit *submit)
162162
iter.start = __vmalloc(file_size, GFP_KERNEL | __GFP_NOWARN |
163163
__GFP_NORETRY);
164164
if (!iter.start) {
165-
mutex_unlock(&gpu->mmu_context->lock);
165+
mutex_unlock(&submit->mmu_context->lock);
166166
dev_warn(gpu->dev, "failed to allocate devcoredump file\n");
167167
return;
168168
}
@@ -174,18 +174,18 @@ void etnaviv_core_dump(struct etnaviv_gem_submit *submit)
174174
memset(iter.hdr, 0, iter.data - iter.start);
175175

176176
etnaviv_core_dump_registers(&iter, gpu);
177-
etnaviv_core_dump_mmu(&iter, gpu->mmu_context, mmu_size);
177+
etnaviv_core_dump_mmu(&iter, submit->mmu_context, mmu_size);
178178
etnaviv_core_dump_mem(&iter, ETDUMP_BUF_RING, gpu->buffer.vaddr,
179179
gpu->buffer.size,
180180
etnaviv_cmdbuf_get_va(&gpu->buffer,
181-
&gpu->mmu_context->cmdbuf_mapping));
181+
&submit->mmu_context->cmdbuf_mapping));
182182

183183
etnaviv_core_dump_mem(&iter, ETDUMP_BUF_CMD,
184184
submit->cmdbuf.vaddr, submit->cmdbuf.size,
185185
etnaviv_cmdbuf_get_va(&submit->cmdbuf,
186-
&gpu->mmu_context->cmdbuf_mapping));
186+
&submit->mmu_context->cmdbuf_mapping));
187187

188-
mutex_unlock(&gpu->mmu_context->lock);
188+
mutex_unlock(&submit->mmu_context->lock);
189189

190190
/* Reserve space for the bomap */
191191
if (n_bomap_pages) {

0 commit comments

Comments
 (0)