Patch "drm/msm: Allocate memory for disp snapshot with kvzalloc()" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    drm/msm: Allocate memory for disp snapshot with kvzalloc()

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-msm-allocate-memory-for-disp-snapshot-with-kvzal.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 595231f7646be5b2abd834492d9a83af0a3899a2
Author: Douglas Anderson <dianders@xxxxxxxxxxxx>
Date:   Mon Oct 14 09:36:09 2024 -0700

    drm/msm: Allocate memory for disp snapshot with kvzalloc()
    
    [ Upstream commit e4a45582db1b792c57bdb52c45958264f7fcfbdc ]
    
    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/20240628214848.4075651-1-quic_abhinavk@xxxxxxxxxxx/
    
    Fixes: 98659487b845 ("drm/msm: add support to take dpu snapshot")
    Signed-off-by: Douglas Anderson <dianders@xxxxxxxxxxxx>
    Reviewed-by: Abhinav Kumar <quic_abhinavk@xxxxxxxxxxx>
    Patchwork: https://patchwork.freedesktop.org/patch/619658/
    Link: https://lore.kernel.org/r/20241014093605.2.I72441365ffe91f3dceb17db0a8ec976af8139590@changeid
    Signed-off-by: Abhinav Kumar <quic_abhinavk@xxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c b/drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c
index 06f2f5a5e267e..badafcd61998f 100644
--- a/drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c
+++ b/drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c
@@ -24,7 +24,7 @@ static void msm_disp_state_dump_regs(u32 **reg, u32 aligned_len, void __iomem *b
 	end_addr = base_addr + aligned_len;
 
 	if (!(*reg))
-		*reg = kzalloc(len_padded, GFP_KERNEL);
+		*reg = kvzalloc(len_padded, GFP_KERNEL);
 
 	if (*reg)
 		dump_addr = *reg;
@@ -155,7 +155,7 @@ void msm_disp_state_free(void *data)
 
 	list_for_each_entry_safe(block, tmp, &disp_state->blocks, node) {
 		list_del(&block->node);
-		kfree(block->state);
+		kvfree(block->state);
 		kfree(block);
 	}
 




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux