[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

rpms/kernel/F-7 linux-2.6-net-e1000-debug-shirq.patch, NONE, 1.1 linux-2.6-net-e1000-no-polling-in-open.patch, NONE, 1.1 kernel-2.6.spec, 1.3180, 1.3181



Author: davej

Update of /cvs/pkgs/rpms/kernel/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv19043

Modified Files:
	kernel-2.6.spec 
Added Files:
	linux-2.6-net-e1000-debug-shirq.patch 
	linux-2.6-net-e1000-no-polling-in-open.patch 
Log Message:
* Mon May 21 2007 Dave Jones <davej redhat com>
- Fix up oops in e1000 driver. (#240339)


linux-2.6-net-e1000-debug-shirq.patch:

--- NEW FILE linux-2.6-net-e1000-debug-shirq.patch ---
commit e0aac5a289b1dacbc94bd9ae8c449bcdf9ab508c
Author: Auke Kok <auke-jan h kok intel com>
Date:   Tue Mar 6 08:57:21 2007 -0800

    e1000: FIX: be ready for incoming irq at pci_request_irq
    
    DEBUG_SHIRQ code exposed that e1000 was not ready for incoming interrupts
    after having called pci_request_irq. This obviously requires us to finish
    our software setup which assigns the irq handler before we request the
    irq.
    
    Signed-off-by: Auke Kok <auke-jan h kok intel com>
    Signed-off-by: Jeff Garzik <jeff garzik org>

diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index b28a915..f777d37 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -522,14 +522,15 @@ e1000_release_manageability(struct e1000_adapter *adapter)
 	}
 }
 
-int
-e1000_up(struct e1000_adapter *adapter)
+/**
+ * e1000_configure - configure the hardware for RX and TX
+ * @adapter = private board structure
+ **/
+static void e1000_configure(struct e1000_adapter *adapter)
 {
 	struct net_device *netdev = adapter->netdev;
 	int i;
 
-	/* hardware has been reset, we need to reload some things */
-
 	e1000_set_multi(netdev);
 
 	e1000_restore_vlan(adapter);
@@ -548,14 +549,20 @@ e1000_up(struct e1000_adapter *adapter)
 	}
 
 	adapter->tx_queue_len = netdev->tx_queue_len;
