iwlwifi: mvm: enable d3_test even if d3_test_pme_ptr is not available
authorEliad Peller <eliad@wizery.com>
Thu, 7 Nov 2013 11:23:21 +0000 (13:23 +0200)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Mon, 9 Dec 2013 20:29:02 +0000 (22:29 +0200)
Even if d3_test_pme_ptr is not available, d3_test can still
be useful, e.g. by manually triggering resume (with ctrl-c),
and reading the wakeup reasons.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/iwlwifi/mvm/d3.c

index b9b81e881dd011e5ca06747f2bcceea4ece64ac9..12354f8442553d8141f37d5a36e92fb09792782f 100644 (file)
@@ -1216,10 +1216,6 @@ static int __iwl_mvm_suspend(struct ieee80211_hw *hw,
        if (len >= sizeof(u32) * 2) {
                mvm->d3_test_pme_ptr =
                        le32_to_cpup((__le32 *)d3_cfg_cmd.resp_pkt->data);
-       } else if (test) {
-               /* in test mode we require the pointer */
-               ret = -EIO;
-               goto out;
        }
 #endif
        iwl_free_resp(&d3_cfg_cmd);
@@ -1871,10 +1867,14 @@ static ssize_t iwl_mvm_d3_test_read(struct file *file, char __user *user_buf,
        u32 pme_asserted;
 
        while (true) {
-               pme_asserted = iwl_trans_read_mem32(mvm->trans,
-                                                   mvm->d3_test_pme_ptr);
-               if (pme_asserted)
-                       break;
+               /* read pme_ptr if available */
+               if (mvm->d3_test_pme_ptr) {
+                       pme_asserted = iwl_trans_read_mem32(mvm->trans,
+                                               mvm->d3_test_pme_ptr);
+                       if (pme_asserted)
+                               break;
+               }
+
                if (msleep_interruptible(100))
                        break;
        }