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 <zhanggb@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
xizx 2022-01-04 12:36:54 +08:00 • committed by Zhenxin Xi
commit bc00b7fe1a

View file

@ -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