diff options
author | Tomi Valkeinen <tomi.valkeinen@nokia.com> | 2011-01-20 17:44:20 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-20 20:02:05 -0500 |
commit | abb65272a190660790096628859e752172d822fd (patch) | |
tree | c600b517ec0446b0ae95430b6c65d864c7dd0efb /mm | |
parent | 453c719261c0b4030b2676124adb6e81c5fb6833 (diff) |
memblock: fix memblock_is_region_memory()
memblock_is_region_memory() uses reserved memblocks to search for the
given region, while it should use the memory memblocks.
I encountered the problem with OMAP's framebuffer ram allocation.
Normally the ram is allocated dynamically, and this function is not
called. However, if we want to pass the framebuffer from the bootloader
to the kernel (to retain the boot image), this function is used to check
the validity of the kernel parameters for the framebuffer ram area.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Acked-by: Yinghai Lu <yinghai@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/memblock.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mm/memblock.c b/mm/memblock.c index 400dc62697d7..bdba245d8afd 100644 --- a/mm/memblock.c +++ b/mm/memblock.c | |||
@@ -683,13 +683,13 @@ int __init_memblock memblock_is_memory(phys_addr_t addr) | |||
683 | 683 | ||
684 | int __init_memblock memblock_is_region_memory(phys_addr_t base, phys_addr_t size) | 684 | int __init_memblock memblock_is_region_memory(phys_addr_t base, phys_addr_t size) |
685 | { | 685 | { |
686 | int idx = memblock_search(&memblock.reserved, base); | 686 | int idx = memblock_search(&memblock.memory, base); |
687 | 687 | ||
688 | if (idx == -1) | 688 | if (idx == -1) |
689 | return 0; | 689 | return 0; |
690 | return memblock.reserved.regions[idx].base <= base && | 690 | return memblock.memory.regions[idx].base <= base && |
691 | (memblock.reserved.regions[idx].base + | 691 | (memblock.memory.regions[idx].base + |
692 | memblock.reserved.regions[idx].size) >= (base + size); | 692 | memblock.memory.regions[idx].size) >= (base + size); |
693 | } | 693 | } |
694 | 694 | ||
695 | int __init_memblock memblock_is_region_reserved(phys_addr_t base, phys_addr_t size) | 695 | int __init_memblock memblock_is_region_reserved(phys_addr_t base, phys_addr_t size) |