From ee6e565bcc44e9038af8dd11ae320b57dbc7dd6f Mon Sep 17 00:00:00 2001 From: Ingrid Gallardo Date: Wed, 21 Jan 2015 17:20:09 -0800 Subject: [PATCH] msm: mdss: debugfs: xlog: fix xlog corruption in ramdump Display driver debug feature xlog, allocates some memory to copy some of the MDP registers that are needed for debugging and then it panics. Current memory allocation api has a problem, where data from this memory allocation is shown corrupted in the ramdump. This change workaround this problem by changing the memory allocation to a dma alloc which works fine to keep the data correct in the ramdump. Change-Id: I391419095fb7ebfd3eb88faf26d2b473c255f28c Signed-off-by: Ingrid Gallardo --- drivers/video/fbdev/msm/mdss_debug_xlog.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/video/fbdev/msm/mdss_debug_xlog.c b/drivers/video/fbdev/msm/mdss_debug_xlog.c index 766edefb3766..e0b3f64a7435 100644 --- a/drivers/video/fbdev/msm/mdss_debug_xlog.c +++ b/drivers/video/fbdev/msm/mdss_debug_xlog.c @@ -16,6 +16,7 @@ #include #include #include +#include #include "mdss.h" #include "mdss_mdp.h" @@ -205,8 +206,10 @@ u32 get_dump_range(struct dump_offset *range_node, size_t max_offset) static void mdss_dump_reg(u32 reg_dump_flag, char *addr, int len, u32 *dump_mem) { + struct mdss_data_type *mdata = mdss_mdp_get_mdata(); bool in_log, in_mem; u32 *dump_addr = NULL; + phys_addr_t phys = 0; int i; in_log = (reg_dump_flag & MDSS_REG_DUMP_IN_LOG); @@ -221,7 +224,8 @@ static void mdss_dump_reg(u32 reg_dump_flag, if (in_mem) { if (!dump_mem) - dump_mem = kzalloc(len * 16, GFP_KERNEL); + dump_mem = dma_alloc_coherent(&mdata->pdev->dev, + len * 16, &phys, GFP_KERNEL); if (dump_mem) { dump_addr = dump_mem;