Adding network devices from interrupts

From: Tobias Ringström (zajbot@goteborg.utfors.se)
Date: Tue Apr 04 2000 - 17:28:32 EST


Hi!

I've had problems (panics) with Cardbus cards and my laptop for some
time. A couple of days ago, I found that the apparent cause was
rtnetlink. The reason was that rtnetlink (the rtmsg_ifinfo function)
tried to allocate an skb with GFP_KERNEL when in interrupt context.
I contacted the netdev list on this issue, and their (Alexey's)
response was that it is not allowed to call register_netdevice()
from an interrupt handler. As you can see from the attached call
stack, this happens when inserting Cardbus a card (or when ther kernel
boots with the card in place). After disabling rtnetlink, I can use
the computer without problems, e.g. registring a network device
actually does *seem* to work, even if is not reliable.

So, should it be allowed to register network devices from interrupts, or
do we need a (kernel) task that does the job?

The card is a tulip, and the driver is not a module. The kernel version
is 2.3.99-pre3 (ia32).

/Tobias

#0 alloc_skb (size=0xf60, gfp_mask=0x7) at skbuff.c:140
#1 0xc01e883c in rtmsg_ifinfo (type=0x10, dev=0xc4090800, change=0xffffffff) at rtnetlink.c:258
#2 0xc01e8cee in rtnetlink_event (this=0xc0290020, event=0x5, ptr=0xc4090800) at rtnetlink.c:505
#3 0xc01e576b in register_netdevice (dev=0xc4090800) at /home/tori/linux-2.3-2/include/linux/notifier.h:71
#4 0xc01a411b in init_netdev (dev=0x0, sizeof_priv=0x3b8, mask=0xc0249ef1 "eth%d", setup=0xc01a41b0 <ether_setup>) at net_init.c:138
#5 0xc01a4146 in init_etherdev (dev=0x0, sizeof_priv=0x3b8) at net_init.c:164
#6 0xc01a3239 in tulip_init_one (pdev=0xc401fc00, ent=0xc028bc98) at tulip_core.c:1003
#7 0xc01c4f59 in pci_announce_device (drv=0xc028bea0, dev=0xc401fc00) at pci.c:289
#8 0xc01c5079 in pci_insert_device (dev=0xc401fc00, bus=0xc40eb0a0) at pci.c:339
#9 0xc01d0431 in cb_alloc (s=0xc1132000) at cardbus.c:319
#10 0xc01c7c65 in unreset_socket (i=0x0) at cs.c:571
#11 0xc011fb6a in timer_bh () at timer.c:283
#12 0xc011cdb9 in bh_action (nr=0x0) at softirq.c:239
#13 0xc011cd08 in tasklet_hi_action (a=0xc02c3d00) at softirq.c:175
#14 0xc011cbda in do_softirq () at softirq.c:73
#15 0xc010bf74 in do_IRQ (regs={ebx = 0xc0108990, ecx = 0xc40f6000, edx = 0xc0294000, esi = 0xc0294000, edi = 0xc0108990,
      ebp = 0xc0295fd4, eax = 0x0, xds = 0xc0100018, xes = 0xc0290018, orig_eax = 0xffffff00, eip = 0xc01089b6, xcs = 0x10,
      eflags = 0x246, esp = 0xc0295fe8, xss = 0xc0108a02}) at irq.c:628
#16 0xc010ad44 in ret_from_intr () at usb-uhci.c:2819
#17 0xc0108a02 in cpu_idle () at process.c:104
#18 0xc0296b26 in start_kernel () at init/main.c:581

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Apr 07 2000 - 21:00:13 EST