[Letux-kernel] SMP issue between LX16 and LX20 found...

H. Nikolaus Schaller hns at goldelico.com
Sat Jun 14 19:47:00 CEST 2025


Hi Paul,

now, letux-6.16-rc1 is available and I could dig again into
some bug.

I think I have found the issue why the MIPS generic kernel with
SMP enabled is only running on the LX20 and the LX16 panics
during boot. It is the sysost driver and its x2000 patchesy.

It is this line:

https://git.goldelico.com/?p=letux-kernel.git;a=blob;f=drivers/clocksource/ingenic-sysost.c;h=39f339737ba694081cbbe88db86a65da3a30f246;hb=refs/heads/letux-current#l606

Apparently it is not allowed to call alloc_percpu() if there
is only one CPU because IRQ_PER_CPU_DEVID is not set. It
may also have something to do with enable_percpu_irq() and
request_percpu_irq() being called only for Xburst2.

The effect of calling alloc_percpu() is that this allocation
is released somewhere in the guts of Linux and the
timer struct passed as opaque type has been overwritten
when ingenic_ost_cevt_cb() is called. This panics.

The solution is to conditionally use kmalloc() instead
for non-X2000 CPUs. What I have not yet tested is if this
works on the CI20 - which has two CPUs...

On the other hand I would assume that alloc_percpu() should
work even in this case and not overwrite memory.

Especially since the code following the alloc calls
per_cpu_ptr(ost->timers, cpu). And we are lucky that
these macros work for plain kmalloc'ed memory area.

So it may be a workaround for a more fundamental issue.

BR,
Nikolaus



More information about the Letux-kernel mailing list