[kernel] r16247 - in dists/sid/linux-2.6/debian: . patches/bugfix/all patches/series

Ben Hutchings benh at alioth.debian.org
Tue Sep 7 01:18:14 UTC 2010


Author: benh
Date: Tue Sep  7 01:17:59 2010
New Revision: 16247

Log:
3c59x: Fix deadlock in vortex_error() (Closes: #595554)

Added:
   dists/sid/linux-2.6/debian/patches/bugfix/all/3c59x-Fix-deadlock-in-vortex_error.patch
Modified:
   dists/sid/linux-2.6/debian/changelog
   dists/sid/linux-2.6/debian/patches/series/22

Modified: dists/sid/linux-2.6/debian/changelog
==============================================================================
--- dists/sid/linux-2.6/debian/changelog	Mon Sep  6 13:19:54 2010	(r16246)
+++ dists/sid/linux-2.6/debian/changelog	Tue Sep  7 01:17:59 2010	(r16247)
@@ -37,6 +37,7 @@
   * snd-hda-intel: Add support for VIA V1708S, VT1718S, VT1828S, VT2020,
     VT1716S, VT2002P, VT1812, VT1818S
   * hwmon/w83627ehf: Add support for W83667HG-B
+  * 3c59x: Fix deadlock in vortex_error() (Closes: #595554)
 
   [ Bastian Blank ]
   * Use Breaks instead of Conflicts.

Added: dists/sid/linux-2.6/debian/patches/bugfix/all/3c59x-Fix-deadlock-in-vortex_error.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/bugfix/all/3c59x-Fix-deadlock-in-vortex_error.patch	Tue Sep  7 01:17:59 2010	(r16247)
@@ -0,0 +1,56 @@
+From: Ben Hutchings <ben at decadent.org.uk>
+Date: Sat, 4 Sep 2010 01:51:50 +0100
+Subject: [PATCH] 3c59x: Fix deadlock in vortex_error()
+
+This fixes a bug introduced in commit
+de847272149365363a6043a963a6f42fb91566e2
+"3c59x: Use fine-grained locks for MII and windowed register access".
+
+vortex_interrupt() holds vp->window_lock over multiple register
+accesses to reduce locking overhead.  However it also needs to call
+vortex_error() sometimes, and that uses the regular functions for
+access to windowed registers, which will try to acquire window_lock
+again.
+
+Therefore, drop window_lock around the call to vortex_error() and set
+the window afterward reacquiring the lock.  Since vortex_error() may
+call vortex_rx(), which *does* require its caller to hold window_lock,
+lift that call up into vortex_interrupt().  This also removes the
+potential for calling vortex_rx() on a later-generation NIC.
+---
+ drivers/net/3c59x.c |   10 +++++++---
+ 1 files changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c
+index a045559..85671ad 100644
+--- a/drivers/net/3c59x.c
++++ b/drivers/net/3c59x.c
+@@ -1994,10 +1994,9 @@ vortex_error(struct net_device *dev, int status)
+ 		}
+ 	}
+ 
+-	if (status & RxEarly) {				/* Rx early is unused. */
+-		vortex_rx(dev);
++	if (status & RxEarly)				/* Rx early is unused. */
+ 		iowrite16(AckIntr | RxEarly, ioaddr + EL3_CMD);
+-	}
++
+ 	if (status & StatsFull) {			/* Empty statistics. */
+ 		static int DoneDidThat;
+ 		if (vortex_debug > 4)
+@@ -2298,7 +2297,12 @@ vortex_interrupt(int irq, void *dev_id)
+ 		if (status & (HostError | RxEarly | StatsFull | TxComplete | IntReq)) {
+ 			if (status == 0xffff)
+ 				break;
++			if (status & RxEarly)
++				vortex_rx(dev);
++			spin_unlock(&vp->window_lock);
+ 			vortex_error(dev, status);
++			spin_lock(&vp->window_lock);
++			window_set(vp, 7);
+ 		}
+ 
+ 		if (--work_done < 0) {
+-- 
+1.7.1
+

Modified: dists/sid/linux-2.6/debian/patches/series/22
==============================================================================
--- dists/sid/linux-2.6/debian/patches/series/22	Mon Sep  6 13:19:54 2010	(r16246)
+++ dists/sid/linux-2.6/debian/patches/series/22	Tue Sep  7 01:17:59 2010	(r16247)
@@ -99,3 +99,4 @@
 + features/arm/openrd-uart-selection.patch
 + features/arm/kirkwood-unbreak-pcie-io-port.patch
 + features/arm/dockstar-support.patch
++ bugfix/all/3c59x-Fix-deadlock-in-vortex_error.patch



More information about the Kernel-svn-changes mailing list