blob: d3b41987e1867e652bb36f4afa66ccb3da489ad0 [file] [log] [blame]
From stable-bounces@linux.kernel.org Fri Feb 16 15:00:49 2007
From: Stephen Hemminger <shemminger@linux-foundation.org>
Date: Fri, 16 Feb 2007 14:56:11 -0800
Subject: sky2: transmit timeout deadlock
To: stable@kernel.org
Message-ID: <20070216225836.237453000@linux-foundation.org>
Content-Disposition: inline; filename=sky2-tx-timeout-deadlock.patch
From: Stephen Hemminger <shemminger@linux-foundation.org>
The code in transmit timeout incorrectly assumed that netif_tx_lock
was not set.
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/net/sky2.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
--- linux-2.6.20.1.orig/drivers/net/sky2.c
+++ linux-2.6.20.1/drivers/net/sky2.c
@@ -1796,6 +1796,7 @@ out:
/* Transmit timeout is only called if we are running, carries is up
* and tx queue is full (stopped).
+ * Called with netif_tx_lock held.
*/
static void sky2_tx_timeout(struct net_device *dev)
{
@@ -1821,17 +1822,14 @@ static void sky2_tx_timeout(struct net_d
sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_START);
} else if (report != sky2->tx_cons) {
printk(KERN_INFO PFX "status report lost?\n");
-
- netif_tx_lock_bh(dev);
sky2_tx_complete(sky2, report);
- netif_tx_unlock_bh(dev);
} else {
printk(KERN_INFO PFX "hardware hung? flushing\n");
sky2_write32(hw, Q_ADDR(txq, Q_CSR), BMU_STOP);
sky2_write32(hw, Y2_QADDR(txq, PREF_UNIT_CTRL), PREF_UNIT_RST_SET);
- sky2_tx_clean(dev);
+ sky2_tx_complete(sky2, sky2->tx_prod);
sky2_qset(hw, txq);
sky2_prefetch_init(hw, txq, sky2->tx_le_map, TX_RING_SIZE - 1);