No subject


Fri Jan 15 15:06:42 UTC 2010


Added:
   dists/lenny/linux-2.6/debian/patches/bugfix/all/bnx2-Allow-phy-reset-to-be-skipped-during-chip-reset.patch
   dists/lenny/linux-2.6/debian/patches/bugfix/all/bnx2-Fix-panic-in-bnx2_poll_work.patch
   dists/lenny/linux-2.6/debian/patches/bugfix/all/bnx2-Prevent-ethtool-s-from-crashing-when-device-is-down.patch
   dists/lenny/linux-2.6/debian/patches/bugfix/all/bnx2-Restrict-WoL-support.patch
Modified:
   dists/lenny/linux-2.6/debian/changelog
   dists/lenny/linux-2.6/debian/patches/series/22

Modified: dists/lenny/linux-2.6/debian/changelog
==============================================================================
--- dists/lenny/linux-2.6/debian/changelog	Sun Jan 17 23:29:17 2010	(r14949)
+++ dists/lenny/linux-2.6/debian/changelog	Sun Jan 17 23:46:37 2010	(r14950)
@@ -14,6 +14,7 @@
     (Closes: #515533)
   * x86: Increase MIN_GAP to include randomized stack (Closes: #559035)
   * bnx2: Add PCI IDs for Broadcom 5716 and 5716S (Closes: #565353)
+  * bnx2: Apply various upstream bug fixes
 
  -- maximilian attems <maks at debian.org>  Mon, 28 Dec 2009 23:44:19 +0100
 

Added: dists/lenny/linux-2.6/debian/patches/bugfix/all/bnx2-Allow-phy-reset-to-be-skipped-during-chip-reset.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/bugfix/all/bnx2-Allow-phy-reset-to-be-skipped-during-chip-reset.patch	Sun Jan 17 23:46:37 2010	(r14950)
@@ -0,0 +1,218 @@
+From 9a120bc570627342c17befaa6af9b0a556dfda48 Mon Sep 17 00:00:00 2001
+From: Michael Chan <mchan at broadcom.com>
+Date: Fri, 16 May 2008 22:17:45 -0700
+Subject: [PATCH] bnx2: Allow phy reset to be skipped during chip reset.
+
+Andy Gospodarek <andy at greyhouse.net> found that netconsole would
+panic when resetting bnx2 devices.
+
+>From Andy:
+"The issue is the bnx2_set_link in bnx2_init_nic will print a link-status
+message before we are fully initialized and ready to start polling.
+Polling is currently disabled in this state, but since the
+__LINK_STATE_RX_SCHED is overloaded to not only try and disable polling
+but also to make the system aware there is something waiting to be
+polled, we really have to fix this in drivers.
+
+The problematic call is the one to netif_rx_complete as it tries to
+remove an entry from the poll_list when there isn't one."
+
+While this netconsole problem should be fixed separately, we really
+should not reset the PHY when changing ring sizes, MTU, or other
+similar settings.  The PHY reset causes several seconds of unnecessary
+link disruptions.
+
+Signed-off-by: Michael Chan <mchan at broadcom.com>
+Acked-by: Andy Gospodarek <andy at greyhouse.net>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/bnx2.c |   50 +++++++++++++++++++++++++++-----------------------
+ 1 files changed, 27 insertions(+), 23 deletions(-)
+
+diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
+index 4b46e68..934c2bf 100644
+--- a/drivers/net/bnx2.c
++++ b/drivers/net/bnx2.c
+@@ -1875,7 +1875,7 @@ bnx2_setup_phy(struct bnx2 *bp, u8 port)
+ }
+ 
+ static int
+-bnx2_init_5709s_phy(struct bnx2 *bp)
++bnx2_init_5709s_phy(struct bnx2 *bp, int reset_phy)
+ {
+ 	u32 val;
+ 
+@@ -1890,7 +1890,8 @@ bnx2_init_5709s_phy(struct bnx2 *bp)
+ 	bnx2_write_phy(bp, MII_BNX2_AER_AER, MII_BNX2_AER_AER_AN_MMD);
+ 
+ 	bnx2_write_phy(bp, MII_BNX2_BLK_ADDR, MII_BNX2_BLK_ADDR_COMBO_IEEEB0);
+-	bnx2_reset_phy(bp);
++	if (reset_phy)
++		bnx2_reset_phy(bp);
+ 
+ 	bnx2_write_phy(bp, MII_BNX2_BLK_ADDR, MII_BNX2_BLK_ADDR_SERDES_DIG);
+ 
+@@ -1924,11 +1925,12 @@ bnx2_init_5709s_phy(struct bnx2 *bp)
+ }
+ 
+ static int
+-bnx2_init_5708s_phy(struct bnx2 *bp)
++bnx2_init_5708s_phy(struct bnx2 *bp, int reset_phy)
+ {
+ 	u32 val;
+ 
+-	bnx2_reset_phy(bp);
++	if (reset_phy)
++		bnx2_reset_phy(bp);
+ 
+ 	bp->mii_up1 = BCM5708S_UP1;
+ 
+@@ -1981,9 +1983,10 @@ bnx2_init_5708s_phy(struct bnx2 *bp)
+ }
+ 
+ static int
+-bnx2_init_5706s_phy(struct bnx2 *bp)
++bnx2_init_5706s_phy(struct bnx2 *bp, int reset_phy)
+ {
+-	bnx2_reset_phy(bp);
++	if (reset_phy)
++		bnx2_reset_phy(bp);
+ 
+ 	bp->phy_flags &= ~BNX2_PHY_FLAG_PARALLEL_DETECT;
+ 
+@@ -2018,11 +2021,12 @@ bnx2_init_5706s_phy(struct bnx2 *bp)
+ }
+ 
+ static int
+-bnx2_init_copper_phy(struct bnx2 *bp)
++bnx2_init_copper_phy(struct bnx2 *bp, int reset_phy)
+ {
+ 	u32 val;
+ 
+-	bnx2_reset_phy(bp);
++	if (reset_phy)
++		bnx2_reset_phy(bp);
+ 
+ 	if (bp->phy_flags & BNX2_PHY_FLAG_CRC_FIX) {
+ 		bnx2_write_phy(bp, 0x18, 0x0c00);
+@@ -2070,7 +2074,7 @@ bnx2_init_copper_phy(struct bnx2 *bp)
+ 
+ 
+ static int
+-bnx2_init_phy(struct bnx2 *bp)
++bnx2_init_phy(struct bnx2 *bp, int reset_phy)
+ {
+ 	u32 val;
+ 	int rc = 0;
+@@ -2096,14 +2100,14 @@ bnx2_init_phy(struct bnx2 *bp)
+ 
+ 	if (bp->phy_flags & BNX2_PHY_FLAG_SERDES) {
+ 		if (CHIP_NUM(bp) == CHIP_NUM_5706)
+-			rc = bnx2_init_5706s_phy(bp);
++			rc = bnx2_init_5706s_phy(bp, reset_phy);
+ 		else if (CHIP_NUM(bp) == CHIP_NUM_5708)
+-			rc = bnx2_init_5708s_phy(bp);
++			rc = bnx2_init_5708s_phy(bp, reset_phy);
+ 		else if (CHIP_NUM(bp) == CHIP_NUM_5709)
+-			rc = bnx2_init_5709s_phy(bp);
++			rc = bnx2_init_5709s_phy(bp, reset_phy);
+ 	}
+ 	else {
+-		rc = bnx2_init_copper_phy(bp);
++		rc = bnx2_init_copper_phy(bp, reset_phy);
+ 	}
+ 
+ setup_phy:
+@@ -4873,7 +4877,7 @@ bnx2_reset_nic(struct bnx2 *bp, u32 reset_code)
+ }
+ 
+ static int
+-bnx2_init_nic(struct bnx2 *bp)
++bnx2_init_nic(struct bnx2 *bp, int reset_phy)
+ {
+ 	int rc;
+ 
+@@ -4881,7 +4885,7 @@ bnx2_init_nic(struct bnx2 *bp)
+ 		return rc;
+ 
+ 	spin_lock_bh(&bp->phy_lock);
+-	bnx2_init_phy(bp);
++	bnx2_init_phy(bp, reset_phy);
+ 	bnx2_set_link(bp);
+ 	if (bp->phy_flags & BNX2_PHY_FLAG_REMOTE_PHY_CAP)
+ 		bnx2_remote_phy_event(bp);
+@@ -5269,7 +5273,7 @@ bnx2_test_loopback(struct bnx2 *bp)
+ 
+ 	bnx2_reset_nic(bp, BNX2_DRV_MSG_CODE_RESET);
+ 	spin_lock_bh(&bp->phy_lock);
+-	bnx2_init_phy(bp);
++	bnx2_init_phy(bp, 1);
+ 	spin_unlock_bh(&bp->phy_lock);
+ 	if (bnx2_run_loopback(bp, BNX2_MAC_LOOPBACK))
+ 		rc |= BNX2_MAC_LOOPBACK_FAILED;
+@@ -5659,7 +5663,7 @@ bnx2_open(struct net_device *dev)
+ 		return rc;
+ 	}
+ 
+-	rc = bnx2_init_nic(bp);
++	rc = bnx2_init_nic(bp, 1);
+ 
+ 	if (rc) {
+ 		bnx2_napi_disable(bp);
+@@ -5691,7 +5695,7 @@ bnx2_open(struct net_device *dev)
+ 
+ 			bnx2_setup_int_mode(bp, 1);
+ 
+-			rc = bnx2_init_nic(bp);
++			rc = bnx2_init_nic(bp, 0);
+ 
+ 			if (!rc)
+ 				rc = bnx2_request_irq(bp);
+@@ -5727,7 +5731,7 @@ bnx2_reset_task(struct work_struct *work)
+ 	bp->in_reset_task = 1;
+ 	bnx2_netif_stop(bp);
+ 
+-	bnx2_init_nic(bp);
++	bnx2_init_nic(bp, 1);
+ 
+ 	atomic_set(&bp->intr_sem, 1);
+ 	bnx2_netif_start(bp);
+@@ -6421,7 +6425,7 @@ bnx2_set_coalesce(struct net_device *dev, struct ethtool_coalesce *coal)
+ 
+ 	if (netif_running(bp->dev)) {
+ 		bnx2_netif_stop(bp);
+-		bnx2_init_nic(bp);
++		bnx2_init_nic(bp, 0);
+ 		bnx2_netif_start(bp);
+ 	}
+ 
+@@ -6464,7 +6468,7 @@ bnx2_change_ring_size(struct bnx2 *bp, u32 rx, u32 tx)
+ 		rc = bnx2_alloc_mem(bp);
+ 		if (rc)
+ 			return rc;
+-		bnx2_init_nic(bp);
++		bnx2_init_nic(bp, 0);
+ 		bnx2_netif_start(bp);
+ 	}
+ 	return 0;
+@@ -6732,7 +6736,7 @@ bnx2_self_test(struct net_device *dev, struct ethtool_test *etest, u64 *buf)
+ 			bnx2_reset_chip(bp, BNX2_DRV_MSG_CODE_RESET);
+ 		}
+ 		else {
+-			bnx2_init_nic(bp);
++			bnx2_init_nic(bp, 1);
+ 			bnx2_netif_start(bp);
+ 		}
+ 
+@@ -7619,7 +7623,7 @@ bnx2_resume(struct pci_dev *pdev)
+ 
+ 	bnx2_set_power_state(bp, PCI_D0);
+ 	netif_device_attach(dev);
+-	bnx2_init_nic(bp);
++	bnx2_init_nic(bp, 1);
+ 	bnx2_netif_start(bp);
+ 	return 0;
+ }
+-- 
+1.6.6
+

Added: dists/lenny/linux-2.6/debian/patches/bugfix/all/bnx2-Fix-panic-in-bnx2_poll_work.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/bugfix/all/bnx2-Fix-panic-in-bnx2_poll_work.patch	Sun Jan 17 23:46:37 2010	(r14950)
@@ -0,0 +1,55 @@
+Based on:
+
+From: Michael Chan <mchan at broadcom.com>
+Subject: [PATCH] bnx2: Fix panic in bnx2_poll_work().
+
+commit 581daf7e00c5e766f26aff80a61a860a17b0d75a upstream.
+
+Add barrier() to bnx2_get_hw_{tx|rx}_cons() to fix this issue:
+
+http://bugzilla.kernel.org/show_bug.cgi?id=12698
+
+This issue was reported by multiple i386 users.  Without barrier(),
+the compiled code looks like the following where %eax contains the
+address of the tx_cons or rx_cons in the DMA status block.  The
+status block contents can change between the cmpb and the movzwl
+instruction.  The driver would crash if the value was not 0xff during
+the cmpb instruction, but changed to 0xff during the movzwl
+instruction.
+
+6828:	80 38 ff             	cmpb   $0xff,(%eax)
+682b:	0f b7 10             	movzwl (%eax),%edx
+
+With the added barrier(), the compiled code now looks correct:
+
+683d:	0f b7 10             	movzwl (%eax),%edx
+6840:	0f b6 c2             	movzbl %dl,%eax
+6843:	3d ff 00 00 00       	cmp    $0xff,%eax
+
+Thanks to Pascal de Bruijn <pmjdebruijn at pcode.nl> for reporting the
+problem and Holger Noefer <hnoefer at pironet-ndh.com> for patiently
+testing test patches for us.
+
+[greg - took out version change]
+
+--- a/drivers/net/bnx2.c
++++ b/drivers/net/bnx2.c
+@@ -2491,7 +2491,7 @@ bnx2_get_hw_tx_cons(struct bnx2_napi *bnapi)
+ 		cons = bnapi->status_blk->status_tx_quick_consumer_index0;
+ 	else
+ 		cons = bnapi->status_blk_msix->status_tx_quick_consumer_index;
+-
++	barrier();
+ 	if (unlikely((cons & MAX_TX_DESC_CNT) == MAX_TX_DESC_CNT))
+ 		cons++;
+ 	return cons;
+@@ -2755,7 +2755,7 @@ bnx2_get_hw_rx_cons(struct bnx2_napi *bnapi)
+ bnx2_get_hw_rx_cons(struct bnx2_napi *bnapi)
+ {
+ 	u16 cons = bnapi->status_blk->status_rx_quick_consumer_index0;
+-
++	barrier();
+ 	if (unlikely((cons & MAX_RX_DESC_CNT) == MAX_RX_DESC_CNT))
+ 		cons++;
+ 	return cons;
+

Added: dists/lenny/linux-2.6/debian/patches/bugfix/all/bnx2-Prevent-ethtool-s-from-crashing-when-device-is-down.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/bugfix/all/bnx2-Prevent-ethtool-s-from-crashing-when-device-is-down.patch	Sun Jan 17 23:46:37 2010	(r14950)
@@ -0,0 +1,48 @@
+From d6b14486953d0e8d1c57db29bf6104cea198b884 Mon Sep 17 00:00:00 2001
+From: Michael Chan <mchan at broadcom.com>
+Date: Mon, 14 Jul 2008 22:37:21 -0700
+Subject: [PATCH] bnx2: Prevent ethtool -s from crashing when device is down.
+
+The device may be in D3-hot state and may crash if we try to
+configure the speed settings by accessing the registers.
+
+Signed-off-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/bnx2.c |   13 ++++++++++++-
+ 1 files changed, 12 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
+index ad61cfd..e9cfb02 100644
+--- a/drivers/net/bnx2.c
++++ b/drivers/net/bnx2.c
+@@ -6215,6 +6215,12 @@ bnx2_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+ 	    !(bp->phy_flags & BNX2_PHY_FLAG_REMOTE_PHY_CAP))
+ 		goto err_out_unlock;
+ 
++	/* If device is down, we can store the settings only if the user
++	 * is setting the currently active port.
++	 */
++	if (!netif_running(dev) && cmd->port != bp->phy_port)
++		goto err_out_unlock;
++
+ 	if (cmd->autoneg == AUTONEG_ENABLE) {
+ 		autoneg |= AUTONEG_SPEED;
+ 
+@@ -6272,7 +6278,12 @@ bnx2_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+ 	bp->req_line_speed = req_line_speed;
+ 	bp->req_duplex = req_duplex;
+ 
+-	err = bnx2_setup_phy(bp, cmd->port);
++	err = 0;
++	/* If device is down, the new settings will be picked up when it is
++	 * brought up.
++	 */
++	if (netif_running(dev))
++		err = bnx2_setup_phy(bp, cmd->port);
+ 
+ err_out_unlock:
+ 	spin_unlock_bh(&bp->phy_lock);
+-- 
+1.6.6
+

Added: dists/lenny/linux-2.6/debian/patches/bugfix/all/bnx2-Restrict-WoL-support.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/bugfix/all/bnx2-Restrict-WoL-support.patch	Sun Jan 17 23:46:37 2010	(r14950)
@@ -0,0 +1,34 @@
+From 5ec6d7bf195c2e70003ff30e4f51390ef7e85a31 Mon Sep 17 00:00:00 2001
+From: Michael Chan <mchan at broadcom.com>
+Date: Wed, 12 Nov 2008 16:01:41 -0800
+Subject: [PATCH] bnx2: Restrict WoL support.
+
+On some quad-port cards that cannot support WoL on all ports due
+to excessive power consumption, the driver needs to restrict WoL
+on some ports by checking VAUX_PRESET bit.
+
+Signed-off-by: Michael Chan <mchan at broadcom.com>
+Signed-off-by: Matt Carlson <mcarlson at broadcom.com>
+Signed-off-by: Benjamin Li <benli at broadcom.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/bnx2.c |    3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
+index 49ebb50..d28cbce 100644
+--- a/drivers/net/bnx2.c
++++ b/drivers/net/bnx2.c
+@@ -7586,7 +7586,8 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
+ 
+ 	if ((CHIP_ID(bp) == CHIP_ID_5708_A0) ||
+ 	    (CHIP_ID(bp) == CHIP_ID_5708_B0) ||
+-	    (CHIP_ID(bp) == CHIP_ID_5708_B1)) {
++	    (CHIP_ID(bp) == CHIP_ID_5708_B1) ||
++	    !(REG_RD(bp, BNX2_PCI_CONFIG_3) & BNX2_PCI_CONFIG_3_VAUX_PRESET)) {
+ 		bp->flags |= BNX2_FLAG_NO_WOL;
+ 		bp->wol = 0;
+ 	}
+-- 
+1.6.6
+

Modified: dists/lenny/linux-2.6/debian/patches/series/22
==============================================================================
--- dists/lenny/linux-2.6/debian/patches/series/22	Sun Jan 17 23:29:17 2010	(r14949)
+++ dists/lenny/linux-2.6/debian/patches/series/22	Sun Jan 17 23:46:37 2010	(r14950)
@@ -7,3 +7,7 @@
 + bugfix/all/x86-Increase-MIN_GAP-to-include-randomized-stack.patch
 + features/all/bnx2-Add-PCI-ID-for-5716.patch
 + features/all/bnx2-Add-PCI-ID-for-5716S.patch
++ bugfix/all/bnx2-Allow-phy-reset-to-be-skipped-during-chip-reset.patch
++ bugfix/all/bnx2-Prevent-ethtool-s-from-crashing-when-device-is-down.patch
++ bugfix/all/bnx2-Restrict-WoL-support.patch
++ bugfix/all/bnx2-Fix-panic-in-bnx2_poll_work.patch



More information about the Kernel-svn-changes mailing list