* [PATCH] memblock: fix memblock_is_region_memory()
@ 2010-11-08 11:00 Tomi Valkeinen
2010-11-24 23:31 ` Andrew Morton
0 siblings, 1 reply; 3+ messages in thread
From: Tomi Valkeinen @ 2010-11-08 11:00 UTC (permalink / raw)
To: benh, yinghai, linux-kernel; +Cc: Tomi Valkeinen
memblock_is_region_memory() uses reserved memblocks to search for the
given region, while it should use the memory memblocks.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
---
mm/memblock.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/mm/memblock.c b/mm/memblock.c
index 400dc62..bdba245 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -683,13 +683,13 @@ int __init_memblock memblock_is_memory(phys_addr_t addr)
int __init_memblock memblock_is_region_memory(phys_addr_t base, phys_addr_t size)
{
- int idx = memblock_search(&memblock.reserved, base);
+ int idx = memblock_search(&memblock.memory, base);
if (idx == -1)
return 0;
- return memblock.reserved.regions[idx].base <= base &&
- (memblock.reserved.regions[idx].base +
- memblock.reserved.regions[idx].size) >= (base + size);
+ return memblock.memory.regions[idx].base <= base &&
+ (memblock.memory.regions[idx].base +
+ memblock.memory.regions[idx].size) >= (base + size);
}
int __init_memblock memblock_is_region_reserved(phys_addr_t base, phys_addr_t size)
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] memblock: fix memblock_is_region_memory()
2010-11-08 11:00 [PATCH] memblock: fix memblock_is_region_memory() Tomi Valkeinen
@ 2010-11-24 23:31 ` Andrew Morton
2010-11-25 9:17 ` Tomi Valkeinen
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2010-11-24 23:31 UTC (permalink / raw)
To: Tomi Valkeinen; +Cc: benh, yinghai, linux-kernel
On Mon, 8 Nov 2010 13:00:13 +0200
Tomi Valkeinen <tomi.valkeinen@nokia.com> wrote:
> To: benh@kernel.crashing.org, yinghai@kernel.org
wakey wakey!
> memblock_is_region_memory() uses reserved memblocks to search for the
> given region, while it should use the memory memblocks.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
> ---
> mm/memblock.c | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/mm/memblock.c b/mm/memblock.c
> index 400dc62..bdba245 100644
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -683,13 +683,13 @@ int __init_memblock memblock_is_memory(phys_addr_t addr)
>
> int __init_memblock memblock_is_region_memory(phys_addr_t base, phys_addr_t size)
> {
> - int idx = memblock_search(&memblock.reserved, base);
> + int idx = memblock_search(&memblock.memory, base);
>
> if (idx == -1)
> return 0;
> - return memblock.reserved.regions[idx].base <= base &&
> - (memblock.reserved.regions[idx].base +
> - memblock.reserved.regions[idx].size) >= (base + size);
> + return memblock.memory.regions[idx].base <= base &&
> + (memblock.memory.regions[idx].base +
> + memblock.memory.regions[idx].size) >= (base + size);
> }
What were the runtime effects of this problem?
afacit the only callers are a couple of obscure fbdev drivers. Do you
know of other callers?
Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] memblock: fix memblock_is_region_memory()
2010-11-24 23:31 ` Andrew Morton
@ 2010-11-25 9:17 ` Tomi Valkeinen
0 siblings, 0 replies; 3+ messages in thread
From: Tomi Valkeinen @ 2010-11-25 9:17 UTC (permalink / raw)
To: ext Andrew Morton; +Cc: benh, yinghai, linux-kernel
On Wed, 2010-11-24 at 15:31 -0800, ext Andrew Morton wrote:
> On Mon, 8 Nov 2010 13:00:13 +0200
> Tomi Valkeinen <tomi.valkeinen@nokia.com> wrote:
>
> > To: benh@kernel.crashing.org, yinghai@kernel.org
>
> wakey wakey!
>
> > memblock_is_region_memory() uses reserved memblocks to search for the
> > given region, while it should use the memory memblocks.
> >
> > Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
> > ---
> > mm/memblock.c | 8 ++++----
> > 1 files changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/mm/memblock.c b/mm/memblock.c
> > index 400dc62..bdba245 100644
> > --- a/mm/memblock.c
> > +++ b/mm/memblock.c
> > @@ -683,13 +683,13 @@ int __init_memblock memblock_is_memory(phys_addr_t addr)
> >
> > int __init_memblock memblock_is_region_memory(phys_addr_t base, phys_addr_t size)
> > {
> > - int idx = memblock_search(&memblock.reserved, base);
> > + int idx = memblock_search(&memblock.memory, base);
> >
> > if (idx == -1)
> > return 0;
> > - return memblock.reserved.regions[idx].base <= base &&
> > - (memblock.reserved.regions[idx].base +
> > - memblock.reserved.regions[idx].size) >= (base + size);
> > + return memblock.memory.regions[idx].base <= base &&
> > + (memblock.memory.regions[idx].base +
> > + memblock.memory.regions[idx].size) >= (base + size);
> > }
>
> What were the runtime effects of this problem?
>
> afacit the only callers are a couple of obscure fbdev drivers. Do you
> know of other callers?
I don't know any other callers.
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.
Tomi
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-11-25 9:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-08 11:00 [PATCH] memblock: fix memblock_is_region_memory() Tomi Valkeinen
2010-11-24 23:31 ` Andrew Morton
2010-11-25 9:17 ` Tomi Valkeinen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox