aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2014-11-18 00:47:35 -0500
committerMichael Ellerman <mpe@ellerman.id.au>2014-11-19 05:41:51 -0500
commite39f223fc93580c86ccf6b3422033e349f57f0dd (patch)
tree0aa179423f4c553bbf1fa361d28fe4c9c75927e7 /arch/powerpc/kernel
parenta49ab6eeebe5624d51466969a7bac611231eede8 (diff)
powerpc: Remove more traces of bootmem
Although we are now selecting NO_BOOTMEM, we still have some traces of bootmem lying around. That is because even with NO_BOOTMEM there is still a shim that converts bootmem calls into memblock calls, but ultimately we want to remove all traces of bootmem. Most of the patch is conversions from alloc_bootmem() to memblock_virt_alloc(). In general a call such as: p = (struct foo *)alloc_bootmem(x); Becomes: p = memblock_virt_alloc(x, 0); We don't need the cast because memblock_virt_alloc() returns a void *. The alignment value of zero tells memblock to use the default alignment, which is SMP_CACHE_BYTES, the same value alloc_bootmem() uses. We remove a number of NULL checks on the result of memblock_virt_alloc(). That is because memblock_virt_alloc() will panic if it can't allocate, in exactly the same way as alloc_bootmem(), so the NULL checks are and always have been redundant. The memory returned by memblock_virt_alloc() is already zeroed, so we remove several memsets of the result of memblock_virt_alloc(). Finally we convert a few uses of __alloc_bootmem(x, y, MAX_DMA_ADDRESS) to just plain memblock_virt_alloc(). We don't use memblock_alloc_base() because MAX_DMA_ADDRESS is ~0ul on powerpc, so limiting the allocation to that is pointless, 16XB ought to be enough for anyone. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r--arch/powerpc/kernel/pci-common.c1
-rw-r--r--arch/powerpc/kernel/pci_32.c4
-rw-r--r--arch/powerpc/kernel/setup_64.c2
3 files changed, 2 insertions, 5 deletions
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index bc2dab52a991..37d512d35943 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -20,7 +20,6 @@
20#include <linux/pci.h> 20#include <linux/pci.h>
21#include <linux/string.h> 21#include <linux/string.h>
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/bootmem.h>
24#include <linux/delay.h> 23#include <linux/delay.h>
25#include <linux/export.h> 24#include <linux/export.h>
26#include <linux/of_address.h> 25#include <linux/of_address.h>
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index 432459c817fa..1f7930037cb7 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -199,9 +199,7 @@ pci_create_OF_bus_map(void)
199 struct property* of_prop; 199 struct property* of_prop;
200 struct device_node *dn; 200 struct device_node *dn;
201 201
202 of_prop = (struct property*) alloc_bootmem(sizeof(struct property) + 256); 202 of_prop = memblock_virt_alloc(sizeof(struct property) + 256, 0);
203 if (!of_prop)
204 return;
205 dn = of_find_node_by_path("/"); 203 dn = of_find_node_by_path("/");
206 if (dn) { 204 if (dn) {
207 memset(of_prop, -1, sizeof(struct property) + 256); 205 memset(of_prop, -1, sizeof(struct property) + 256);
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 6e5310ddf8c7..49f553bbb360 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -660,7 +660,7 @@ static void __init emergency_stack_init(void)
660} 660}
661 661
662/* 662/*
663 * Called into from start_kernel this initializes bootmem, which is used 663 * Called into from start_kernel this initializes memblock, which is used
664 * to manage page allocation until mem_init is called. 664 * to manage page allocation until mem_init is called.
665 */ 665 */
666void __init setup_arch(char **cmdline_p) 666void __init setup_arch(char **cmdline_p)