* [PATCH 1/2] powerpc: Allow debugging of LMBs with lmb=debug @ 2009-01-15 6:46 Michael Ellerman 2009-01-15 6:46 ` [PATCH 2/2] lmb: Rework lmb_dump_all() output Michael Ellerman 2009-01-15 6:47 ` [PATCH 1/2] powerpc: Allow debugging of LMBs with lmb=debug David Miller 0 siblings, 2 replies; 4+ messages in thread From: Michael Ellerman @ 2009-01-15 6:46 UTC (permalink / raw) To: linuxppc-dev; +Cc: David S. Miller The lmb debugging can be turned on at boottime with lmb=debug on the command line. However on powerpc that doesn't work, because we don't necessarily call lmb_dump_all(). So always call lmb_dump_all() after lmb_analyze(), no output is generated unless lmb=debug is found on the command line. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> --- arch/powerpc/kernel/prom.c | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index c09cffa..045277b 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c @@ -1070,11 +1070,6 @@ static void __init early_reserve_mem(void) DBG("reserving: %llx -> %llx\n", base, size); lmb_reserve(base, size); } - -#if 0 - DBG("memory reserved, lmbs :\n"); - lmb_dump_all(); -#endif } #ifdef CONFIG_PHYP_DUMP @@ -1216,6 +1211,7 @@ void __init early_init_devtree(void *params) lmb_enforce_memory_limit(limit); lmb_analyze(); + lmb_dump_all(); DBG("Phys. mem: %lx\n", lmb_phys_mem_size()); -- 1.5.5 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] lmb: Rework lmb_dump_all() output 2009-01-15 6:46 [PATCH 1/2] powerpc: Allow debugging of LMBs with lmb=debug Michael Ellerman @ 2009-01-15 6:46 ` Michael Ellerman 2009-01-15 6:47 ` David Miller 2009-01-15 6:47 ` [PATCH 1/2] powerpc: Allow debugging of LMBs with lmb=debug David Miller 1 sibling, 1 reply; 4+ messages in thread From: Michael Ellerman @ 2009-01-15 6:46 UTC (permalink / raw) To: linuxppc-dev; +Cc: David S. Miller The lmb_dump_all() output didn't include the RMO size, which is interesting on powerpc. The output was also a bit spacey and not well aligned, and didn't show you the end addresses. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> --- lib/lmb.c | 42 +++++++++++++++++++++--------------------- 1 files changed, 21 insertions(+), 21 deletions(-) DaveM, if you like we could make the RMO display conditional on it being non-zero, which would hide it on sparc presumably. Old output: lmb_dump_all: memory.cnt = 0x1 memory.size = 0x80000000 memory.region[0x0].base = 0x0 .size = 0x80000000 reserved.cnt = 0x3 reserved.size = 0x80000000 reserved.region[0x0].base = 0x0 .size = 0xea2000 reserved.region[0x1].base = 0x2aa6000 .size = 0xc000 reserved.region[0x2].base = 0x76a1000 .size = 0x95f000 New output: LMB configuration: rmo_size = 0x8000000 memory.size = 0x80000000 memory.cnt = 0x1 memory[0x0] 0x0000000000000000 - 0x000000007fffffff, 0x80000000 bytes reserved.cnt = 0x3 reserved[0x0] 0x0000000000000000 - 0x0000000000ea1fff, 0xea2000 bytes reserved[0x1] 0x0000000002aa6000 - 0x0000000002ab1fff, 0xc000 bytes reserved[0x2] 0x00000000076a1000 - 0x0000000007ffffff, 0x95f000 bytes diff --git a/lib/lmb.c b/lib/lmb.c index 97e5470..e4a6482 100644 --- a/lib/lmb.c +++ b/lib/lmb.c @@ -29,33 +29,33 @@ static int __init early_lmb(char *p) } early_param("lmb", early_lmb); -void lmb_dump_all(void) +static void lmb_dump(struct lmb_region *region, char *name) { - unsigned long i; + unsigned long long base, size; + int i; + + pr_info(" %s.cnt = 0x%lx\n", name, region->cnt); + + for (i = 0; i < region->cnt; i++) { + base = region->region[i].base; + size = region->region[i].size; + + pr_info(" %s[0x%x]\t0x%016llx - 0x%016llx, 0x%llx bytes\n", + name, i, base, base + size - 1, size); + } +} +void lmb_dump_all(void) +{ if (!lmb_debug) return; - pr_info("lmb_dump_all:\n"); - pr_info(" memory.cnt = 0x%lx\n", lmb.memory.cnt); - pr_info(" memory.size = 0x%llx\n", - (unsigned long long)lmb.memory.size); - for (i=0; i < lmb.memory.cnt ;i++) { - pr_info(" memory.region[0x%lx].base = 0x%llx\n", - i, (unsigned long long)lmb.memory.region[i].base); - pr_info(" .size = 0x%llx\n", - (unsigned long long)lmb.memory.region[i].size); - } + pr_info("LMB configuration:\n"); + pr_info(" rmo_size = 0x%llx\n", (unsigned long long)lmb.rmo_size); + pr_info(" memory.size = 0x%llx\n", (unsigned long long)lmb.memory.size); - pr_info(" reserved.cnt = 0x%lx\n", lmb.reserved.cnt); - pr_info(" reserved.size = 0x%llx\n", - (unsigned long long)lmb.memory.size); - for (i=0; i < lmb.reserved.cnt ;i++) { - pr_info(" reserved.region[0x%lx].base = 0x%llx\n", - i, (unsigned long long)lmb.reserved.region[i].base); - pr_info(" .size = 0x%llx\n", - (unsigned long long)lmb.reserved.region[i].size); - } + lmb_dump(&lmb.memory, "memory"); + lmb_dump(&lmb.reserved, "reserved"); } static unsigned long lmb_addrs_overlap(u64 base1, u64 size1, u64 base2, -- 1.5.5 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] lmb: Rework lmb_dump_all() output 2009-01-15 6:46 ` [PATCH 2/2] lmb: Rework lmb_dump_all() output Michael Ellerman @ 2009-01-15 6:47 ` David Miller 0 siblings, 0 replies; 4+ messages in thread From: David Miller @ 2009-01-15 6:47 UTC (permalink / raw) To: michael; +Cc: linuxppc-dev From: Michael Ellerman <michael@ellerman.id.au> Date: Thu, 15 Jan 2009 17:46:02 +1100 (EST) > The lmb_dump_all() output didn't include the RMO size, which is > interesting on powerpc. The output was also a bit spacey and not well > aligned, and didn't show you the end addresses. > > Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Acked-by: David S. Miller <davem@davemloft.net> > DaveM, if you like we could make the RMO display conditional on it being > non-zero, which would hide it on sparc presumably. Not necessary. ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] powerpc: Allow debugging of LMBs with lmb=debug 2009-01-15 6:46 [PATCH 1/2] powerpc: Allow debugging of LMBs with lmb=debug Michael Ellerman 2009-01-15 6:46 ` [PATCH 2/2] lmb: Rework lmb_dump_all() output Michael Ellerman @ 2009-01-15 6:47 ` David Miller 1 sibling, 0 replies; 4+ messages in thread From: David Miller @ 2009-01-15 6:47 UTC (permalink / raw) To: michael; +Cc: linuxppc-dev From: Michael Ellerman <michael@ellerman.id.au> Date: Thu, 15 Jan 2009 17:46:01 +1100 (EST) > The lmb debugging can be turned on at boottime with lmb=debug on the > command line. However on powerpc that doesn't work, because we don't > necessarily call lmb_dump_all(). > > So always call lmb_dump_all() after lmb_analyze(), no output is > generated unless lmb=debug is found on the command line. > > Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Acked-by: David S. Miller <davem@davemloft.net> ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-01-15 6:47 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-01-15 6:46 [PATCH 1/2] powerpc: Allow debugging of LMBs with lmb=debug Michael Ellerman 2009-01-15 6:46 ` [PATCH 2/2] lmb: Rework lmb_dump_all() output Michael Ellerman 2009-01-15 6:47 ` David Miller 2009-01-15 6:47 ` [PATCH 1/2] powerpc: Allow debugging of LMBs with lmb=debug David Miller
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).