I am customising the linux kernel.
In normal Linux, the BH thread priority is set to a constant priority (MAX_USER_RT_PRIO / 2) [1], but I am changing the BH thread priority from a constant priority (MAX_USER_RT_PRIO / 2) to another value in the interrupt handler [2]. Specifically, this priority is changed in __irq_wake_thread().
#code1
action->thread->prio = prio_input
or
#code2
sched_setscheduler_nocheck(action->thread, SCHED_FIFO, & param_input);
But with such a customised kernel, the hardware crashes and reboots two seconds later.
I debugged it and identified #code1, #code2 as the cause, but I don't understand what's wrong.
what was the error when it crashed?
It simply downed without any pop-ups like error messages. dmesg has no clues.
output of command "last"
reboot system boot 4.9.201-rt134 Sun Jul 10 11:24 still running
him :1 :1 Sun Jul 10 11:21 - crash (00:02)
reboot system boot 4.9.201-rt134 Fri Dec 31 20:00 still running
Are priority changes ever not allowed in Interrupt?
Environment
Hardware: Jetson nano
Power mode: 10 W
Power: 5V4A
Kernel: linux kernel-4.9
How to build: https://forums.developer.nvidia.com/t/applying-a-preempt-rt-patch-to-jetpack-4-5-on-jetson-nano/168428/4
[1] In setup_irq_thread()
[2] In __irq_wake_thread()
Reply for other comments:
changing that could cause some critical BHs to not run in time and break things.
I change only the priority of a few interrupts(BH), not all interrupts. It is set with care.