[kernel] r14341 - in dists/trunk/linux-2.6/debian: . patches/bugfix/all patches/series
Ben Hutchings
benh at alioth.debian.org
Tue Oct 6 22:45:23 UTC 2009
Author: benh
Date: Tue Oct 6 22:45:21 2009
New Revision: 14341
Log:
sfc: Fix initial link state
Added:
dists/trunk/linux-2.6/debian/patches/bugfix/all/drivers-net-sfc-fix-initial-link-state.patch
Modified:
dists/trunk/linux-2.6/debian/changelog
dists/trunk/linux-2.6/debian/patches/series/base
Modified: dists/trunk/linux-2.6/debian/changelog
==============================================================================
--- dists/trunk/linux-2.6/debian/changelog Mon Oct 5 23:26:59 2009 (r14340)
+++ dists/trunk/linux-2.6/debian/changelog Tue Oct 6 22:45:21 2009 (r14341)
@@ -9,6 +9,7 @@
* nfs: Avoid overrun when copying client IP address string
(Closes: #549002)
* Add support for DEB_BUILD_OPTIONS=parallel=N (Closes: #458560)
+ * sfc: Fix initial link state
[ maximilian attems ]
* Add stable release 2.6.31.2 (Closes: #522828)
Added: dists/trunk/linux-2.6/debian/patches/bugfix/all/drivers-net-sfc-fix-initial-link-state.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/all/drivers-net-sfc-fix-initial-link-state.patch Tue Oct 6 22:45:21 2009 (r14341)
@@ -0,0 +1,72 @@
+From aed0628dae0c26b47d40d65f942abe30279b52a5 Mon Sep 17 00:00:00 2001
+From: Ben Hutchings <bhutchings at solarflare.com>
+Date: Wed, 26 Aug 2009 08:16:27 +0000
+Subject: [PATCH] sfc: Fix ordering of device registration and initial netif_carrier_off()
+
+We must call netif_carrier_off() after the device is registered, not
+before, to set the operational state and user-space IFF_RUNNING flag
+correctly.
+
+Since we don't want observers to see an intermediate state, open-code
+register_netdev() and add efx_update_name() and netif_carrier_off()
+into the locked region.
+
+Signed-off-by: Ben Hutchings <bhutchings at solarflare.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/sfc/efx.c | 26 +++++++++++++++++---------
+ 1 files changed, 17 insertions(+), 9 deletions(-)
+
+diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
+index 343e8da..d4dc920 100644
+--- a/drivers/net/sfc/efx.c
++++ b/drivers/net/sfc/efx.c
+@@ -1614,21 +1614,24 @@ static int efx_register_netdev(struct efx_nic *efx)
+ SET_NETDEV_DEV(net_dev, &efx->pci_dev->dev);
+ SET_ETHTOOL_OPS(net_dev, &efx_ethtool_ops);
+
+- /* Always start with carrier off; PHY events will detect the link */
+- netif_carrier_off(efx->net_dev);
+-
+ /* Clear MAC statistics */
+ efx->mac_op->update_stats(efx);
+ memset(&efx->mac_stats, 0, sizeof(efx->mac_stats));
+
+- rc = register_netdev(net_dev);
+- if (rc) {
+- EFX_ERR(efx, "could not register net dev\n");
+- return rc;
+- }
+-
+ rtnl_lock();
++
++ rc = dev_alloc_name(net_dev, net_dev->name);
++ if (rc < 0)
++ goto fail_locked;
+ efx_update_name(efx);
++
++ rc = register_netdevice(net_dev);
++ if (rc)
++ goto fail_locked;
++
++ /* Always start with carrier off; PHY events will detect the link */
++ netif_carrier_off(efx->net_dev);
++
+ rtnl_unlock();
+
+ rc = device_create_file(&efx->pci_dev->dev, &dev_attr_phy_type);
+@@ -1639,6 +1642,11 @@ static int efx_register_netdev(struct efx_nic *efx)
+
+ return 0;
+
++fail_locked:
++ rtnl_unlock();
++ EFX_ERR(efx, "could not register net dev\n");
++ return rc;
++
+ fail_registered:
+ unregister_netdev(net_dev);
+ return rc;
+--
+1.6.3.3
+
Modified: dists/trunk/linux-2.6/debian/patches/series/base
==============================================================================
--- dists/trunk/linux-2.6/debian/patches/series/base Mon Oct 5 23:26:59 2009 (r14340)
+++ dists/trunk/linux-2.6/debian/patches/series/base Tue Oct 6 22:45:21 2009 (r14341)
@@ -40,3 +40,4 @@
+ bugfix/all/fs-nfs-avoid-overrun-copying-client-ip.patch
- bugfix/x86/fix-i8xx-agp-flush.patch
+ bugfix/all/stable/2.6.31.2.patch
++ bugfix/all/drivers-net-sfc-fix-initial-link-state.patch
More information about the Kernel-svn-changes
mailing list