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

rpms/kernel/F-7 linux-2.6-net-e1000-no-msi-warning.patch, NONE, 1.1 kernel-2.6.spec, 1.3181, 1.3182 linux-2.6-e1000-no-msi-warning.patch, 1.1, NONE



Author: davej

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

Modified Files:
	kernel-2.6.spec 
Added Files:
	linux-2.6-net-e1000-no-msi-warning.patch 
Removed Files:
	linux-2.6-e1000-no-msi-warning.patch 
Log Message:
rename patch

linux-2.6-net-e1000-no-msi-warning.patch:

--- NEW FILE linux-2.6-net-e1000-no-msi-warning.patch ---
commit e94bd23f67c87011f012f26ca0af3fcf6878eeac
Author: Auke Kok <auke-jan h kok intel com>
Date:   Wed May 16 01:49:46 2007 -0700

    e1000: Fix msi enable leak on error, don't print error message, cleanup
    
    pci_enable_msi failure is a normal event so we should not print any error.
    Going over the code I spotted a missing pci_disable_msi() leak when irq
    allocation fails. The whole code also needed a cleanup, so I combined the
    two different calls to pci_request_irq into a single call making this
    look a lot better. All #ifdef CONFIG_PCI_MSI's have been removed.
    
    Compile tested with both CONFIG_PCI_MSI enabled and disabled.
    
    Signed-off-by: Auke Kok <auke-jan h kok intel com>
    Cc: H. Peter Anvin <hpa zytor com>
    Signed-off-by: Jeff Garzik <jeff garzik org>

diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h
index a9ea67e..16a6edf 100644
--- a/drivers/net/e1000/e1000.h
+++ b/drivers/net/e1000/e1000.h
@@ -333,11 +333,9 @@ struct e1000_adapter {
 	struct e1000_tx_ring test_tx_ring;
 	struct e1000_rx_ring test_rx_ring;
 
-
 	int msg_enable;
-#ifdef CONFIG_PCI_MSI
 	boolean_t have_msi;
-#endif
+
 	/* to not mess up cache alignment, always add to the bottom */
 	boolean_t tso_force;
 	boolean_t smart_power_down;	/* phy smart power down */
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 637ae8f..49be393 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -158,9 +158,7 @@ static struct net_device_stats * e1000_get_stats(struct net_device *netdev);
 static int e1000_change_mtu(struct net_device *netdev, int new_mtu);
 static int e1000_set_mac(struct net_device *netdev, void *p);
 static irqreturn_t e1000_intr(int irq, void *data);
-#ifdef CONFIG_PCI_MSI
 static irqreturn_t e1000_intr_msi(int irq, void *data);
-#endif
 static boolean_t e1000_clean_tx_irq(struct e1000_adapter *adapter,
                                     struct e1000_tx_ring *tx_ring);
 #ifdef CONFIG_E1000_NAPI
@@ -300,31 +298,26 @@ module_exit(e1000_exit_module);
 static int e1000_request_irq(struct e1000_adapter *adapter)
 {
 	struct net_device *netdev = adapter->netdev;
-	int flags, err = 0;
+	void (*handler) = &e1000_intr;
+	int irq_flags = IRQF_SHARED;
+	int err;
 
-	flags = IRQF_SHARED;
-#ifdef CONFIG_PCI_MSI
 	if (adapter->hw.mac_type >= e1000_82571) {
-		adapter->have_msi = TRUE;
-		if ((err = pci_enable_msi(adapter->pdev))) {
-			DPRINTK(PROBE, ERR,
-			 "Unable to allocate MSI interrupt Error: %d\n", err);
-			adapter->have_msi = FALSE;
+		adapter->have_msi = !pci_enable_msi(adapter->pdev);
+		if (adapter->have_msi) {
+			handler = &e1000_intr_msi;
+			irq_flags = 0;
 		}
 	}
-	if (adapter->have_msi) {
-		flags &= ~IRQF_SHARED;
-		err = request_irq(adapter->pdev->irq, &e1000_intr_msi, flags,
-		                  netdev->name, netdev);
-		if (err)
-			DPRINTK(PROBE, ERR,
-			       "Unable to allocate interrupt Error: %d\n", err);
-	} else
-#endif
-	if ((err = request_irq(adapter->pdev->irq, &e1000_intr, flags,
-	                       netdev->name, netdev)))
+
+	err = request_irq(adapter->pdev->irq, handler, irq_flags, netdev->name,
+	                  netdev);
+	if (err) {
+		if (adapter->have_msi)
+			pci_disable_msi(adapter->pdev);
 		DPRINTK(PROBE, ERR,
 		        "Unable to allocate interrupt Error: %d\n", err);
+	}
 
 	return err;
 }
@@ -335,10 +328,8 @@ static void e1000_free_irq(struct e1000_adapter *adapter)
 
 	free_irq(adapter->pdev->irq, netdev);
 
-#ifdef CONFIG_PCI_MSI
 	if (adapter->have_msi)
 		pci_disable_msi(adapter->pdev);
-#endif
 }
 
 /**
@@ -3744,7 +3735,6 @@ e1000_update_stats(struct e1000_adapter *adapter)
 
 	spin_unlock_irqrestore(&adapter->stats_lock, flags);
 }
-#ifdef CONFIG_PCI_MSI
 
 /**
  * e1000_intr_msi - Interrupt Handler
@@ -3810,7 +3800,6 @@ e1000_intr_msi(int irq, void *data)
 
 	return IRQ_HANDLED;
 }
-#endif
 
 /**
  * e1000_intr - Interrupt Handler


Index: kernel-2.6.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-7/kernel-2.6.spec,v
retrieving revision 1.3181
retrieving revision 1.3182
diff -u -r1.3181 -r1.3182
--- kernel-2.6.spec	22 May 2007 01:25:42 -0000	1.3181
+++ kernel-2.6.spec	22 May 2007 01:26:59 -0000	1.3182
@@ -551,7 +551,7 @@
 Patch1201: linux-2.6-NFSD-badness.patch
 
 # NIC driver fixes
-Patch1300: linux-2.6-e1000-no-msi-warning.patch
+Patch1300: linux-2.6-net-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
 


--- linux-2.6-e1000-no-msi-warning.patch DELETED ---


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