iwlwifi: disable aspm by default
authorJohn W. Linville <linville@tuxdriver.com>
Thu, 5 Aug 2010 18:39:31 +0000 (14:39 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 16 Aug 2010 18:39:47 +0000 (14:39 -0400)
Some iwlwifi devices inexplicably disconnect themselves from the PCI-E
bus causing the predictable failures.  This seems to disappear if ASPM
is disabled.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-agn.c
drivers/net/wireless/iwlwifi/iwl3945-base.c

index 35337b1e7caceeac3b14ee0c4a2ea3a660010989..49a7a9889c5588fdb1c89c5afd5171acb5a57ca3 100644 (file)
@@ -33,6 +33,7 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/pci.h>
+#include <linux/pci-aspm.h>
 #include <linux/slab.h>
 #include <linux/dma-mapping.h>
 #include <linux/delay.h>
@@ -3968,6 +3969,9 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        /**************************
         * 2. Initializing PCI bus
         **************************/
+       pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1 |
+                               PCIE_LINK_STATE_CLKPM);
+
        if (pci_enable_device(pdev)) {
                err = -ENODEV;
                goto out_ieee80211_free_hw;
index d24eb47d370548b73036411c3532443e2d149c28..bc08242db2cac791d5d62770ede01be02a4812da 100644 (file)
@@ -33,6 +33,7 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/pci.h>
+#include <linux/pci-aspm.h>
 #include <linux/slab.h>
 #include <linux/dma-mapping.h>
 #include <linux/delay.h>
@@ -3963,6 +3964,9 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
        /***************************
         * 2. Initializing PCI bus
         * *************************/
+       pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1 |
+                               PCIE_LINK_STATE_CLKPM);
+
        if (pci_enable_device(pdev)) {
                err = -ENODEV;
                goto out_ieee80211_free_hw;