diff options
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/fw/dbg.c')
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 34 |
1 files changed, 8 insertions, 26 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c index f119c49cd39c..d7380016f1c0 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c | |||
@@ -1614,6 +1614,7 @@ iwl_dump_ini_mem(struct iwl_fw_runtime *fwrt, | |||
1614 | if (!range) { | 1614 | if (!range) { |
1615 | IWL_ERR(fwrt, "Failed to fill region header: id=%d, type=%d\n", | 1615 | IWL_ERR(fwrt, "Failed to fill region header: id=%d, type=%d\n", |
1616 | le32_to_cpu(reg->region_id), type); | 1616 | le32_to_cpu(reg->region_id), type); |
1617 | memset(*data, 0, le32_to_cpu((*data)->len)); | ||
1617 | return; | 1618 | return; |
1618 | } | 1619 | } |
1619 | 1620 | ||
@@ -1623,6 +1624,7 @@ iwl_dump_ini_mem(struct iwl_fw_runtime *fwrt, | |||
1623 | if (range_size < 0) { | 1624 | if (range_size < 0) { |
1624 | IWL_ERR(fwrt, "Failed to dump region: id=%d, type=%d\n", | 1625 | IWL_ERR(fwrt, "Failed to dump region: id=%d, type=%d\n", |
1625 | le32_to_cpu(reg->region_id), type); | 1626 | le32_to_cpu(reg->region_id), type); |
1627 | memset(*data, 0, le32_to_cpu((*data)->len)); | ||
1626 | return; | 1628 | return; |
1627 | } | 1629 | } |
1628 | range = range + range_size; | 1630 | range = range + range_size; |
@@ -1807,12 +1809,12 @@ _iwl_fw_error_ini_dump(struct iwl_fw_runtime *fwrt, | |||
1807 | 1809 | ||
1808 | trigger = fwrt->dump.active_trigs[id].trig; | 1810 | trigger = fwrt->dump.active_trigs[id].trig; |
1809 | 1811 | ||
1810 | size = sizeof(*dump_file); | 1812 | size = iwl_fw_ini_get_trigger_len(fwrt, trigger); |
1811 | size += iwl_fw_ini_get_trigger_len(fwrt, trigger); | ||
1812 | |||
1813 | if (!size) | 1813 | if (!size) |
1814 | return NULL; | 1814 | return NULL; |
1815 | 1815 | ||
1816 | size += sizeof(*dump_file); | ||
1817 | |||
1816 | dump_file = vzalloc(size); | 1818 | dump_file = vzalloc(size); |
1817 | if (!dump_file) | 1819 | if (!dump_file) |
1818 | return NULL; | 1820 | return NULL; |
@@ -1942,14 +1944,10 @@ int iwl_fw_dbg_error_collect(struct iwl_fw_runtime *fwrt, | |||
1942 | iwl_dump_error_desc->len = 0; | 1944 | iwl_dump_error_desc->len = 0; |
1943 | 1945 | ||
1944 | ret = iwl_fw_dbg_collect_desc(fwrt, iwl_dump_error_desc, false, 0); | 1946 | ret = iwl_fw_dbg_collect_desc(fwrt, iwl_dump_error_desc, false, 0); |
1945 | if (ret) { | 1947 | if (ret) |
1946 | kfree(iwl_dump_error_desc); | 1948 | kfree(iwl_dump_error_desc); |
1947 | } else { | 1949 | else |
1948 | set_bit(STATUS_FW_WAIT_DUMP, &fwrt->trans->status); | 1950 | iwl_trans_sync_nmi(fwrt->trans); |
1949 | |||
1950 | /* trigger nmi to halt the fw */ | ||
1951 | iwl_force_nmi(fwrt->trans); | ||
1952 | } | ||
1953 | 1951 | ||
1954 | return ret; | 1952 | return ret; |
1955 | } | 1953 | } |
@@ -2489,22 +2487,6 @@ IWL_EXPORT_SYMBOL(iwl_fw_dbg_apply_point); | |||
2489 | 2487 | ||
2490 | void iwl_fwrt_stop_device(struct iwl_fw_runtime *fwrt) | 2488 | void iwl_fwrt_stop_device(struct iwl_fw_runtime *fwrt) |
2491 | { | 2489 | { |
2492 | /* if the wait event timeout elapses instead of wake up then | ||
2493 | * the driver did not receive NMI interrupt and can not assume the FW | ||
2494 | * is halted | ||
2495 | */ | ||
2496 | int ret = wait_event_timeout(fwrt->trans->fw_halt_waitq, | ||
2497 | !test_bit(STATUS_FW_WAIT_DUMP, | ||
2498 | &fwrt->trans->status), | ||
2499 | msecs_to_jiffies(2000)); | ||
2500 | if (!ret) { | ||
2501 | /* failed to receive NMI interrupt, assuming the FW is stuck */ | ||
2502 | set_bit(STATUS_FW_ERROR, &fwrt->trans->status); | ||
2503 | |||
2504 | clear_bit(STATUS_FW_WAIT_DUMP, &fwrt->trans->status); | ||
2505 | } | ||
2506 | |||
2507 | /* Assuming the op mode mutex is held at this point */ | ||
2508 | iwl_fw_dbg_collect_sync(fwrt); | 2490 | iwl_fw_dbg_collect_sync(fwrt); |
2509 | 2491 | ||
2510 | iwl_trans_stop_device(fwrt->trans); | 2492 | iwl_trans_stop_device(fwrt->trans); |