From bc00b7fe1a15ddeac76c078205c61dfbd7c20c9f Mon Sep 17 00:00:00 2001 From: xizx Date: Tue, 4 Jan 2022 12:36:54 +0800 Subject: [PATCH] mmi_annotate: add unpersist annotate memory region to minidump For the minidump region of mmi_annotate, should record volatile memory instead of persist memory when platform doesn't support persist memory. Change-Id: I94afe0b8ff5eda3686e2957f00747a4cb4582a89 Reviewed-on: https://gerrit.mot.com/2160648 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Guobin Zhang Submit-Approved: Jira Key --- drivers/mmi_annotate/mmi_annotate.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/mmi_annotate/mmi_annotate.c b/drivers/mmi_annotate/mmi_annotate.c index a4419ca927c4..f7a496facf25 100644 --- a/drivers/mmi_annotate/mmi_annotate.c +++ b/drivers/mmi_annotate/mmi_annotate.c @@ -262,9 +262,15 @@ static int mmi_annotate_probe(struct platform_device *pdev) #if IS_ENABLED(CONFIG_QCOM_MINIDUMP) /*Register annotate to minidump */ strlcpy(md_entry.name, "ANNOTATE", sizeof(md_entry.name)); - md_entry.virt_addr = (uintptr_t)phys_to_virt(pdata->mem_address); - md_entry.phys_addr = pdata->mem_address; - md_entry.size = pdata->mem_size; + if (!persist_unsupported) { + md_entry.virt_addr = (uintptr_t)phys_to_virt(pdata->mem_address); + md_entry.phys_addr = pdata->mem_address; + md_entry.size = pdata->mem_size; + } else { + md_entry.virt_addr = (uintptr_t)mem_data.contents; + md_entry.phys_addr = virt_to_phys((void*)mem_data.contents); + md_entry.size = mem_data.size; + } if (msm_minidump_add_region(&md_entry) < 0) pr_err("Failed to add annotate in Minidump\n"); #endif