From: "John W. Linville" <linville@tuxdriver.com>
To: Roger Luethi <rl@hellgate.ch>
Cc: Marco Berizzi <pupilla@hotmail.com>, netdev@vger.kernel.org
Subject: Re: via_rhine modules error on 2.6.16 with mii-tool
Date: Thu, 13 Apr 2006 14:26:43 -0400 [thread overview]
Message-ID: <20060413182638.GC25854@tuxdriver.com> (raw)
In-Reply-To: <20060327203946.GA11824@k3.hellgate.ch>
On Mon, Mar 27, 2006 at 10:39:46PM +0200, Roger Luethi wrote:
> On Fri, 24 Mar 2006 16:49:10 +0100, Marco Berizzi wrote:
> > Hello evebody.
> > I get this error on linux vanilla 2.6.16
> > with via_rhine module loaded when
> > I run mii-tool:
>
> That was caused by a recent change that replaced an mdelay with msleep.
>
> netdev_ioctl and friends (ethtool calls, too) are known to grab a spin lock
> before they do much of anything, and they hang onto it until they're done.
> They also call mdio_read/write, which requires millisecond delays on Rhine-I.
>
> So on Rhine-I with a 2.6.15+ kernel, the driver ends up calling msleep
> while holding a spin lock -- hence the stack dump.
>
> I wonder if low latency for ancient Rhine-I chips is worth the trouble.
IIRC, the point was that mdelay was getting called in interrupt
context and causing ugly messages to show-up in dmesg.
Would the patch below be sufficient? Or does the whole patch need
to be reverted?
John
diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c
index 2418715..e7b4bc3 100644
--- a/drivers/net/via-rhine.c
+++ b/drivers/net/via-rhine.c
@@ -1145,8 +1130,8 @@ static void rhine_disable_linkmon(void _
if (quirks & rqRhineI) {
iowrite8(0x01, ioaddr + MIIRegAddr); // MII_BMSR
- /* Do not call from ISR! */
- msleep(1);
+ /* Can be called from ISR. Evil. */
+ mdelay(1);
/* 0x80 must be set immediately before turning it off */
iowrite8(0x80, ioaddr + MIICmd);
--
John W. Linville
linville@tuxdriver.com
next parent reply other threads:[~2006-04-13 18:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <BAY103-F401F96F0B06D75E70AF0BFB2DF0@phx.gbl>
[not found] ` <20060327203946.GA11824@k3.hellgate.ch>
2006-04-13 18:26 ` John W. Linville [this message]
2006-04-13 18:40 ` via_rhine modules error on 2.6.16 with mii-tool Stephen Hemminger
2006-04-13 20:47 ` Roger Luethi
2006-04-13 21:02 ` Stephen Hemminger
2006-04-13 21:36 ` Francois Romieu
2006-04-13 21:55 ` Roger Luethi
2006-04-13 20:31 ` Roger Luethi
2006-05-19 14:41 ` [patch] via-rhine: revert "change mdelay to msleep and remove from ISR path" John W. Linville
2006-05-19 14:51 ` [patch w/o fuzz] " John W. Linville
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=20060413182638.GC25854@tuxdriver.com \
--to=linville@tuxdriver.com \
--cc=netdev@vger.kernel.org \
--cc=pupilla@hotmail.com \
--cc=rl@hellgate.ch \
/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 NNTP newsgroup(s).