From: Jason Lunz <lunz@falooley.org>
To: linux-kernel@vger.kernel.org
Subject: [PATCH eepro100] fix SMP deadlock (uninitialized spinlock)
Date: Mon, 17 Mar 2003 20:19:36 +0000 (UTC) [thread overview]
Message-ID: <slrnb7cbg7.q3.lunz@stoli.localnet> (raw)
In-Reply-To: <slrnb6i4bm.a4a.lunz@stoli.localnet>
When support for the ETHTOOL_GSET and ETHTOOL_SSET ethtool methods was
added to eepro100.c in 2.4.20, the tx lock was overloaded to serialize
their use. Unfortunately, this lock is only initialized in dev->open(),
causing ethtool to deadlock the machine when used on a never-opened
eepro100 interface.
The fix is to initialize the spinlock at probe time. The patch below is
against 2.4.21-pre5, but also applies to 2.5.
please apply,
Jason
--- linux-2.4.21-pre5/drivers/net/eepro100.c Thu Feb 27 14:21:34 2003
+++ linux-eepro100/drivers/net/eepro100.c Fri Mar 7 16:38:17 2003
@@ -842,6 +842,7 @@
sp->lstats = (struct speedo_stats *)(sp->tx_ring + TX_RING_SIZE);
sp->lstats_dma = TX_RING_ELEM_DMA(sp, TX_RING_SIZE);
init_timer(&sp->timer); /* used in ioctl() */
+ spin_lock_init(&sp->lock);
sp->mii_if.full_duplex = option >= 0 && (option & 0x10) ? 1 : 0;
if (card_idx >= 0) {
@@ -993,7 +994,6 @@
sp->dirty_tx = 0;
sp->last_cmd = 0;
sp->tx_full = 0;
- spin_lock_init(&sp->lock);
sp->in_interrupt = 0;
/* .. we can safely take handler calls during init. */
prev parent reply other threads:[~2003-03-17 20:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-07 21:38 [PATCH] fix SMP lockup in eepro100 with ethtool on unused interface Jason Lunz
2003-03-17 20:19 ` Jason Lunz [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=slrnb7cbg7.q3.lunz@stoli.localnet \
--to=lunz@falooley.org \
--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
all inboxes | Powered by JetHome®