From: Robert Love <rml@tech9.net>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Andre Hedrick <andre@linux-ide.org>,
Andrew Morton <akpm@digeo.com>, Greg KH <greg@kroah.com>,
linux-kernel@vger.kernel.org
Subject: Re: Sleeping function called from illegal context...
Date: 28 Sep 2002 13:06:05 -0400 [thread overview]
Message-ID: <1033232764.23958.80.camel@phantasy> (raw)
In-Reply-To: <1033207583.17777.28.camel@irongate.swansea.linux.org.uk>
On Sat, 2002-09-28 at 06:06, Alan Cox wrote:
> Reminds me though Robert (and Jeff)
>
> drivers/net/8390.c still needs ei_start_xmit fixing
>
> pre-emption should be disabled between
>
> /* Mask interrupts from the ethercard.
> SMP: We have to grab the lock here otherwise the IRQ handler
>
> and
> disable_irq_nosync(dev->irq);
>
> spin_lock(&ei_local->page_lock);
Sounds reasonable enough. What about the attached patch? If we flip
the order of the disable_irq and spin_lock, we do not need to actually
explicitly disable preemption... the lock will do that for us.
Is this safe?
This also has the general benefit of not spinning on the lock with the
irq disabled (same sort of downside has preempting with the irq
disabled).
Robert Love
diff -urN linux-2.5.39/drivers/net/8390.c linux/drivers/net/8390.c
--- linux-2.5.39/drivers/net/8390.c Fri Sep 27 17:49:05 2002
+++ linux/drivers/net/8390.c Sat Sep 28 13:02:47 2002
@@ -243,9 +243,9 @@
}
/* Ugly but a reset can be slow, yet must be protected */
-
- disable_irq_nosync(dev->irq);
+
spin_lock(&ei_local->page_lock);
+ disable_irq_nosync(dev->irq);
/* Try to restart the card. Perhaps the user has fixed something. */
ei_reset_8390(dev);
@@ -286,10 +286,9 @@
/*
* Slow phase with lock held.
*/
-
- disable_irq_nosync(dev->irq);
-
+
spin_lock(&ei_local->page_lock);
+ disable_irq_nosync(dev->irq);
ei_local->irqlock = 1;
next prev parent reply other threads:[~2002-09-28 17:01 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-27 23:30 Sleeping function called from illegal context Greg KH
2002-09-27 23:50 ` Andrew Morton
2002-09-28 0:43 ` (more) " Luc Van Oostenryck
2002-09-28 1:22 ` Andrew Morton
2002-09-28 0:44 ` Luc Van Oostenryck
2002-09-28 1:24 ` Andrew Morton
2002-09-28 2:15 ` Greg KH
2002-09-28 0:44 ` Luc Van Oostenryck
2002-09-28 1:27 ` Andrew Morton
2002-09-30 12:50 ` [Lksctp-developers] " Jon Grimm
2002-09-30 13:34 ` Jon Grimm
2002-09-28 2:04 ` Andre Hedrick
2002-09-28 3:06 ` Robert Love
2002-09-28 3:21 ` Andre Hedrick
2002-09-28 3:29 ` Robert Love
2002-09-28 10:06 ` Alan Cox
2002-09-28 17:06 ` Robert Love [this message]
2002-09-28 0:51 ` Robert Love
2002-09-28 2:16 ` Greg KH
2002-09-28 14:54 ` John Levon
2002-09-28 17:05 ` Andrew Morton
2002-09-28 17:24 ` John Levon
2002-09-28 18:27 ` Robert Love
2002-09-28 18:38 ` John Levon
2002-09-29 0:50 ` William Lee Irwin III
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=1033232764.23958.80.camel@phantasy \
--to=rml@tech9.net \
--cc=akpm@digeo.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=andre@linux-ide.org \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
/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