|
@@ -920,6 +920,8 @@ static int iwl_statistics_flag(struct iwl_priv *priv, char *buf, int bufsz)
|
|
|
int p = 0;
|
|
|
u32 flag;
|
|
|
|
|
|
+ lockdep_assert_held(&priv->statistics.lock);
|
|
|
+
|
|
|
flag = le32_to_cpu(priv->statistics.flag);
|
|
|
|
|
|
p += scnprintf(buf + p, bufsz - p, "Statistics Flag(0x%X):\n", flag);
|
|
@@ -967,6 +969,7 @@ static ssize_t iwl_dbgfs_ucode_rx_stats_read(struct file *file,
|
|
|
* the last statistics notification from uCode
|
|
|
* might not reflect the current uCode activity
|
|
|
*/
|
|
|
+ spin_lock_bh(&priv->statistics.lock);
|
|
|
ofdm = &priv->statistics.rx_ofdm;
|
|
|
cck = &priv->statistics.rx_cck;
|
|
|
general = &priv->statistics.rx_non_phy;
|
|
@@ -1363,6 +1366,8 @@ static ssize_t iwl_dbgfs_ucode_rx_stats_read(struct file *file,
|
|
|
accum_ht->unsupport_mcs,
|
|
|
delta_ht->unsupport_mcs, max_ht->unsupport_mcs);
|
|
|
|
|
|
+ spin_unlock_bh(&priv->statistics.lock);
|
|
|
+
|
|
|
ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
|
|
|
kfree(buf);
|
|
|
return ret;
|
|
@@ -1392,6 +1397,8 @@ static ssize_t iwl_dbgfs_ucode_tx_stats_read(struct file *file,
|
|
|
* the last statistics notification from uCode
|
|
|
* might not reflect the current uCode activity
|
|
|
*/
|
|
|
+ spin_lock_bh(&priv->statistics.lock);
|
|
|
+
|
|
|
tx = &priv->statistics.tx;
|
|
|
accum_tx = &priv->accum_stats.tx;
|
|
|
delta_tx = &priv->delta_stats.tx;
|
|
@@ -1554,6 +1561,9 @@ static ssize_t iwl_dbgfs_ucode_tx_stats_read(struct file *file,
|
|
|
fmt_hex, "antenna C:",
|
|
|
tx->tx_power.ant_c);
|
|
|
}
|
|
|
+
|
|
|
+ spin_unlock_bh(&priv->statistics.lock);
|
|
|
+
|
|
|
ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
|
|
|
kfree(buf);
|
|
|
return ret;
|
|
@@ -1586,6 +1596,9 @@ static ssize_t iwl_dbgfs_ucode_general_stats_read(struct file *file,
|
|
|
* the last statistics notification from uCode
|
|
|
* might not reflect the current uCode activity
|
|
|
*/
|
|
|
+
|
|
|
+ spin_lock_bh(&priv->statistics.lock);
|
|
|
+
|
|
|
general = &priv->statistics.common;
|
|
|
dbg = &priv->statistics.common.dbg;
|
|
|
div = &priv->statistics.common.div;
|
|
@@ -1670,6 +1683,9 @@ static ssize_t iwl_dbgfs_ucode_general_stats_read(struct file *file,
|
|
|
accum_general->num_of_sos_states,
|
|
|
delta_general->num_of_sos_states,
|
|
|
max_general->num_of_sos_states);
|
|
|
+
|
|
|
+ spin_unlock_bh(&priv->statistics.lock);
|
|
|
+
|
|
|
ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
|
|
|
kfree(buf);
|
|
|
return ret;
|
|
@@ -1713,6 +1729,9 @@ static ssize_t iwl_dbgfs_ucode_bt_stats_read(struct file *file,
|
|
|
* the last statistics notification from uCode
|
|
|
* might not reflect the current uCode activity
|
|
|
*/
|
|
|
+
|
|
|
+ spin_lock_bh(&priv->statistics.lock);
|
|
|
+
|
|
|
bt = &priv->statistics.bt_activity;
|
|
|
accum_bt = &priv->accum_stats.bt_activity;
|
|
|
|
|
@@ -1758,6 +1777,8 @@ static ssize_t iwl_dbgfs_ucode_bt_stats_read(struct file *file,
|
|
|
le32_to_cpu(priv->statistics.num_bt_kills),
|
|
|
priv->statistics.accum_num_bt_kills);
|
|
|
|
|
|
+ spin_unlock_bh(&priv->statistics.lock);
|
|
|
+
|
|
|
ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
|
|
|
kfree(buf);
|
|
|
return ret;
|