From: Jeremy Kerr <jk@ozlabs.org>
To: <linuxppc-dev@ozlabs.org>
Cc: cbe-oss-dev@ozlabs.org
Subject: [PATCH] powerpc/mpic: fix WARN_ON from alloc_bootmem
Date: Mon, 29 Jun 2009 14:36:59 +0800 [thread overview]
Message-ID: <1246257419.938592.49700983608.1.gpush@pingu> (raw)
Current powerpc/merge on a QS21 reports an oops on boot:
------------[ cut here ]------------
Badness at mm/bootmem.c:535
[snip]
Call Trace:
[c000000000763a80] [c0000000005dd068] .alloc_arch_preferred_bootmem+0x28/0x9c (unreliable)
[c000000000763b10] [c0000000005ddaac] .___alloc_bootmem_nopanic+0x5c/0x130
[c000000000763bc0] [c0000000005ddbd8] .___alloc_bootmem+0x28/0x68
[c000000000763c50] [c0000000005dddf0] .__alloc_bootmem+0x1c/0x30
[c000000000763cd0] [c0000000005d1080] .mpic_alloc+0x20c/0x9f8
[c000000000763dc0] [c0000000005d3348] .cell_init_irq+0x70/0x114
[c000000000763e60] [c0000000005c41f8] .init_IRQ+0x44/0x64
[c000000000763ee0] [c0000000005c0914] .start_kernel+0x238/0x440
[c000000000763f90] [c000000000007368] .start_here_common+0x1c/0x34
Looks like we're using alloc_bootmem after the slab is up and running,
in mpic_init.
This change uses a kzalloc instead - in fact, we've already done a
kzalloc() earlier in this function.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
---
arch/powerpc/sysdev/mpic.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index d46de1f..a5980e6 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -1109,9 +1109,8 @@ struct mpic * __init mpic_alloc(struct device_node *node,
psize /= 4;
bits = intvec_top + 1;
mapsize = BITS_TO_LONGS(bits) * sizeof(unsigned long);
- mpic->protected = alloc_bootmem(mapsize);
+ mpic->protected = kzalloc(mapsize, GFP_KERNEL);
BUG_ON(mpic->protected == NULL);
- memset(mpic->protected, 0, mapsize);
for (i = 0; i < psize; i++) {
if (psrc[i] > intvec_top)
continue;
next reply other threads:[~2009-06-29 6:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-29 6:36 Jeremy Kerr [this message]
2009-06-29 14:51 ` [PATCH] powerpc/mpic: fix WARN_ON from alloc_bootmem Kumar Gala
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1246257419.938592.49700983608.1.gpush@pingu \
--to=jk@ozlabs.org \
--cc=cbe-oss-dev@ozlabs.org \
--cc=linuxppc-dev@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).