Skip to contentSkip to conversation

problem with queue_task() and mark_bh()...

DISCUSSION Steven Scholz 1 participant 3 messages Apr 13, 2004 – Apr 15, 2004

lore
Share & tools
lore
#0 lore raw

Hi there,

I have a problem with queue_task() and mark_bh().

In a driver for the wireless HERMES-II chipset I found the code snippets

/* Register the ISR handler information here... */
lp->task.routine = (void (*)(void *))wl_isr_handler; lp->task.data = lp;
printk("wl_isr_handler is @ %#lx\n", lp->task.routine);

At a later point (namely in the interrupt service rountine this happens:

/* If we have interrupts pending, then put them on a system task queue.*/

 if( events == HCF_INT_PENDING ) {
	/* Schedule the ISR handler as a bottom-half task in the
	 * tq_immediate queue
	 */
	printk( "Schedule the ISR handler %#lx...\n", lp->task.routine);

	queue_task( &( lp->task ), &tq_immediate );
	mark_bh( IMMEDIATE_BH );
}

The problem is now that the queued task lp->task (i.e. wl_isr_handler) never get's called! And thus the driver does not work.

If I call the function directly using

	lp->task.routine(lp);

instead of queue_task() and mark_bh() the function wl_isr_handler() gets called and the driver works.

Any idea why queue_task() and mark_bh() do not work as expected? How could I debug this problem?
(The two printk's show the same address.)

I am using linuxppc-2.4.25 from DENX CVS.

Thanks a million!!!

--
Steven Scholz

imc Measurement & Control               imc Meßsysteme GmbH
Voltastr. 5                             Voltastr. 5
13355 Berlin                            13355 Berlin
Germany                                 Deutschland

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#1 lore raw

Hi,

Quoted 15 lines · I wrote:

I have a problem with queue_task() and mark_bh().
...
At a later point (namely in the interrupt service rountine this happens:

/* If we have interrupts pending, then put them on a system task queue.*/

 if( events == HCF_INT_PENDING ) {
    /* Schedule the ISR handler as a bottom-half task in the
     * tq_immediate queue
     */
    printk( "Schedule the ISR handler %#lx...\n", lp->task.routine);

    queue_task( &( lp->task ), &tq_immediate );
    mark_bh( IMMEDIATE_BH );
}
Quoted 2 lines

The problem is now that the queued task lp->task (i.e. wl_isr_handler) never get's called! And thus the driver does not work.

When I call run_task_queue(&tq_immediate) right after mark_bh(IMMEDIATE_BH) then it works.

But I though "run_task_queue(&tq_immediate)" gets called by the kernel (after every timer interrupt)...

--
Steven Scholz

imc Measurement & Control               imc Meßsysteme GmbH
Voltastr. 5                             Voltastr. 5
13355 Berlin                            13355 Berlin
Germany                                 Deutschland

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#2 lore raw

Hi,

Quoted 2 lines
Quoted 2 lines
    queue_task( &( lp->task ), &tq_immediate );
    mark_bh( IMMEDIATE_BH );

I've put some printks in my kernel.

Now I can see that the task is successfully queued, that mark_bh() is called and the tasklet_hi_schedule() calls __tasklet_hi_schedule().

But the function immediate_bh() in kernel/timer.c (which should then call run_task_queue(&tq_immediate)) is never called.

Any ideas?

Steven

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/