Skip to content

Commit

Permalink
kdb: use kmap_local_page()
Browse files Browse the repository at this point in the history
Use kmap_local_page() instead of kmap_atomic() which has been deprecated.

Signed-off-by: Zhang Heng <zhangheng@kylinos.cn>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20241223085420.1815930-1-zhangheng@kylinos.cn
Signed-off-by: Daniel Thompson (RISCstar) <danielt@kernel.org>
  • Loading branch information
Zhang Heng authored and Daniel Thompson (RISCstar) committed Jan 25, 2025
1 parent 9d89551 commit 36975ec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kernel/debug/kdb/kdb_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ int kdb_putarea_size(unsigned long addr, void *res, size_t size)

/*
* kdb_getphys - Read data from a physical address. Validate the
* address is in range, use kmap_atomic() to get data
* address is in range, use kmap_local_page() to get data
* similar to kdb_getarea() - but for phys addresses
* Inputs:
* res Pointer to the word to receive the result
Expand All @@ -324,9 +324,9 @@ static int kdb_getphys(void *res, unsigned long addr, size_t size)
if (!pfn_valid(pfn))
return 1;
page = pfn_to_page(pfn);
vaddr = kmap_atomic(page);
vaddr = kmap_local_page(page);
memcpy(res, vaddr + (addr & (PAGE_SIZE - 1)), size);
kunmap_atomic(vaddr);
kunmap_local(vaddr);

return 0;
}
Expand Down

0 comments on commit 36975ec

Please sign in to comment.