diff options
author | Michael Ellerman <mpe@ellerman.id.au> | 2015-03-29 23:10:37 -0400 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2015-04-10 06:02:48 -0400 |
commit | f691fa1080c37c48da0cdfeae082c3bef5df2643 (patch) | |
tree | fc961091a54c1be106c320108b231b340a979888 /arch/powerpc/kernel | |
parent | 4f9c53c8cc76ed84e3bb0cca8c4ffa2b170d0239 (diff) |
powerpc: Replace mem_init_done with slab_is_available()
We have a powerpc specific global called mem_init_done which is "set on
boot once kmalloc can be called".
But that's not *quite* true. We set it at the bottom of mem_init(), and
rely on the fact that mm_init() calls kmem_cache_init() immediately
after that, and nothing is running in parallel.
So replace it with the generic and 100% correct slab_is_available().
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r-- | arch/powerpc/kernel/pci-common.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/rtas.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index 2a525c938158..bcf618bfff1e 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c | |||
@@ -76,7 +76,7 @@ struct pci_controller *pcibios_alloc_controller(struct device_node *dev) | |||
76 | list_add_tail(&phb->list_node, &hose_list); | 76 | list_add_tail(&phb->list_node, &hose_list); |
77 | spin_unlock(&hose_spinlock); | 77 | spin_unlock(&hose_spinlock); |
78 | phb->dn = dev; | 78 | phb->dn = dev; |
79 | phb->is_dynamic = mem_init_done; | 79 | phb->is_dynamic = slab_is_available(); |
80 | #ifdef CONFIG_PPC64 | 80 | #ifdef CONFIG_PPC64 |
81 | if (dev) { | 81 | if (dev) { |
82 | int nid = of_node_to_nid(dev); | 82 | int nid = of_node_to_nid(dev); |
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c index b9a7b8981ef7..7a488c108410 100644 --- a/arch/powerpc/kernel/rtas.c +++ b/arch/powerpc/kernel/rtas.c | |||
@@ -401,7 +401,7 @@ static char *__fetch_rtas_last_error(char *altbuf) | |||
401 | buf = altbuf; | 401 | buf = altbuf; |
402 | } else { | 402 | } else { |
403 | buf = rtas_err_buf; | 403 | buf = rtas_err_buf; |
404 | if (mem_init_done) | 404 | if (slab_is_available()) |
405 | buf = kmalloc(RTAS_ERROR_LOG_MAX, GFP_ATOMIC); | 405 | buf = kmalloc(RTAS_ERROR_LOG_MAX, GFP_ATOMIC); |
406 | } | 406 | } |
407 | if (buf) | 407 | if (buf) |
@@ -461,7 +461,7 @@ int rtas_call(int token, int nargs, int nret, int *outputs, ...) | |||
461 | 461 | ||
462 | if (buff_copy) { | 462 | if (buff_copy) { |
463 | log_error(buff_copy, ERR_TYPE_RTAS_LOG, 0); | 463 | log_error(buff_copy, ERR_TYPE_RTAS_LOG, 0); |
464 | if (mem_init_done) | 464 | if (slab_is_available()) |
465 | kfree(buff_copy); | 465 | kfree(buff_copy); |
466 | } | 466 | } |
467 | return ret; | 467 | return ret; |