Rpi0: Kernel 4.9 [RT] freezes under heavy load with usb hub

This forum is for topics dealing with problems with software specifically in the ARMv6h repo.

Rpi0: Kernel 4.9 [RT] freezes under heavy load with usb hub

Postby pinoverclock » Fri Mar 03, 2017 10:23 am

Hi everyone, i'm using a rpi0/archlinuxarm for drone control that's why i need a real time kernel.
I've been manually making the linux-raspberrypi package (https://github.com/archlinuxarm/PKGBUILDs/tree/master/core/linux-raspberrypi) so i could patch it with the corresponding RT patches. (https://www.kernel.org/pub/linux/kernel/projects/rt/).

This have been working perfectly for me until the 4.9 kernel brach that freezes instantly under heavy cpu load only if a usb hub is connected, no matter the number of usb devices conected to it or if it is a powered hub or not, the rpi0 just freezes without printing a line so i'm unable to provide any logs.
I can confirm it's happening the latest kernel 4.9.13-2 too

I'm stuck in the last 4.4 brach kernel (4.4.49-1) until that problem is fixed
Last edited by pinoverclock on Tue Mar 07, 2017 10:32 am, edited 1 time in total.
pinoverclock
 
Posts: 15
Joined: Mon Dec 31, 2012 2:05 pm

Re: Rpi0: Kernel 4.9.x freezes under heavy load with usb hub

Postby WarheadsSE » Fri Mar 03, 2017 2:05 pm

Have you reported this to their kernel tree? github.com/raspberrypi/linux/issues/
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6730
Joined: Mon Oct 18, 2010 2:12 pm

Re: Rpi0: Kernel 4.9.x freezes under heavy load with usb hub

Postby pinoverclock » Fri Mar 03, 2017 2:24 pm

Thank you for the tip, just did:
https://github.com/raspberrypi/linux/issues/1870

Greetins
pinoverclock
 
Posts: 15
Joined: Mon Dec 31, 2012 2:05 pm

Re: Rpi0: Kernel 4.9.x freezes under heavy load with usb hub

Postby pinoverclock » Tue Mar 07, 2017 10:28 am

Looks like i have found something:

Fix lockup in dwc_otg driver that leads to a system freeze of the
4-core Raspberry Pi board when RT Preempt kernel is in use or when
interrupts are threaded in general.
The lockup occurs when the irq handler thread gets preempted while it
holds the fiq spin lock.
The patch makes sure to disable local irq while fiq spin lock is held
irrespective of whether the interrupt is threaded or not.
The patch also unifies the use of the fiq spin lock outside the fiq
handler by introducing two function-like macros fiq_fsm_spin_lock_irqsave
and fiq_fsm_spin_unlock_irqrestore.

Under RT kernel, the bug can be reproduced in a few minutes by running
hackbench and cyclictest in this way
$ ( while true; do nice hackbench 30 >/dev/null; done )&
$ echo "run 'kill $!' to stop hackbench"
$ cyclictest -a -t -n -p 80


https://www.osadl.org/monitoring/patches/rbs3s/usb-dwc_otg-fix-system-lockup-when-interrupts-are-threaded.patch.html

I will apply it and report back soon
pinoverclock
 
Posts: 15
Joined: Mon Dec 31, 2012 2:05 pm


Return to ARMv6h

Who is online

Users browsing this forum: No registered users and 4 guests