linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] memblock: add memblock_start_of_DRAM()
@ 2011-08-06 18:59 Sam Ravnborg
  2011-08-08  9:34 ` Tejun Heo
  2011-08-23 21:03 ` Andrew Morton
  0 siblings, 2 replies; 4+ messages in thread
From: Sam Ravnborg @ 2011-08-06 18:59 UTC (permalink / raw)
  To: Tejun Heo; +Cc: lkml, David S. Miller, Yinghai Lu

SPARC32 require access to the start address.
Add a new helper memblock_start_of_DRAM() to give
access to the address of the first memblock - which
contains the lowest address.

The ackward name was chosen to match the already present
memblock_end_of_DRAM().

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Yinghai Lu <yinghai@kernel.org>
---
Hi Tejun.

I have started to replace bootmem with memblock for sparc32.
This is so far the only general functionality missing.

But conversion is not finished yet - more may come.

This is on top of the memblock branch of your misc tree

	Sam

diff --git a/include/linux/memblock.h b/include/linux/memblock.h
index 7c59804..a6bb102 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -157,6 +157,7 @@ phys_addr_t memblock_alloc_base(phys_addr_t size, phys_addr_t align,
 phys_addr_t __memblock_alloc_base(phys_addr_t size, phys_addr_t align,
 				  phys_addr_t max_addr);
 phys_addr_t memblock_phys_mem_size(void);
+phys_addr_t memblock_start_of_DRAM(void);
 phys_addr_t memblock_end_of_DRAM(void);
 void memblock_enforce_memory_limit(phys_addr_t memory_limit);
 int memblock_is_memory(phys_addr_t addr);
diff --git a/mm/memblock.c b/mm/memblock.c
index 07cb3ae..2f55f19 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -782,6 +782,12 @@ phys_addr_t __init memblock_phys_mem_size(void)
 	return memblock.memory.total_size;
 }
 
+/* lowest address */
+phys_addr_t __init_memblock memblock_start_of_DRAM(void)
+{
+	return memblock.memory.regions[0].base;
+}
+
 phys_addr_t __init_memblock memblock_end_of_DRAM(void)
 {
 	int idx = memblock.memory.cnt - 1;

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] memblock: add memblock_start_of_DRAM()
  2011-08-06 18:59 [PATCH] memblock: add memblock_start_of_DRAM() Sam Ravnborg
@ 2011-08-08  9:34 ` Tejun Heo
  2011-08-23 21:03 ` Andrew Morton
  1 sibling, 0 replies; 4+ messages in thread
From: Tejun Heo @ 2011-08-08  9:34 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: lkml, David S. Miller, Yinghai Lu, H. Peter Anvin

(cc'ing hpa and quoting whole body)

On Sat, Aug 06, 2011 at 08:59:23PM +0200, Sam Ravnborg wrote:
> SPARC32 require access to the start address.
> Add a new helper memblock_start_of_DRAM() to give
> access to the address of the first memblock - which
> contains the lowest address.
> 
> The ackward name was chosen to match the already present
> memblock_end_of_DRAM().
> 
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Yinghai Lu <yinghai@kernel.org>
> ---
> Hi Tejun.
> 
> I have started to replace bootmem with memblock for sparc32.
> This is so far the only general functionality missing.
> 
> But conversion is not finished yet - more may come.
> 
> This is on top of the memblock branch of your misc tree

Yes, this looks good to me.

 Acked-by: Tejun Heo <tj@kernel.org>

hpa, how do you want to proceed with the patchset?

Thanks.

> diff --git a/include/linux/memblock.h b/include/linux/memblock.h
> index 7c59804..a6bb102 100644
> --- a/include/linux/memblock.h
> +++ b/include/linux/memblock.h
> @@ -157,6 +157,7 @@ phys_addr_t memblock_alloc_base(phys_addr_t size, phys_addr_t align,
>  phys_addr_t __memblock_alloc_base(phys_addr_t size, phys_addr_t align,
>  				  phys_addr_t max_addr);
>  phys_addr_t memblock_phys_mem_size(void);
> +phys_addr_t memblock_start_of_DRAM(void);
>  phys_addr_t memblock_end_of_DRAM(void);
>  void memblock_enforce_memory_limit(phys_addr_t memory_limit);
>  int memblock_is_memory(phys_addr_t addr);
> diff --git a/mm/memblock.c b/mm/memblock.c
> index 07cb3ae..2f55f19 100644
> --- a/mm/memblock.c
> +++ b/mm/memblock.c
> @@ -782,6 +782,12 @@ phys_addr_t __init memblock_phys_mem_size(void)
>  	return memblock.memory.total_size;
>  }
>  
> +/* lowest address */
> +phys_addr_t __init_memblock memblock_start_of_DRAM(void)
> +{
> +	return memblock.memory.regions[0].base;
> +}
> +
>  phys_addr_t __init_memblock memblock_end_of_DRAM(void)
>  {
>  	int idx = memblock.memory.cnt - 1;

-- 
tejun

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] memblock: add memblock_start_of_DRAM()
  2011-08-06 18:59 [PATCH] memblock: add memblock_start_of_DRAM() Sam Ravnborg
  2011-08-08  9:34 ` Tejun Heo
@ 2011-08-23 21:03 ` Andrew Morton
  2011-08-24  4:44   ` Sam Ravnborg
  1 sibling, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2011-08-23 21:03 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Tejun Heo, lkml, David S. Miller, Yinghai Lu

On Sat, 6 Aug 2011 20:59:23 +0200
Sam Ravnborg <sam@ravnborg.org> wrote:

> SPARC32 require access to the start address.
> Add a new helper memblock_start_of_DRAM() to give
> access to the address of the first memblock - which
> contains the lowest address.
> 

What is the status of the sparc32 patches which need this change?

If they're in some other tree then I'd suggest that this patch (which
needed some small changes for current mainline) join them in that tree.

Or we could slip this change into mainline immediately if that makes
life easier.

Or we could just wait for 3.1.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] memblock: add memblock_start_of_DRAM()
  2011-08-23 21:03 ` Andrew Morton
@ 2011-08-24  4:44   ` Sam Ravnborg
  0 siblings, 0 replies; 4+ messages in thread
From: Sam Ravnborg @ 2011-08-24  4:44 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Tejun Heo, lkml, David S. Miller, Yinghai Lu

On Tue, Aug 23, 2011 at 02:03:09PM -0700, Andrew Morton wrote:
> On Sat, 6 Aug 2011 20:59:23 +0200
> Sam Ravnborg <sam@ravnborg.org> wrote:
> 
> > SPARC32 require access to the start address.
> > Add a new helper memblock_start_of_DRAM() to give
> > access to the address of the first memblock - which
> > contains the lowest address.
> > 
> 
> What is the status of the sparc32 patches which need this change?
Not at all ready yet :-(

> If they're in some other tree then I'd suggest that this patch (which
> needed some small changes for current mainline) join them in that tree.
> 
> Or we could slip this change into mainline immediately if that makes
> life easier.
> 
> Or we could just wait for 3.1.
I expect this to either go in via Tejuns memblock patches
or via the sparc32 patches.
I made the patch public this early only in case other needed the same.

	Sam

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-08-24  4:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-06 18:59 [PATCH] memblock: add memblock_start_of_DRAM() Sam Ravnborg
2011-08-08  9:34 ` Tejun Heo
2011-08-23 21:03 ` Andrew Morton
2011-08-24  4:44   ` Sam Ravnborg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).