Skip to content

Commit 3e749f5

Browse files
brucechangjlahtine-intel
authored andcommitted
drm/i915: Avoid atomic context for error capture
io_mapping_map_atomic/kmap_atomic are occasionally taken in error capture (if there is no aperture preallocated for the use of error capture), but the error capture and compression routines are now run in normal context: <3> [113.316247] BUG: sleeping function called from invalid context at mm/page_alloc.c:4653 <3> [113.318190] in_atomic(): 1, irqs_disabled(): 0, pid: 678, name: debugfs_test <4> [113.319900] no locks held by debugfs_test/678. <3> [113.321002] Preemption disabled at: <4> [113.321130] [<ffffffffa02506d4>] i915_error_object_create+0x494/0x610 [i915] <4> [113.327259] Call Trace: <4> [113.327871] dump_stack+0x67/0x9b <4> [113.328683] ___might_sleep+0x167/0x250 <4> [113.329618] __alloc_pages_nodemask+0x26b/0x1110 <4> [113.334614] pool_alloc.constprop.19+0x14/0x60 [i915] <4> [113.335951] compress_page+0x7c/0x100 [i915] <4> [113.337110] i915_error_object_create+0x4bd/0x610 [i915] <4> [113.338515] i915_capture_gpu_state+0x384/0x1680 [i915] However, it is not a good idea to run the slow compression inside atomic context, so we choose not to. Fixes: 895d8eb ("drm/i915: error capture with no ggtt slot") Signed-off-by: Bruce Chang <[email protected]> Reviewed-by: Brian Welty <[email protected]> Reviewed-by: Chris Wilson <[email protected]> Signed-off-by: Chris Wilson <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit 48715f7) Signed-off-by: Joonas Lahtinen <[email protected]>
1 parent 78e2ea2 commit 3e749f5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/gpu/drm/i915/i915_gpu_error.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,9 +1029,9 @@ i915_error_object_create(struct drm_i915_private *i915,
10291029
for_each_sgt_daddr(dma, iter, vma->pages) {
10301030
void __iomem *s;
10311031

1032-
s = io_mapping_map_atomic_wc(&mem->iomap, dma);
1032+
s = io_mapping_map_wc(&mem->iomap, dma, PAGE_SIZE);
10331033
ret = compress_page(compress, (void __force *)s, dst);
1034-
io_mapping_unmap_atomic(s);
1034+
io_mapping_unmap(s);
10351035
if (ret)
10361036
break;
10371037
}
@@ -1043,9 +1043,9 @@ i915_error_object_create(struct drm_i915_private *i915,
10431043

10441044
drm_clflush_pages(&page, 1);
10451045

1046-
s = kmap_atomic(page);
1046+
s = kmap(page);
10471047
ret = compress_page(compress, s, dst);
1048-
kunmap_atomic(s);
1048+
kunmap(s);
10491049

10501050
drm_clflush_pages(&page, 1);
10511051

0 commit comments

Comments
 (0)