bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gnumach2 and pcmcia


From: Daniel Wagner
Subject: Re: gnumach2 and pcmcia
Date: Fri, 15 Nov 2002 23:10:01 +0100
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-debian-linux-gnu)

> (device driver) EMERGENCY: assertion `FDEV_LINUX_local_irq_count[0] ==0' 
> failed in file ../../../../oskit-20020317+pcmcia/linux/dev/softintr.c, line 
> 121 assertion `FDEV_LINUX_local_irq_count[0] == 0' failed in file 
> ../../../../oskit-20020317
> +pcmcia/linux/dev/softintr.c, line 121
>                                       
> panic in device driver!
> Backtrace: fp=299d54
> 0020f2da 00128551 0012856c 0015ca8b 00128caa 00128a2b 0011268c 0013a6ce
> 0015170a 001510c2 00156fdc 001285bc 00139d59 001576f3 0012be3c 0012a361
> _exit(1) called; rebooting...
>

I have looked into the irq bug and here is what I have found so far.

(gdb) bt
#0  panic (fmt=0x1a4c56 "\r\npanic in device driver!")
    at ../../../oskit-20020317+pcmcia/libc/gen/panic.c:31
#1  0x128551 in log_vpanic () at ../../gnumach/oskit/osenv_log.c:156
#2  0x12856c in log_panic (o=0x1c5d40, 
    fmt=0x1b7920 "assertion `FDEV_LINUX_local_irq_count[0] == 0' failed in file 
../../../../oskit-20020317+pcmcia/linux/dev/softintr.c, line %d\n")
    at ../../gnumach/oskit/osenv_log.c:165
#3  0x17bf4b in linux_softintr_handler (arg=0x0)
    at ../../../../oskit-20020317+pcmcia/linux/dev/softintr.c:121
#4  0x128cb2 in oskit_softint () at ../../gnumach/oskit/osenv_softirq.c:87
#5  0x128a2b in softclock_oskit () at ../../gnumach/oskit/pc/osenv_timer.c:58
#6  0x11268c in softclock () at ../../gnumach/kern/mach_clock.c:305
#7  0x13a4b8 in spl0 ()
#8  0x1413a7 in intr_enable (s=0x1c6b3c)
    at ../../../oskit-20020317+pcmcia/dev/osenv_intr.c:67
#9  0x1579fe in OSKIT_LINUX_linux_sti ()
    at ../../../../oskit-20020317+pcmcia/linux/shared/x86/s_intr.c:31
#10 0x179c6c in linux_intr (data=0xa)
    at ../../../../oskit-20020317+pcmcia/linux/dev/irq.c:100
#11 0x1285bc in irq_handler (iunit=10, old_ipl=1, ret_addr=0x13a109, regs=0x6)
    at ../../gnumach/oskit/osenv_irq.c:78
#12 0x139c49 in interrupt ()
#13 0x12bebf in net_push (ioi=0x10143cd0, b=0xaef3104, pkt_size=98)
    at ../../gnumach/oskit/ds_net.c:293
#14 0x17ad90 in FDEV_LINUX_net_bh ()
    at ../../../../oskit-20020317+pcmcia/linux/dev/net_glue.c:220
#15 0x17bed9 in FDEV_LINUX_do_bottom_half ()
    at ../../../../oskit-20020317+pcmcia/linux/dev/softintr.c:106
#16 0x17bf89 in linux_softintr_handler (arg=0x0)
    at ../../../../oskit-20020317+pcmcia/linux/dev/softintr.c:129
#17 0x128cb2 in oskit_softint () at ../../gnumach/oskit/osenv_softirq.c:87
#18 0x128a2b in softclock_oskit () at ../../gnumach/oskit/pc/osenv_timer.c:58
#19 0x11268c in softclock () at ../../gnumach/kern/mach_clock.c:305
#20 0x13a5be in splx_cli ()
#21 0x114fb6 in idle_thread_continue () at ../../gnumach/kern/sched_prim.c:1703


oskit_softint is called in frame 17 and is interrupted in frame 12 and
suspended. The interrupt handler is called:


static void
linux_intr(void *data)
{
        int irq = (int)data;
        struct pt_regs regs;
        struct int_handler *hand;
        struct task_struct *cur = current;

        kstat.irqs[0][irq]++;
        local_irq_count[0]++;

        if ((handlers[irq]->flags & SA_INTERRUPT) == 0)
                linux_sti();

        hand = handlers[irq];

        while (hand) {
                (*hand->func)(irq, hand->dev_id, &regs);
                hand = hand->next;
        }

        local_irq_count[0]--;

        /* If any linux software handlers pending, schedule a softirq */
        if (bh_mask & bh_active)
                osenv_softirq_schedule(softintr_vector);

        linux_cli();

        current = cur;
}


After local_irq_count[0]++ the interrupts are enabled again (linux_sti()), 
then before local_irq_count[0]-- is executed an another softirq is started
(frame 6). And in frame 3 the assert is triggered, because local_irq_count[0]
is not null. 

static void
linux_softintr_handler(void *arg)
{
        osenv_assert(local_irq_count[0] == 0);
        osenv_assert(local_bh_count[0] == 0);

        /*
         * Interrupts will already be enabled.
         */
        if (bh_mask & bh_active) {
                struct task_struct *cur = current;
                do_bottom_half();
                current = cur;
        }
}

So I do know whats going on, but I don't know whats exactly wrong. Maybe 
the interrupts should not be enabled while the irq handlers are called?

  wagi




reply via email to

[Prev in Thread] Current Thread [Next in Thread]