Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d00a47bc authored by Yuanfang Zhang's avatar Yuanfang Zhang
Browse files

soc: mem_dump: fix physical address mapping issue



Using phys_to_virt can't get correct virtual address. Because the physical
address is continuous, the virtual address can be obtained by using the
offset of the physical address.

Change-Id: Ifdf57820273b2466dca0e486b42ed6895bff0f48
Signed-off-by: default avatarYuanfang Zhang <zhangyuanfang@codeaurora.org>
parent f8c9a32b
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -478,7 +478,7 @@ static struct msm_dump_table *msm_dump_get_table(enum msm_dump_table_ids id)
{
{
	struct msm_dump_table *table = memdump.table;
	struct msm_dump_table *table = memdump.table;
	int i;
	int i;

	unsigned long offset;
	if (!table) {
	if (!table) {
		pr_err("mem dump base table does not exist\n");
		pr_err("mem dump base table does not exist\n");
		return ERR_PTR(-EINVAL);
		return ERR_PTR(-EINVAL);
@@ -493,8 +493,9 @@ static struct msm_dump_table *msm_dump_get_table(enum msm_dump_table_ids id)
		return ERR_PTR(-EINVAL);
		return ERR_PTR(-EINVAL);
	}
	}


	offset = table->entries[i].addr - memdump.table_phys;
	/* Get the apps table pointer */
	/* Get the apps table pointer */
	table = phys_to_virt(table->entries[i].addr);
	table = (void *)memdump.table + offset;


	return table;
	return table;
}
}