forked from Minki/linux
iwlwifi: mvm: enable d3_test even if d3_test_pme_ptr is not available
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>
This commit is contained in:
parent
750a1b456f
commit
4ed80a86da
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user