Skip to content

Commit

Permalink
sh: Reject small mappings for PMB bolting.
Browse files Browse the repository at this point in the history
The minimum section size for the PMB is 16M, so just always error
out early if the specified size is too small. This permits us to
unconditionally call in to pmb_bolt_mapping() with variable sizes
without wasting a TLB and cache flush for the range.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Paul Mundt committed May 11, 2010
1 parent 4bc277a commit dfbca89
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/sh/mm/pmb.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,8 @@ int pmb_bolt_mapping(unsigned long vaddr, phys_addr_t phys,
unsigned long flags, pmb_flags;
int i, mapped;

if (size < SZ_16M)
return -EINVAL;
if (!pmb_addr_valid(vaddr, size))
return -EFAULT;
if (pmb_mapping_exists(vaddr, phys, size))
Expand Down

0 comments on commit dfbca89

Please sign in to comment.