Debian Linux-m68k 2.4.26 kernel on Atari - report and patch
I have spent this night by playing with the 2.4.26 kernel on my
Afterburner. There are several serious issues as listed below.
1) paging_init() contains bug that causes early kernel crash
2) Swap in ST-RAM is broken since ages and causes kernel crash
3) source code is incomplete and Atari options cannot be set so users
actually can't avoid the crash due to Swap in ST-RAM
ad 1) Didier MEQUIGNON found that paging_init (arch/m68k/mm/motorola.c)
computes incorrect zone(0) size when DMA address is below high_memory
(whatever it is). This incorrect zone size causes an immediate kernel
The fix I got from Didier is very simple and so I created the attached
patch for 2.4.26 (though it applies cleanly to any version I think).
Without this patch no Atari with FastRAM (or generally any m68k machine
with DMA below end of RAM?) can boot the kernel, I am afraid. I kindly
ask you to commit this oneliner to CVS ASAP. Thanks.
ad 2) not sure what to say about this. It's an old story. The ST-RAM
swap worked last time in 2.0.x, IIRC (or am I wrong?). I would think
that disabling this feature for debian kernels would only help users. Or
if the issue with non-working parameters (see below) was fixed then I
would vote for adding 'stram_swap=0' parameter to the BOOTARGS by
default. Releasing the current version that tries to use the ST-RAM as
swap (as found in Debian installers) is not a good idea.
ad 3) this is the most interesting. I was wondering why the kernel still
crashes when I am trying to disable the ST-RAM swap with "stram_swap=0"
kernel parameter and guess what - the debian 2.4.26 does not contain ANY
code for evaluating the Atari kernel parameters! In short, none of the
parameters can work. I couldn't believe it until I did 'grep -r
atamouse' over the whole kernel tree. It's not there. I don't know about
the vanilla version but it wouldn't surprise me if it wasn't there
either :-) Please add the code for evaluating the Atari kernel
parameters back (I hope it is somewhere in CVS). In 2.2.25 it was part
of init/main.c, not sure where it should be in 2.4.26.
If this code was in place and working, the stram_swap=0 would have
helped booting the kernel even though the ST-RAM swap is broken. Since
it's not there the only way is to disable the ST-RAM swap in compile
I hope this mail can help improving the kernel in time for Sarge
--- arch/m68k/mm/motorola.c.old 2003-08-30 08:01:28.000000000 +0200
+++ arch/m68k/mm/motorola.c 2004-05-07 09:01:10.000000000 +0200
@@ -264,7 +264,7 @@
printk ("before free_area_init\n");
zones_size = (mach_max_dma_address < (unsigned long)high_memory ?
- mach_max_dma_address : (unsigned long)high_memory);
+ (mach_max_dma_address+1) : (unsigned long)high_memory);
zones_size = (unsigned long)high_memory - zones_size;
zones_size = (zones_size - PAGE_OFFSET) >> PAGE_SHIFT;