Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 291174
b: refs/heads/master
c: 4ff70fc
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Mar 6, 2012
1 parent b4c2bbd commit d551a8e
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fa23cb04b38a9950b21ee756e4419a737d496371
refs/heads/master: 4ff70fcdf3c424c3fdca253e7b7556f77eaf39be
16 changes: 7 additions & 9 deletions trunk/drivers/net/wireless/iwlwifi/iwl-agn-calib.c
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,6 @@ void iwl_sensitivity_calibration(struct iwl_priv *priv)
struct iwl_sensitivity_data *data = NULL;
struct statistics_rx_non_phy *rx_info;
struct statistics_rx_phy *ofdm, *cck;
unsigned long flags;
struct statistics_general_data statis;

if (priv->disable_sens_cal)
Expand All @@ -668,13 +667,13 @@ void iwl_sensitivity_calibration(struct iwl_priv *priv)
return;
}

spin_lock_irqsave(&priv->shrd->lock, flags);
spin_lock_bh(&priv->statistics.lock);
rx_info = &priv->statistics.rx_non_phy;
ofdm = &priv->statistics.rx_ofdm;
cck = &priv->statistics.rx_cck;
if (rx_info->interference_data_flag != INTERFERENCE_DATA_AVAILABLE) {
IWL_DEBUG_CALIB(priv, "<< invalid data.\n");
spin_unlock_irqrestore(&priv->shrd->lock, flags);
spin_unlock_bh(&priv->statistics.lock);
return;
}

Expand All @@ -698,7 +697,7 @@ void iwl_sensitivity_calibration(struct iwl_priv *priv)
statis.beacon_energy_c =
le32_to_cpu(rx_info->beacon_energy_c);

spin_unlock_irqrestore(&priv->shrd->lock, flags);
spin_unlock_bh(&priv->statistics.lock);

IWL_DEBUG_CALIB(priv, "rx_enable_time = %u usecs\n", rx_enable_time);

Expand Down Expand Up @@ -958,7 +957,6 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv)
u16 stat_chnum = INITIALIZATION_VALUE;
u8 rxon_band24;
u8 stat_band24;
unsigned long flags;
struct statistics_rx_non_phy *rx_info;

/*
Expand All @@ -983,13 +981,13 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv)
return;
}

spin_lock_irqsave(&priv->shrd->lock, flags);
spin_lock_bh(&priv->statistics.lock);

rx_info = &priv->statistics.rx_non_phy;

if (rx_info->interference_data_flag != INTERFERENCE_DATA_AVAILABLE) {
IWL_DEBUG_CALIB(priv, " << Interference data unavailable\n");
spin_unlock_irqrestore(&priv->shrd->lock, flags);
spin_unlock_bh(&priv->statistics.lock);
return;
}

Expand All @@ -1004,7 +1002,7 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv)
if ((rxon_chnum != stat_chnum) || (rxon_band24 != stat_band24)) {
IWL_DEBUG_CALIB(priv, "Stats not from chan=%d, band24=%d\n",
rxon_chnum, rxon_band24);
spin_unlock_irqrestore(&priv->shrd->lock, flags);
spin_unlock_bh(&priv->statistics.lock);
return;
}

Expand All @@ -1023,7 +1021,7 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv)
chain_sig_b = le32_to_cpu(rx_info->beacon_rssi_b) & IN_BAND_FILTER;
chain_sig_c = le32_to_cpu(rx_info->beacon_rssi_c) & IN_BAND_FILTER;

spin_unlock_irqrestore(&priv->shrd->lock, flags);
spin_unlock_bh(&priv->statistics.lock);

data->beacon_count++;

Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ int iwlagn_send_tx_power(struct iwl_priv *priv)

void iwlagn_temperature(struct iwl_priv *priv)
{
lockdep_assert_held(&priv->statistics.lock);

/* store temperature from correct statistics (in Celsius) */
priv->temperature = le32_to_cpu(priv->statistics.common.temperature);
iwl_tt_handler(priv);
Expand Down
8 changes: 8 additions & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-agn-rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ static bool iwlagn_good_ack_health(struct iwl_priv *priv,
if (priv->agg_tids_count)
return true;

lockdep_assert_held(&priv->statistics.lock);

old = &priv->statistics.tx;

actual_delta = le32_to_cpu(cur->actual_ack_cnt) -
Expand Down Expand Up @@ -509,6 +511,8 @@ static int iwlagn_rx_statistics(struct iwl_priv *priv,
IWL_DEBUG_RX(priv, "Statistics notification received (%d bytes).\n",
len);

spin_lock(&priv->statistics.lock);

if (len == sizeof(struct iwl_bt_notif_statistics)) {
struct iwl_bt_notif_statistics *stats;
stats = &pkt->u.stats_bt;
Expand Down Expand Up @@ -542,6 +546,7 @@ static int iwlagn_rx_statistics(struct iwl_priv *priv,
WARN_ONCE(1, "len %d doesn't match BT (%zu) or normal (%zu)\n",
len, sizeof(struct iwl_bt_notif_statistics),
sizeof(struct iwl_notif_statistics));
spin_unlock(&priv->statistics.lock);
return 0;
}

Expand Down Expand Up @@ -585,6 +590,9 @@ static int iwlagn_rx_statistics(struct iwl_priv *priv,
}
if (cfg(priv)->lib->temperature && change)
cfg(priv)->lib->temperature(priv);

spin_unlock(&priv->statistics.lock);

return 0;
}

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-agn.c
Original file line number Diff line number Diff line change
Expand Up @@ -1233,6 +1233,7 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans)
*/
spin_lock_init(&trans(priv)->reg_lock);
spin_lock_init(&priv->shrd->lock);
spin_lock_init(&priv->statistics.lock);

/***********************
* 3. Read REV register
Expand Down
21 changes: 21 additions & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/iwlwifi/iwl-dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,7 @@ struct iwl_priv {
struct statistics_bt_activity bt_activity;
__le32 num_bt_kills, accum_num_bt_kills;
#endif
spinlock_t lock;
} statistics;
#ifdef CONFIG_IWLWIFI_DEBUGFS
struct {
Expand Down

0 comments on commit d551a8e

Please sign in to comment.