Commit 260a4381 authored by Andrew Morton's avatar Andrew Morton Committed by James Bottomley

[PATCH] fix SMP lockup in eepro100 with ethtool on unused

Patch from Jason Lunz <lunz@falooley.org>

When support for the GSET and SSET ethtool ioctls 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 an unconfigured eepro100 interface.

The fix is to initialize the spinlock at probe time.
parent 29aaccfb
......@@ -843,6 +843,7 @@ static int __devinit speedo_found1(struct pci_dev *pdev,
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) {
......@@ -994,7 +995,6 @@ speedo_open(struct net_device *dev)
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. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment