mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 05:39:54 -04:00
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: Yuanfang Zhang <zhangyuanfang@codeaurora.org>
This commit is contained in:
parent
b249ddf502
commit
29cdfe444a
1 changed files with 3 additions and 2 deletions
|
|
@ -476,7 +476,7 @@ static struct msm_dump_table *msm_dump_get_table(enum msm_dump_table_ids id)
|
|||
{
|
||||
struct msm_dump_table *table = memdump.table;
|
||||
int i;
|
||||
|
||||
unsigned long offset;
|
||||
if (!table) {
|
||||
pr_err("mem dump base table does not exist\n");
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
|
@ -491,8 +491,9 @@ static struct msm_dump_table *msm_dump_get_table(enum msm_dump_table_ids id)
|
|||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
|
||||
offset = table->entries[i].addr - memdump.table_phys;
|
||||
/* Get the apps table pointer */
|
||||
table = phys_to_virt(table->entries[i].addr);
|
||||
table = (void *)memdump.table + offset;
|
||||
|
||||
return table;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue