From: Ben Hutchings <bhutchings@solarflare.com>
To: ratheesh kannoth <ratheesh.ksz@gmail.com>
Cc: <e1000-devel@lists.sourceforge.net>, <netdev@vger.kernel.org>,
linux-newbie <linux-newbie@vger.kernel.org>,
Alexander Duyck <alexander.h.duyck@intel.com>
Subject: Re: igb_down from bottom half context
Date: Wed, 6 Mar 2013 17:38:06 +0000 [thread overview]
Message-ID: <1362591486.3126.1.camel@bwh-desktop.uk.solarflarecom.com> (raw)
In-Reply-To: <CAGZFCEHrzDDtO8HGaUhuUb_vNddKyiXPzasnkvTqLOqS9SwaDw@mail.gmail.com>
On Wed, 2013-03-06 at 09:38 +0530, ratheesh kannoth wrote:
> I have kernel timer which check for flag.
>
> if(flag ) {
> igb_down(adapter);
> } else {
> igb_up(adapter);
> }
>
>
> I could see a kernel crash; because there are a lot of msleep() in
> igb_down function.
>
> #define msleep(x) do { set_current_state(TASK_UNINTERRUPTIBLE); \
> schedule_timeout((x * HZ)/1000 + 2); \
> } while (0)
>
> sleep() is called from bottom half context; this is the cause of kernel crash.
>
> 1) Since timer call back dont have process context associated with it;
> i think , "current" points to the last preempted task ?
> 2) How can i introduce delays in interrupt context to avoid the kernel
> crash. mdelay() will work ?
> 3) is there any better mechanism to do this job ?
Use a work item and schedule_work().
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
next prev parent reply other threads:[~2013-03-06 17:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-06 4:08 igb_down from bottom half context ratheesh kannoth
2013-03-06 17:38 ` Ben Hutchings [this message]
2013-03-06 18:48 ` anil dahiya
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1362591486.3126.1.camel@bwh-desktop.uk.solarflarecom.com \
--to=bhutchings@solarflare.com \
--cc=alexander.h.duyck@intel.com \
--cc=e1000-devel@lists.sourceforge.net \
--cc=linux-newbie@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=ratheesh.ksz@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox