powerpc/64s/radix: ioremap use ioremap_page_range
Radix can use ioremap_page_range for ioremap, after slab is available. This makes it possible to enable huge ioremap mapping support. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:

committed by
Michael Ellerman

parent
a72808a7ec
commit
d38153f9cc
@@ -447,3 +447,24 @@ int pmd_move_must_withdraw(struct spinlock *new_pmd_ptl,
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int ioremap_range(unsigned long ea, phys_addr_t pa, unsigned long size, pgprot_t prot, int nid)
|
||||
{
|
||||
unsigned long i;
|
||||
|
||||
if (radix_enabled())
|
||||
return radix__ioremap_range(ea, pa, size, prot, nid);
|
||||
|
||||
for (i = 0; i < size; i += PAGE_SIZE) {
|
||||
int err = map_kernel_page(ea + i, pa + i, prot);
|
||||
if (err) {
|
||||
if (slab_is_available())
|
||||
unmap_kernel_range(ea, size);
|
||||
else
|
||||
WARN_ON_ONCE(1); /* Should clean up */
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user