aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/mvm/fw.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/fw.c')
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/fw.c54
1 files changed, 21 insertions, 33 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/fw.c b/drivers/net/wireless/iwlwifi/mvm/fw.c
index bc5eac4960e1..df869633f4dd 100644
--- a/drivers/net/wireless/iwlwifi/mvm/fw.c
+++ b/drivers/net/wireless/iwlwifi/mvm/fw.c
@@ -6,7 +6,7 @@
6 * GPL LICENSE SUMMARY 6 * GPL LICENSE SUMMARY
7 * 7 *
8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
9 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH 9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
10 * 10 *
11 * This program is free software; you can redistribute it and/or modify 11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of version 2 of the GNU General Public License as 12 * it under the terms of version 2 of the GNU General Public License as
@@ -32,7 +32,7 @@
32 * BSD LICENSE 32 * BSD LICENSE
33 * 33 *
34 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 34 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
35 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH 35 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
36 * All rights reserved. 36 * All rights reserved.
37 * 37 *
38 * Redistribution and use in source and binary forms, with or without 38 * Redistribution and use in source and binary forms, with or without
@@ -322,7 +322,7 @@ int iwl_run_init_mvm_ucode(struct iwl_mvm *mvm, bool read_nvm)
322 322
323 lockdep_assert_held(&mvm->mutex); 323 lockdep_assert_held(&mvm->mutex);
324 324
325 if (WARN_ON_ONCE(mvm->init_ucode_complete || mvm->calibrating)) 325 if (WARN_ON_ONCE(mvm->calibrating))
326 return 0; 326 return 0;
327 327
328 iwl_init_notification_wait(&mvm->notif_wait, 328 iwl_init_notification_wait(&mvm->notif_wait,
@@ -396,8 +396,6 @@ int iwl_run_init_mvm_ucode(struct iwl_mvm *mvm, bool read_nvm)
396 */ 396 */
397 ret = iwl_wait_notification(&mvm->notif_wait, &calib_wait, 397 ret = iwl_wait_notification(&mvm->notif_wait, &calib_wait,
398 MVM_UCODE_CALIB_TIMEOUT); 398 MVM_UCODE_CALIB_TIMEOUT);
399 if (!ret)
400 mvm->init_ucode_complete = true;
401 399
402 if (ret && iwl_mvm_is_radio_killed(mvm)) { 400 if (ret && iwl_mvm_is_radio_killed(mvm)) {
403 IWL_DEBUG_RF_KILL(mvm, "RFKILL while calibrating.\n"); 401 IWL_DEBUG_RF_KILL(mvm, "RFKILL while calibrating.\n");
@@ -494,15 +492,6 @@ int iwl_mvm_fw_dbg_collect_desc(struct iwl_mvm *mvm,
494 492
495 mvm->fw_dump_desc = desc; 493 mvm->fw_dump_desc = desc;
496 494
497 /* stop recording */
498 if (mvm->cfg->device_family == IWL_DEVICE_FAMILY_7000) {
499 iwl_set_bits_prph(mvm->trans, MON_BUFF_SAMPLE_CTL, 0x100);
500 } else {
501 iwl_write_prph(mvm->trans, DBGC_IN_SAMPLE, 0);
502 /* wait before we collect the data till the DBGC stop */
503 udelay(100);
504 }
505
506 queue_delayed_work(system_wq, &mvm->fw_dump_wk, delay); 495 queue_delayed_work(system_wq, &mvm->fw_dump_wk, delay);
507 496
508 return 0; 497 return 0;
@@ -658,25 +647,24 @@ int iwl_mvm_up(struct iwl_mvm *mvm)
658 * module loading, load init ucode now 647 * module loading, load init ucode now
659 * (for example, if we were in RFKILL) 648 * (for example, if we were in RFKILL)
660 */ 649 */
661 if (!mvm->init_ucode_complete) { 650 ret = iwl_run_init_mvm_ucode(mvm, false);
662 ret = iwl_run_init_mvm_ucode(mvm, false); 651 if (ret && !iwlmvm_mod_params.init_dbg) {
663 if (ret && !iwlmvm_mod_params.init_dbg) { 652 IWL_ERR(mvm, "Failed to run INIT ucode: %d\n", ret);
664 IWL_ERR(mvm, "Failed to run INIT ucode: %d\n", ret); 653 /* this can't happen */
665 /* this can't happen */ 654 if (WARN_ON(ret > 0))
666 if (WARN_ON(ret > 0)) 655 ret = -ERFKILL;
667 ret = -ERFKILL; 656 goto error;
668 goto error; 657 }
669 } 658 if (!iwlmvm_mod_params.init_dbg) {
670 if (!iwlmvm_mod_params.init_dbg) { 659 /*
671 /* 660 * Stop and start the transport without entering low power
672 * should stop and start HW since that INIT 661 * mode. This will save the state of other components on the
673 * image just loaded 662 * device that are triggered by the INIT firwmare (MFUART).
674 */ 663 */
675 iwl_trans_stop_device(mvm->trans); 664 _iwl_trans_stop_device(mvm->trans, false);
676 ret = iwl_trans_start_hw(mvm->trans); 665 _iwl_trans_start_hw(mvm->trans, false);
677 if (ret) 666 if (ret)
678 return ret; 667 return ret;
679 }
680 } 668 }
681 669
682 if (iwlmvm_mod_params.init_dbg) 670 if (iwlmvm_mod_params.init_dbg)