From 6104617fa0a80d76f8ab4be2fd43401d087bbb82 Mon Sep 17 00:00:00 2001 From: Jayaprakash Madisetty Date: Mon, 2 May 2022 22:14:55 +0530 Subject: [PATCH] disp: msm: avoid minidump region addition for mdss register dumps This change enables minidump for register dumps, debug bus collection based on CONFIG_QCOM_VA_MINIDUMP config. The minidump driver in 5.4 kernel needs physical contiguous memory allocation as a requirement. The minidump collection failure is seen with commit fdf36d71241f ("disp: msm: use vzalloc for large allocations") and it uses vzalloc to address memory allocation failure with order 5. This patch will disable minidump collection for regdumps, debug bus to address minidump collection failure. Change-Id: If5ff91ff95279ee2997765599dbeab16ac2dae60 Signed-off-by: Jayaprakash Madisetty --- msm/sde_dbg.c | 6 ++++++ msm/sde_dbg_evtlog.c | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/msm/sde_dbg.c b/msm/sde_dbg.c index 4d6a5e22d813..ffa3ae346e18 100644 --- a/msm/sde_dbg.c +++ b/msm/sde_dbg.c @@ -999,8 +999,10 @@ static void _sde_dbg_dump_sde_dbg_bus(struct sde_dbg_sde_debug_bus *bus) bus->cmn.content_size = list_size / sizeof(u32); } +#ifdef CONFIG_QCOM_VA_MINIDUMP if (sde_mini_dump_add_region(bus->cmn.name, list_size, *dump_mem) < 0) pr_err("minidump add %s failed\n", bus->cmn.name); +#endif dump_addr = *dump_mem; SDE_DBG_LOG_DUMP_ADDR(bus->cmn.name, dump_addr, list_size, 0); @@ -1047,8 +1049,10 @@ static void _sde_dbg_dump_dsi_dbg_bus(struct sde_dbg_sde_debug_bus *bus) bus->cmn.content_size = list_size / sizeof(u32); } +#ifdef CONFIG_QCOM_VA_MINIDUMP if (sde_mini_dump_add_region(bus->cmn.name, list_size, *dump_mem) < 0) pr_err("minidump add %s failed\n", bus->cmn.name); +#endif dump_addr = *dump_mem; @@ -1098,10 +1102,12 @@ static void _sde_dump_array(struct sde_dbg_reg_base *blk_arr[], pr_err("Failed to allocate memory for reg_dump_addr size:%d\n", reg_dump_size); +#ifdef CONFIG_QCOM_VA_MINIDUMP if (dbg_base->reg_dump_addr && sde_mini_dump_add_region("reg_dump", reg_dump_size, dbg_base->reg_dump_addr) < 0) pr_err("minidump add regdump failed\n"); +#endif if (dump_all) sde_evtlog_dump_all(sde_dbg_base.evtlog); diff --git a/msm/sde_dbg_evtlog.c b/msm/sde_dbg_evtlog.c index 59c8440e413d..f62aaf4ad151 100644 --- a/msm/sde_dbg_evtlog.c +++ b/msm/sde_dbg_evtlog.c @@ -220,7 +220,7 @@ struct sde_dbg_evtlog *sde_evtlog_init(void) { struct sde_dbg_evtlog *evtlog; - evtlog = vzalloc(sizeof(*evtlog)); + evtlog = kzalloc(sizeof(*evtlog), GFP_KERNEL); if (!evtlog) return ERR_PTR(-ENOMEM); @@ -240,7 +240,7 @@ struct sde_dbg_reglog *sde_reglog_init(void) { struct sde_dbg_reglog *reglog; - reglog = vzalloc(sizeof(*reglog)); + reglog = kzalloc(sizeof(*reglog), GFP_KERNEL); if (!reglog) return ERR_PTR(-ENOMEM); @@ -351,7 +351,7 @@ void sde_evtlog_destroy(struct sde_dbg_evtlog *evtlog) list_del(&filter_node->list); kfree(filter_node); } - vfree(evtlog); + kfree(evtlog); } void sde_reglog_destroy(struct sde_dbg_reglog *reglog) @@ -359,5 +359,5 @@ void sde_reglog_destroy(struct sde_dbg_reglog *reglog) if (!reglog) return; - vfree(reglog); + kfree(reglog); }