aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-debugfs.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-01-13 05:56:11 -0500
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2012-01-28 11:08:13 -0500
commit98d4bf0c49de0d7c68fa7e1f7bd0a37420f712ca (patch)
treea90739756b6ec6e1f82d86bdf218ad69ef200ecd /drivers/net/wireless/iwlwifi/iwl-debugfs.c
parentde46fb079ff16fabb3bdf7892c9a2900a9880329 (diff)
iwlwifi: fix uCode event tracing
Fix multiple bugs in event tracing: 1) If you enable uCode tracing with the device down, it will still attempt to access the device and continuously log "MAC is in deep sleep!" errors. Fix this by only starting logging when the device is actually alive. 2) Now you can set the flag when the device is down, but logging doesn't happen when you bring it up. To fix that, start logging when the device comes alive. This means we don't log before -- we could do that but I don't need it right now. 3) For some reason we read the error instead of the event log -- use the right pointer. 4) Optimise SRAM reading of event log header. 5) Fix reading write pointer == capacity, which can happen due to racy SRAM access 6) Most importantly: fix an error where we would try to read WAY too many events (like 2^32-300) when we read the wrap counter before it is updated by the uCode -- this does happen in practice and will cause the driver to hang the machine. 7) Finally, change the timer to 10ms instead of 100ms as 100ms is too slow to capture all data with a normal event log and with 100ms the log will wrap multiple times before we have a chance to read it. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-debugfs.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debugfs.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index f837f32bb71c..978a1d4c6a0a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -2131,9 +2131,10 @@ static ssize_t iwl_dbgfs_ucode_tracing_write(struct file *file,
2131 2131
2132 if (trace) { 2132 if (trace) {
2133 priv->event_log.ucode_trace = true; 2133 priv->event_log.ucode_trace = true;
2134 /* schedule the ucode timer to occur in UCODE_TRACE_PERIOD */ 2134 if (iwl_is_alive(priv->shrd)) {
2135 mod_timer(&priv->ucode_trace, 2135 /* start collecting data now */
2136 jiffies + msecs_to_jiffies(UCODE_TRACE_PERIOD)); 2136 mod_timer(&priv->ucode_trace, jiffies);
2137 }
2137 } else { 2138 } else {
2138 priv->event_log.ucode_trace = false; 2139 priv->event_log.ucode_trace = false;
2139 del_timer_sync(&priv->ucode_trace); 2140 del_timer_sync(&priv->ucode_trace);