lkml.org 
[lkml]   [2008]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2.6.24.7-rt14 v2] rt: {queue,schedule}_work_prio() allowing work priorities other than caller's priority
Hello,

On Sat, Jul 5, 2008 at 2:59 PM, <leon.woestenberg@gmail.com> wrote:
> The faulty case was a non-FIFO serial driver that deferred LED blinking to
> a workqueue using schedule_work(). However, that work used GPIO bitbanged I2C,
> which uses 50 usecs udelay()s. With the work inheriting the serial IRQ priority,
> it easily missed the ~60 usec deadline of 115200 bps communications.
>
John Kacur asked forthe (custom) code showing this case on IRC.

I suspect the current kernel also has drivers that *also* depend on
workqueue's not pre-empting or delaying their calling interrupt
handler.


See http://www.sidebranch.com/leon/ for the code. A short file roadmap
and explanation of the analysis:

lowlevel_16550.c: non-FIFO UART driver
axonbus.c: protocol handler
max7311.c: I2C -> GPIO extender, driving a few LEDs.

Queueing the "blink a LED" work happens in this code path:

lowlevel_16550.c:axonbus_isr() -> axonbus.c:ab_cmd_receive() ->
boardsupport.c:ll_blink()

The queued work then performs this code path, running at the same
real-time priority as the originating IRQ:
ll_blink_work() -> do_max7311_read() -> i2c-algo-bit.c:* -> udelay(50)

The udelay(50) thus keeps the 16550 interrupt from being serviced.

Scheduling the work at lower priority solved this.

Regards,

Leon.

p.s. we will submit the max7311 driver for upstream.


\
 
 \ /
  Last update: 2008-07-09 18:15    [W:0.034 / U:0.656 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site