iwlwifi: add debugfs to control stuck queue timer
In current implementation, stuck queue timer is fixed to 1 second. Add debugfs file to modify the timer to enhance the flexibility: Set the monitor_period as following: 0: disable stuck queue force reset function 1 - 60000: monitor period (1 - 60 second) Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
c6c996b5de
commit
7bdc473c7a
3 changed files with 39 additions and 6 deletions
|
@ -2697,12 +2697,14 @@ void iwl_bg_monitor_recover(unsigned long data)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
if (priv->cfg->monitor_recover_period) {
|
||||||
* Reschedule the timer to occur in
|
/*
|
||||||
* priv->cfg->monitor_recover_period
|
* Reschedule the timer to occur in
|
||||||
*/
|
* priv->cfg->monitor_recover_period
|
||||||
mod_timer(&priv->monitor_recover,
|
*/
|
||||||
jiffies + msecs_to_jiffies(priv->cfg->monitor_recover_period));
|
mod_timer(&priv->monitor_recover, jiffies + msecs_to_jiffies(
|
||||||
|
priv->cfg->monitor_recover_period));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(iwl_bg_monitor_recover);
|
EXPORT_SYMBOL(iwl_bg_monitor_recover);
|
||||||
|
|
||||||
|
|
|
@ -1527,6 +1527,34 @@ static ssize_t iwl_dbgfs_ucode_bt_stats_read(struct file *file,
|
||||||
user_buf, count, ppos);
|
user_buf, count, ppos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static ssize_t iwl_dbgfs_monitor_period_write(struct file *file,
|
||||||
|
const char __user *user_buf,
|
||||||
|
size_t count, loff_t *ppos) {
|
||||||
|
|
||||||
|
struct iwl_priv *priv = file->private_data;
|
||||||
|
char buf[8];
|
||||||
|
int buf_size;
|
||||||
|
int period;
|
||||||
|
|
||||||
|
memset(buf, 0, sizeof(buf));
|
||||||
|
buf_size = min(count, sizeof(buf) - 1);
|
||||||
|
if (copy_from_user(buf, user_buf, buf_size))
|
||||||
|
return -EFAULT;
|
||||||
|
if (sscanf(buf, "%d", &period) != 1)
|
||||||
|
return -EINVAL;
|
||||||
|
if (period < 0 || period > IWL_MAX_MONITORING_PERIOD)
|
||||||
|
priv->cfg->monitor_recover_period = IWL_DEF_MONITORING_PERIOD;
|
||||||
|
else
|
||||||
|
priv->cfg->monitor_recover_period = period;
|
||||||
|
|
||||||
|
if (priv->cfg->monitor_recover_period)
|
||||||
|
mod_timer(&priv->monitor_recover, jiffies + msecs_to_jiffies(
|
||||||
|
priv->cfg->monitor_recover_period));
|
||||||
|
else
|
||||||
|
del_timer_sync(&priv->monitor_recover);
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
DEBUGFS_READ_FILE_OPS(rx_statistics);
|
DEBUGFS_READ_FILE_OPS(rx_statistics);
|
||||||
DEBUGFS_READ_FILE_OPS(tx_statistics);
|
DEBUGFS_READ_FILE_OPS(tx_statistics);
|
||||||
DEBUGFS_READ_WRITE_FILE_OPS(traffic_log);
|
DEBUGFS_READ_WRITE_FILE_OPS(traffic_log);
|
||||||
|
@ -1550,6 +1578,7 @@ DEBUGFS_READ_FILE_OPS(rxon_flags);
|
||||||
DEBUGFS_READ_FILE_OPS(rxon_filter_flags);
|
DEBUGFS_READ_FILE_OPS(rxon_filter_flags);
|
||||||
DEBUGFS_WRITE_FILE_OPS(txfifo_flush);
|
DEBUGFS_WRITE_FILE_OPS(txfifo_flush);
|
||||||
DEBUGFS_READ_FILE_OPS(ucode_bt_stats);
|
DEBUGFS_READ_FILE_OPS(ucode_bt_stats);
|
||||||
|
DEBUGFS_WRITE_FILE_OPS(monitor_period);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create the debugfs files and directories
|
* Create the debugfs files and directories
|
||||||
|
@ -1621,6 +1650,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
|
||||||
DEBUGFS_ADD_FILE(ucode_bt_stats, dir_debug, S_IRUSR);
|
DEBUGFS_ADD_FILE(ucode_bt_stats, dir_debug, S_IRUSR);
|
||||||
DEBUGFS_ADD_FILE(rxon_flags, dir_debug, S_IWUSR);
|
DEBUGFS_ADD_FILE(rxon_flags, dir_debug, S_IWUSR);
|
||||||
DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR);
|
DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR);
|
||||||
|
DEBUGFS_ADD_FILE(monitor_period, dir_debug, S_IWUSR);
|
||||||
if (priv->cfg->sensitivity_calib_by_driver)
|
if (priv->cfg->sensitivity_calib_by_driver)
|
||||||
DEBUGFS_ADD_BOOL(disable_sensitivity, dir_rf,
|
DEBUGFS_ADD_BOOL(disable_sensitivity, dir_rf,
|
||||||
&priv->disable_sens_cal);
|
&priv->disable_sens_cal);
|
||||||
|
|
|
@ -1064,6 +1064,7 @@ struct iwl_event_log {
|
||||||
#define IWL_DEF_MONITORING_PERIOD (1000)
|
#define IWL_DEF_MONITORING_PERIOD (1000)
|
||||||
#define IWL_LONG_MONITORING_PERIOD (5000)
|
#define IWL_LONG_MONITORING_PERIOD (5000)
|
||||||
#define IWL_ONE_HUNDRED_MSECS (100)
|
#define IWL_ONE_HUNDRED_MSECS (100)
|
||||||
|
#define IWL_MAX_MONITORING_PERIOD (60000)
|
||||||
|
|
||||||
/* BT Antenna Coupling Threshold (dB) */
|
/* BT Antenna Coupling Threshold (dB) */
|
||||||
#define IWL_BT_ANTENNA_COUPLING_THRESHOLD (35)
|
#define IWL_BT_ANTENNA_COUPLING_THRESHOLD (35)
|
||||||
|
|
Loading…
Add table
Reference in a new issue