From 260a43815e0485891d42a6ac0f81d4f020467830 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sat, 8 Mar 2003 03:28:30 -0800 Subject: [PATCH] [PATCH] fix SMP lockup in eepro100 with ethtool on unused Patch from Jason Lunz 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. --- drivers/net/eepro100.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/eepro100.c b/drivers/net/eepro100.c index 4ae5522a98359..202c3e127b707 100644 --- a/drivers/net/eepro100.c +++ b/drivers/net/eepro100.c @@ -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. */ -- 2.53.0