Skip to content

Commit 1efc384

Browse files
golanIntellucacoelho
authored andcommitted
iwlwifi: stop dbgc recording before stopping DMA
Today we stop the device and the DMA without stopping the dbgc recording before. This causes host crashes when the DMA rate is high. Stop dbgc recording when clearing the fw debug configuration to fix this. Signed-off-by: Golan Ben Ami <golan.ben.ami@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
1 parent baf41bc commit 1efc384

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

drivers/net/wireless/intel/iwlwifi/fw/dbg.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,7 @@ void iwl_fw_error_dump_wk(struct work_struct *work)
10861086

10871087
if (fwrt->trans->cfg->device_family == IWL_DEVICE_FAMILY_7000) {
10881088
/* stop recording */
1089-
iwl_set_bits_prph(fwrt->trans, MON_BUFF_SAMPLE_CTL, 0x100);
1089+
iwl_fw_dbg_stop_recording(fwrt);
10901090

10911091
iwl_fw_error_dump(fwrt);
10921092

@@ -1104,10 +1104,7 @@ void iwl_fw_error_dump_wk(struct work_struct *work)
11041104
u32 in_sample = iwl_read_prph(fwrt->trans, DBGC_IN_SAMPLE);
11051105
u32 out_ctrl = iwl_read_prph(fwrt->trans, DBGC_OUT_CTRL);
11061106

1107-
/* stop recording */
1108-
iwl_write_prph(fwrt->trans, DBGC_IN_SAMPLE, 0);
1109-
udelay(100);
1110-
iwl_write_prph(fwrt->trans, DBGC_OUT_CTRL, 0);
1107+
iwl_fw_dbg_stop_recording(fwrt);
11111108
/* wait before we collect the data till the DBGC stop */
11121109
udelay(500);
11131110

drivers/net/wireless/intel/iwlwifi/fw/dbg.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@
6868
#include <linux/workqueue.h>
6969
#include <net/cfg80211.h>
7070
#include "runtime.h"
71+
#include "iwl-prph.h"
72+
#include "iwl-io.h"
7173
#include "file.h"
7274
#include "error-dump.h"
7375

@@ -194,8 +196,21 @@ _iwl_fw_dbg_trigger_simple_stop(struct iwl_fw_runtime *fwrt,
194196
iwl_fw_dbg_get_trigger((fwrt)->fw,\
195197
(trig)))
196198

199+
static inline void iwl_fw_dbg_stop_recording(struct iwl_fw_runtime *fwrt)
200+
{
201+
if (fwrt->trans->cfg->device_family == IWL_DEVICE_FAMILY_7000) {
202+
iwl_set_bits_prph(fwrt->trans, MON_BUFF_SAMPLE_CTL, 0x100);
203+
} else {
204+
iwl_write_prph(fwrt->trans, DBGC_IN_SAMPLE, 0);
205+
udelay(100);
206+
iwl_write_prph(fwrt->trans, DBGC_OUT_CTRL, 0);
207+
}
208+
}
209+
197210
static inline void iwl_fw_dump_conf_clear(struct iwl_fw_runtime *fwrt)
198211
{
212+
iwl_fw_dbg_stop_recording(fwrt);
213+
199214
fwrt->dump.conf = FW_DBG_INVALID;
200215
}
201216

0 commit comments

Comments
 (0)