* Re: [MIPS] 64-bit Sibyte kernels need DMA32. [not found] <S20038938AbXKZMRu/20071126121750Z+44508@ftp.linux-mips.org> @ 2007-12-27 16:43 ` Atsushi Nemoto 2008-01-07 15:41 ` Atsushi Nemoto 0 siblings, 1 reply; 3+ messages in thread From: Atsushi Nemoto @ 2007-12-27 16:43 UTC (permalink / raw) To: linux-mips; +Cc: ralf On Mon, 26 Nov 2007 12:17:46 +0000, linux-mips@linux-mips.org wrote: > Author: Ralf Baechle <ralf@linux-mips.org> Sat Nov 3 02:05:43 2007 +0000 > Commit: 75c0de3513644f9868a14f74b0c4dfec1eb4ffd5 > Gitweb: http://www.linux-mips.org/g/linux/75c0de35 > Branch: master > > Sibyte SOCs only have 32-bit PCI. Due to the sparse use of the address > space only the first 1GB of memory is mapped at physical addresses > below 1GB. If a system has more than 1GB of memory 32-bit DMA will > not be able to reach all of it. > > For now this patch is good enough to keep Sibyte users happy but it seems > eventually something like swiotlb will be needed for Sibyte. This commit breaks platforms which have real prom_free_prom_memory(). You can reproduce the problem with this patch. diff --git a/arch/mips/qemu/q-mem.c b/arch/mips/qemu/q-mem.c index dae39b5..84cbee2 100644 --- a/arch/mips/qemu/q-mem.c +++ b/arch/mips/qemu/q-mem.c @@ -1,5 +1,9 @@ #include <linux/init.h> +#include <asm/bootinfo.h> +#include <asm/sections.h> +#include <asm/page.h> void __init prom_free_prom_memory(void) { + free_init_pages("prom memory", PAGE_SIZE, __pa_symbol(&_text)); } With this patch, qemu kernel crashes on boot as this: Bad page state in process 'swapper' page:81000020 flags:0x00000000 mapping:00000000 mapcount:1 count:0 Trying to fix it up, but a reboot is needed Backtrace: Call Trace: [<8001691c>] dump_stack+0x8/0x34 [<8005a758>] bad_page+0x6c/0xa4 [<8005af7c>] free_hot_cold_page+0x98/0x1d4 [<80019e44>] free_init_pages+0x94/0xf8 [<80164b3c>] free_initmem+0x10/0x40 [<80010428>] init_post+0x10/0xe8 [<801b988c>] kernel_init+0x2f8/0x328 [<80013220>] kernel_thread_helper+0x10/0x18 If I reverted the commit, this crash does not happen. How I can fix this? --- Atsushi Nemoto ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [MIPS] 64-bit Sibyte kernels need DMA32. 2007-12-27 16:43 ` [MIPS] 64-bit Sibyte kernels need DMA32 Atsushi Nemoto @ 2008-01-07 15:41 ` Atsushi Nemoto 2008-01-07 16:38 ` Ralf Baechle 0 siblings, 1 reply; 3+ messages in thread From: Atsushi Nemoto @ 2008-01-07 15:41 UTC (permalink / raw) To: linux-mips; +Cc: ralf On Fri, 28 Dec 2007 01:43:21 +0900 (JST), Atsushi Nemoto <anemo@mba.ocn.ne.jp> wrote: > This commit breaks platforms which have real prom_free_prom_memory(). > ... > If I reverted the commit, this crash does not happen. How I can fix this? I see malta disabled prom_free_prom_memory for now, but it seems some other boards are affected by this problem too. How about this fix? diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index 7f6ddcb..f8a535a 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c @@ -269,7 +269,7 @@ static void __init bootmem_init(void) static void __init bootmem_init(void) { - unsigned long init_begin, reserved_end; + unsigned long reserved_end; unsigned long mapstart = ~0UL; unsigned long bootmap_size; int i; @@ -344,7 +344,6 @@ static void __init bootmem_init(void) min_low_pfn, max_low_pfn); - init_begin = PFN_UP(__pa_symbol(&__init_begin)); for (i = 0; i < boot_mem_map.nr_map; i++) { unsigned long start, end; @@ -352,8 +351,8 @@ static void __init bootmem_init(void) end = PFN_DOWN(boot_mem_map.map[i].addr + boot_mem_map.map[i].size); - if (start <= init_begin) - start = init_begin; + if (start <= min_low_pfn) + start = min_low_pfn; if (start >= end) continue; ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [MIPS] 64-bit Sibyte kernels need DMA32. 2008-01-07 15:41 ` Atsushi Nemoto @ 2008-01-07 16:38 ` Ralf Baechle 0 siblings, 0 replies; 3+ messages in thread From: Ralf Baechle @ 2008-01-07 16:38 UTC (permalink / raw) To: Atsushi Nemoto; +Cc: linux-mips On Tue, Jan 08, 2008 at 12:41:13AM +0900, Atsushi Nemoto wrote: > How about this fix? Seems to do the trick on Malta, maybe people can test this patch applied on top of the master branch of the lmo kernel on various systems? Ralf ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-01-07 16:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <S20038938AbXKZMRu/20071126121750Z+44508@ftp.linux-mips.org>
2007-12-27 16:43 ` [MIPS] 64-bit Sibyte kernels need DMA32 Atsushi Nemoto
2008-01-07 15:41 ` Atsushi Nemoto
2008-01-07 16:38 ` Ralf Baechle
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.