D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Tasklets

 

Robin Cornelius wrote:
Yes its perfectly feasable, its all gpl and on sourceforge in a cvs tree.

So I


can either post sections of offending code or you can have a browse of the tree directly. What is simplest?

Offending code is probably easiest. I didn't get to bed last night and I'm not firing on all cylinders...



Ok here goes its quite a bit of code but it is the important bits.
rt2x00_interrupt_rxdone is called from a master interupt handler that reads a bit mask on the device to determine what interrupt routine to fire, that (master handler) is protected with a spin_lock_irq_save() and spin_lock_irq_restore().



BIG Snip...


        /* Schedule rx packet processing. */
        if(!skb_queue_empty(&adapter->rx_packet_queue))
                tasklet_schedule(&adapter->rx_tasklet);

        spin_unlock(&adapter->rx_lock);
}


snip ...


If i replace the tasklet_schedule with a *direct* call to the tasklet handler then all that code works. But left as is here the tasklets don't fire and a big crash is encountered at some point later.

So tasklet_schedule() *is* being called. And I presume there's no other invocation of tasklet_disable() anywhere so that the disable count is zero at this stage...


Actually, what I'm trying to say is : "Is

(0 == adapter->rx_tasklet.count)

at this juncture ?"

tasklet_schedule just puts it on the head of the per-cpu tasklet list, so if it's called (which it seems to be from your direct call mod...) then this *must* work,

tasklet_action() can only fail if it a) fails to lock the tasklet (ie (TASKLET_STATE_RUN == rx_tasklet.state) , or b) the tasklet disable count is non-zero.

Or, as experience has taught me to add to the end of any smartarse opinion, something else is going on...

jd

--

John Daragon                                          john@xxxxxxxxxx
argv[0] limited
Lambs Lawn Cottage,  Staple Fitzpaine,  Taunton,  TA3 5SL,  UK
v +44 (0) 1460 234068   f +44 (0) 1460 234069   m +44 (0) 7836 576127



--
The Mailing List for the Devon & Cornwall LUG
Mail majordomo@xxxxxxxxxxxxx with "unsubscribe list" in the
message body to unsubscribe. FAQ: www.dcglug.org.uk/linux_adm/list-faq.html