]> git.karo-electronics.de Git - linux-beck.git/commitdiff
iwlwifi: pcie: don't disable L1 for newest NICs
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Tue, 2 Jul 2013 12:47:29 +0000 (15:47 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 16 Jul 2013 10:12:57 +0000 (13:12 +0300)
In newest NICs (7000 family and up), L1 is supported, so
avoid to disable it.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
drivers/net/wireless/iwlwifi/iwl-7000.c
drivers/net/wireless/iwlwifi/iwl-config.h
drivers/net/wireless/iwlwifi/pcie/trans.c

index 22b7fa5b971af46bf0a3afbbb49e83bdcfc24568..7f61674685c9f8072d9569c527a36a837a1bd46d 100644 (file)
@@ -99,6 +99,7 @@ static const struct iwl_base_params iwl7000_base_params = {
        .wd_timeout = IWL_LONG_WD_TIMEOUT,
        .max_event_log_size = 512,
        .shadow_reg_enable = true,
+       .pcie_l1_allowed = true,
 };
 
 static const struct iwl_ht_params iwl7000_ht_params = {
index 83b9ff6ff3ad8771a2bbc02d16e58371c7c87fbd..87fe955e2a91ffe15d841624842b8f200ed248ee 100644 (file)
@@ -152,6 +152,7 @@ struct iwl_base_params {
        unsigned int wd_timeout;
        u32 max_event_log_size;
        const bool shadow_reg_enable;
+       const bool pcie_l1_allowed;
 };
 
 /*
index bc908d39dac1fd42cdb72f044d863d0fac89b66a..cec0c8991285a7b457bc26374af038b046018e45 100644 (file)
@@ -1418,10 +1418,16 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev,
        spin_lock_init(&trans_pcie->reg_lock);
        init_waitqueue_head(&trans_pcie->ucode_write_waitq);
 
-       /* W/A - seems to solve weird behavior. We need to remove this if we
-        * don't want to stay in L1 all the time. This wastes a lot of power */
-       pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1 |
-                              PCIE_LINK_STATE_CLKPM);
+       if (!cfg->base_params->pcie_l1_allowed) {
+               /*
+                * W/A - seems to solve weird behavior. We need to remove this
+                * if we don't want to stay in L1 all the time. This wastes a
+                * lot of power.
+                */
+               pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S |
+                                      PCIE_LINK_STATE_L1 |
+                                      PCIE_LINK_STATE_CLKPM);
+       }
 
        if (pci_enable_device(pdev)) {
                err = -ENODEV;