Skip to content

Commit e4a4558

Browse files
diandersAbhinav Kumar
authored andcommitted
drm/msm: Allocate memory for disp snapshot with kvzalloc()
With the "drm/msm: add a display mmu fault handler" series [1] we saw issues in the field where memory allocation was failing when allocating space for registers in msm_disp_state_dump_regs(). Specifically we were seeing an order 5 allocation fail. It's not surprising that order 5 allocations will sometimes fail after the system has been up and running for a while. There's no need here for contiguous memory. Change the allocation to kvzalloc() which should make it much less likely to fail. [1] https://lore.kernel.org/r/[email protected]/ Fixes: 9865948 ("drm/msm: add support to take dpu snapshot") Signed-off-by: Douglas Anderson <[email protected]> Reviewed-by: Abhinav Kumar <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/619658/ Link: https://lore.kernel.org/r/20241014093605.2.I72441365ffe91f3dceb17db0a8ec976af8139590@changeid Signed-off-by: Abhinav Kumar <[email protected]>
1 parent 293f532 commit e4a4558

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ static void msm_disp_state_dump_regs(u32 **reg, u32 aligned_len, void __iomem *b
2626
end_addr = base_addr + aligned_len;
2727

2828
if (!(*reg))
29-
*reg = kzalloc(len_padded, GFP_KERNEL);
29+
*reg = kvzalloc(len_padded, GFP_KERNEL);
3030

3131
if (*reg)
3232
dump_addr = *reg;
@@ -162,7 +162,7 @@ void msm_disp_state_free(void *data)
162162

163163
list_for_each_entry_safe(block, tmp, &disp_state->blocks, node) {
164164
list_del(&block->node);
165-
kfree(block->state);
165+
kvfree(block->state);
166166
kfree(block);
167167
}
168168

0 commit comments

Comments
 (0)