From: anil dahiya <anildahiya80@gmail.com>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: e1000-devel@lists.sourceforge.net, netdev@vger.kernel.org,
linux-newbie <linux-newbie@vger.kernel.org>,
ratheesh kannoth <ratheesh.ksz@gmail.com>
Subject: Re: igb_down from bottom half context
Date: Thu, 7 Mar 2013 00:18:07 +0530 [thread overview]
Message-ID: <CAHGPgw0EV3-U+h5S0SFdEweUVcT68h5tdRkZbAwRqrNG5z2P+w@mail.gmail.com> (raw)
In-Reply-To: <1362591486.3126.1.camel@bwh-desktop.uk.solarflarecom.com>
[-- Attachment #1.1: Type: text/plain, Size: 1669 bytes --]
You know, you are doing wrong thing i.e sleeping in interrupt context.
As suggested by Ben, move code work queue or somewhere else. Other option
is dont sleep here.
--Anil
On Wed, Mar 6, 2013 at 11:08 PM, Ben Hutchings <bhutchings@solarflare.com>wrote:
> 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.
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.linux-learn.org/faqs
>
[-- Attachment #2: Type: text/plain, Size: 397 bytes --]
------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the
endpoint security space. For insight on selecting the right partner to
tackle endpoint security challenges, access the full report.
http://p.sf.net/sfu/symantec-dev2dev
[-- Attachment #3: Type: text/plain, Size: 257 bytes --]
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
prev parent reply other threads:[~2013-03-06 18:48 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
2013-03-06 18:48 ` anil dahiya [this message]
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=CAHGPgw0EV3-U+h5S0SFdEweUVcT68h5tdRkZbAwRqrNG5z2P+w@mail.gmail.com \
--to=anildahiya80@gmail.com \
--cc=bhutchings@solarflare.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).