+}
+
+int e1000_up(struct e1000_adapter *adapter)
+{
+	/* hardware has been reset, we need to reload some things */
+	e1000_configure(adapter);
+
+	clear_bit(__E1000_DOWN, &adapter->flags);
 
 #ifdef CONFIG_E1000_NAPI
-	netif_poll_enable(netdev);
+	netif_poll_enable(adapter->netdev);
 #endif
 	e1000_irq_enable(adapter);
 
-	clear_bit(__E1000_DOWN, &adapter->flags);
-
 	/* fire a link change interrupt to start the watchdog */
 	E1000_WRITE_REG(&adapter->hw, ICS, E1000_ICS_LSC);
 	return 0;
@@ -640,15 +647,15 @@ e1000_down(struct e1000_adapter *adapter)
 	 * reschedule our watchdog timer */
 	set_bit(__E1000_DOWN, &adapter->flags);
 
+#ifdef CONFIG_E1000_NAPI
+	netif_poll_disable(netdev);
+#endif
 	e1000_irq_disable(adapter);
 
 	del_timer_sync(&adapter->tx_fifo_stall_timer);
 	del_timer_sync(&adapter->watchdog_timer);
 	del_timer_sync(&adapter->phy_info_timer);
 
-#ifdef CONFIG_E1000_NAPI
-	netif_poll_disable(netdev);
-#endif
 	netdev->tx_queue_len = adapter->tx_queue_len;
 	adapter->link_speed = 0;
 	adapter->link_duplex = 0;
@@ -1410,21 +1417,17 @@ e1000_open(struct net_device *netdev)
 		return -EBUSY;
 
 	/* allocate transmit descriptors */
-	if ((err = e1000_setup_all_tx_resources(adapter)))
+	err = e1000_setup_all_tx_resources(adapter);
+	if (err)
 		goto err_setup_tx;
 
 	/* allocate receive descriptors */
-	if ((err = e1000_setup_all_rx_resources(adapter)))
-		goto err_setup_rx;
-
-	err = e1000_request_irq(adapter);
+	err = e1000_setup_all_rx_resources(adapter);
 	if (err)
-		goto err_req_irq;
+		goto err_setup_rx;
 
 	e1000_power_up_phy(adapter);
 
-	if ((err = e1000_up(adapter)))
-		goto err_up;
 	adapter->mng_vlan_id = E1000_MNG_VLAN_NONE;
 	if ((adapter->hw.mng_cookie.status &
 			  E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT)) {
@@ -1437,12 +1440,33 @@ e1000_open(struct net_device *netdev)
 	    e1000_check_mng_mode(&adapter->hw))
 		e1000_get_hw_control(adapter);
 
+	/* before we allocate an interrupt, we must be ready to handle it.
+	 * Setting DEBUG_SHIRQ in the kernel makes it fire an interrupt
+	 * as soon as we call pci_request_irq, so we have to setup our
+	 * clean_rx handler before we do so.  */
+	e1000_configure(adapter);
+
+	err = e1000_request_irq(adapter);
+	if (err)
+		goto err_req_irq;
+
+	/* From here on the code is the same as e1000_up() */
+	clear_bit(__E1000_DOWN, &adapter->flags);
+
+#ifdef CONFIG_E1000_NAPI
+	netif_poll_enable(netdev);
+#endif
+
+	e1000_irq_enable(adapter);
+
+	/* fire a link status change interrupt to start the watchdog */
+	E1000_WRITE_REG(&adapter->hw, ICS, E1000_ICS_LSC);
+
 	return E1000_SUCCESS;
 
-err_up:
-	e1000_power_down_phy(adapter);
-	e1000_free_irq(adapter);
 err_req_irq:
+	e1000_release_hw_control(adapter);
+	e1000_power_down_phy(adapter);
 	e1000_free_all_rx_resources(adapter);
 err_setup_rx:
 	e1000_free_all_tx_resources(adapter);

linux-2.6-net-e1000-no-polling-in-open.patch:

--- NEW FILE linux-2.6-net-e1000-no-polling-in-open.patch ---
From: Auke Kok <auke-jan h kok intel com>
Subject: [PATCH] e1000: Don't enable polling in open() (was: e1000: assertion	hit in e1000_clean(), kernel 2.6.21.1)
To: herbert gondor apana org au, cebbert redhat com
Cc: netdev vger kernel org, jesse brandeburg intel com,        auke-jan h kok intel com
Date: Mon, 21 May 2007 08:32:41 -0700
Message-ID: <20070521153240 5535 31658 stgit localhost localdomain>

Herbert Xy wrote:
"netif_poll_enable can only be called if you've previously called
netif_poll_disable.  Otherwise a poll might already be in action
and you may get a crash like this."

Removing the call to netif_poll_enable in e1000_open should fix this issue,
the only other call to netif_poll_enable is in e1000_up() which is only
reached after a device reset or resume.

Signed-off-by: Auke Kok <auke-jan h kok intel com>
Cc: Herbert Xu <herbert gondor apana org au>
---

 drivers/net/e1000/e1000_main.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 49be393..cbc7feb 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -1431,10 +1431,6 @@ e1000_open(struct net_device *netdev)
 	/* From here on the code is the same as e1000_up() */
 	clear_bit(__E1000_DOWN, &adapter->flags);
 
-#ifdef CONFIG_E1000_NAPI
-	netif_poll_enable(netdev);
-#endif
-
 	e1000_irq_enable(adapter);
 
 	/* fire a link status change interrupt to start the watchdog */



Index: kernel-2.6.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-7/kernel-2.6.spec,v
retrieving revision 1.3180
retrieving revision 1.3181
diff -u -r1.3180 -r1.3181
--- kernel-2.6.spec	21 May 2007 22:23:29 -0000	1.3180
+++ kernel-2.6.spec	22 May 2007 01:25:42 -0000	1.3181
@@ -552,6 +552,8 @@
 
 # NIC driver fixes
 Patch1300: linux-2.6-e1000-no-msi-warning.patch
+Patch1301: linux-2.6-net-e1000-debug-shirq.patch
+Patch1302: linux-2.6-net-e1000-no-polling-in-open.patch
 
 # Filesystem stuff.
 # Squashfs
@@ -1285,6 +1287,9 @@
 # NIC driver fixes
 # Don't print warnings about MSI failures on e1000
 %patch1300 -p1
+# Fix up e1000 oops (#240339)
+%patch1301 -p1
+%patch1302 -p1
 
 # Filesystem patches.
 # Squashfs
@@ -2400,6 +2405,9 @@
 
 %changelog
 * Mon May 21 2007 Dave Jones <davej redhat com>
+- Fix up oops in e1000 driver. (#240339)
+
+* Mon May 21 2007 Dave Jones <davej redhat com>
 - 2.6.21.2rc1
 
 * Mon May 21 2007 Dave Jones <davej redhat com>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]