Skip to content

Commit

Permalink
[ARM] Fix non-page aligned boot time mappings
Browse files Browse the repository at this point in the history
AT91SAM9260 stopped booting with the recent changes to MM
initialisation - it was asking for a non-aligned virtual address
which caused loops to be non-terminal.  Fix this by rounding
virtual addresses down, but remember to include the offset in
the length, and round the length up to the following page.

This means that asking for a mapping of 4K starting at 2K into
a page maps two pages as one would expect.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King authored and Russell King committed Jul 4, 2007
1 parent 1f750a7 commit 7b9c7b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/arm/mm/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -527,9 +527,9 @@ void __init create_mapping(struct map_desc *md)
return;
}

addr = md->virtual;
addr = md->virtual & PAGE_MASK;
phys = (unsigned long)__pfn_to_phys(md->pfn);
length = PAGE_ALIGN(md->length);
length = PAGE_ALIGN(md->length + (md->virtual & ~PAGE_MASK));

if (type->prot_l1 == 0 && ((addr | phys | length) & ~SECTION_MASK)) {
printk(KERN_WARNING "BUG: map for 0x%08lx at 0x%08lx can not "
Expand Down

0 comments on commit 7b9c7b4

Please sign in to comment.