linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* alloc_skb called nonatomically from interrupt
@ 2005-04-12  5:24 Daniel Ann
  0 siblings, 0 replies; only message in thread
From: Daniel Ann @ 2005-04-12  5:24 UTC (permalink / raw)
  To: linux-kernel

Hiya folks

I'm trying to get a feel of notifier_call_chain(), but with no luck.
This is basically what I've done.

On 2.4.21, I've added dev_sample() function which I've declared and
implemented in include/linux/netdevice.h and net/core/dev.c
respectively.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
int dev_sample(struct net_device *dev)
{
    notifier_call_chain(&netdev_chain, NETDEV_SAMPLE, dev);
    return 0;
}
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Of course, I've defined NETDEV_SAMPLE in include/linux/notifier.h

Now up to this stage, its fine. Problem is when I try to call
dev_sample() from driver/net/natsemi.c (my network device driver).

natsemi.c has check_link function which runs periodically and checks
to see if cable is out. So I've placed my dev_sample() in this
function and have it called whenever status of cable changes. But as
soon as the status change, machine dies with "alloc_skb called
nonatomically from interrupt c00ba700", with some printk's I was able
to find out notifier_call_chain() was getting called. But it happens
when it traverses the &netdev_chain. (at the very first one in fact)

I've tried wrapping the dev_sample() with rtnl_lock and unlock but
with no luck. It looks to me its to do with accessing resource at a
wrong time, but I have no idea where to go from here.

Any suggestion would be appreciated.
Cheers,

-- 
Daniel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-04-12  5:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-12  5:24 alloc_skb called nonatomically from interrupt Daniel Ann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).