ChanServ changed the topic of #armlinux to: ARM kernel talk [Upstream kernel, find your vendor forums for questions about their kernels] | https://libera.irclog.whitequark.org/armlinux
<maz>
but also, handlers are always threaded with PREEMPT_RT
<dmart>
javierm: Understood, but drivers usually don't care about being preempted. They just need to not race with themselves on other CPUs (spin_lock_...), or with their own interrupt handler on the same CPUs (..._irq)
<dmart>
maz: always threaded> aha, thanks (couldn't quite find that explicitly written down anywhere yet)
<dmart>
So it feels like spin_lock_irqsave() is generally sensible for driver utility functions that might run in interrupt context but are also used in thread context. Does that sound right?
psydroid has quit [Ping timeout: 255 seconds]
<maz>
dmart: indeed, and that explains why spin-locks get downgraded to mutex-like behaviour, with raw_spinlocks taking this role for the section that really rely on that behaviour.
<dmart>
maz: Question: on RT, can a reqular interrupt handler run when preemption is disabled? I'm hoping not, otherwise this is kinda broken.
<dmart>
(If the handler runs in a thread, I guess preempt_disable() ought to prevent switching to it...)
<maz>
dmart: probably not. but my experience with RT is about 6 years old, so you really want to take whatever I say with a large grain of salt (+ some cheese).
<dmart>
javierm: ^ thanks for those
<javierm>
dmart: I think you are correct, unless the IRQ is requested with IRQF_NO_THREAD (or IRQF_TIMER that enables that flag too)
<dmart>
javierm: Right, I assumed that IRQF_NO_THREAD did something like that, but hadn't dug through the code yet.
<dmart>
I think what we are seeing is a race between non-printk console output and printk on different CPUs :(
<arnd>
dmart: could it be that your interrupt handler causes a lockdep splat because it uses a spinlock under preempt_disable()? That combination is not allowed with PREEMPT_RT
<arnd>
dmart: the race you see may be a side-effect of the rewrite of printk that is in the preempt-rt tree
psydroid has joined #armlinux
<dmart>
arnd: Was any of that stuff merged in mainline? I need to check what tree was actually being tested...
<arnd>
dmart: As far as I know the printk rework is one of the last bits that is not in 6.10 yet, but should become part of 6.11
<arnd>
dmart: are you trying to use PREEMPT_RT on mainline kernels rather than linux-rt-devel.git or linux-stable-rt.git?
gclement has quit [Ping timeout: 245 seconds]
heat has joined #armlinux
amitk_ has quit [Ping timeout: 260 seconds]
psydroid2 has joined #armlinux
headless has joined #armlinux
iivanov_ has quit []
biju has joined #armlinux
<dmart>
arnd: This was reported by someone else, so I need to check...
<dmart>
maz: ^ if it's 6 years old, I think it's cheese :)