Commit 08ae86ac authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville
Browse files

iwlwifi: remove shared lock



Some data doesn't need protection, some of the
lock places are simply useless, and some data
can be protected with the mutex instead. Thus
the shared lock can be removed by making those
changes.

Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 4ff70fcd
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -63,12 +63,8 @@
/* NIC configuration for 5000 series */
static void iwl5000_nic_config(struct iwl_priv *priv)
{
	unsigned long flags;

	iwl_rf_config(priv);

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

	/* W/A : NIC is stuck in a reset state after Early PCIe power off
	 * (PCIe power is lost before PERST# is asserted),
	 * causing ME FW to lose ownership and not being able to obtain it back.
@@ -76,9 +72,6 @@ static void iwl5000_nic_config(struct iwl_priv *priv)
	iwl_set_bits_mask_prph(trans(priv), APMG_PS_CTRL_REG,
				APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS,
				~APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS);


	spin_unlock_irqrestore(&priv->shrd->lock, flags);
}

static struct iwl_sensitivity_ranges iwl5000_sensitivity = {
+0 −3
Original line number Diff line number Diff line
@@ -710,7 +710,6 @@ int iwlagn_bt_coex_profile_notif(struct iwl_priv *priv,
				  struct iwl_rx_mem_buffer *rxb,
				  struct iwl_device_cmd *cmd)
{
	unsigned long flags;
	struct iwl_rx_packet *pkt = rxb_addr(rxb);
	struct iwl_bt_coex_profile_notif *coex = &pkt->u.bt_coex_profile_notif;
	struct iwl_bt_uart_msg *uart_msg = &coex->last_bt_uart_msg;
@@ -756,9 +755,7 @@ int iwlagn_bt_coex_profile_notif(struct iwl_priv *priv,

	/* FIXME: based on notification, adjust the prio_boost */

	spin_lock_irqsave(&priv->shrd->lock, flags);
	priv->bt_ci_compliance = coex->bt_ci_compliance;
	spin_unlock_irqrestore(&priv->shrd->lock, flags);
	return 0;
}

+0 −3
Original line number Diff line number Diff line
@@ -870,19 +870,16 @@ static void rs_bt_update_lq(struct iwl_priv *priv, struct iwl_rxon_context *ctx,
{
	struct iwl_scale_tbl_info *tbl;
	bool full_concurrent = priv->bt_full_concurrent;
	unsigned long flags;

	if (priv->bt_ant_couple_ok) {
		/*
		 * Is there a need to switch between
		 * full concurrency and 3-wire?
		 */
		spin_lock_irqsave(&priv->shrd->lock, flags);
		if (priv->bt_ci_compliance && priv->bt_ant_couple_ok)
			full_concurrent = true;
		else
			full_concurrent = false;
		spin_unlock_irqrestore(&priv->shrd->lock, flags);
	}
	if ((priv->bt_traffic_load != priv->last_bt_traffic_load) ||
	    (priv->bt_full_concurrent != full_concurrent)) {
+0 −6
Original line number Diff line number Diff line
@@ -590,8 +590,6 @@ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed)
	}

	if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
		unsigned long flags;

		ch_info = iwl_get_channel_info(priv, channel->band,
					       channel->hw_value);
		if (!is_channel_valid(ch_info)) {
@@ -600,8 +598,6 @@ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed)
			goto out;
		}

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

		for_each_context(priv, ctx) {
			/* Configure HT40 channels */
			if (ctx->ht.enabled != conf_is_ht(conf))
@@ -636,8 +632,6 @@ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed)
					       ctx->vif);
		}

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

		iwl_update_bcast_stations(priv);

		/*
+0 −9
Original line number Diff line number Diff line
@@ -259,18 +259,15 @@ int iwlagn_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
	struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
	struct iwl_device_cmd *dev_cmd = NULL;
	struct iwl_tx_cmd *tx_cmd;

	__le16 fc;
	u8 hdr_len;
	u16 len, seq_number = 0;
	u8 sta_id, tid = IWL_MAX_TID_COUNT;
	unsigned long flags;
	bool is_agg = false;

	if (info->control.vif)
		ctx = iwl_rxon_ctx_from_vif(info->control.vif);

	spin_lock_irqsave(&priv->shrd->lock, flags);
	if (iwl_is_rfkill(priv->shrd)) {
		IWL_DEBUG_DROP(priv, "Dropping - RF KILL\n");
		goto drop_unlock_priv;
@@ -369,7 +366,6 @@ int iwlagn_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
	info->driver_data[0] = ctx;
	info->driver_data[1] = dev_cmd;

	/* irqs already disabled/saved above when locking priv->shrd->lock */
	spin_lock(&priv->sta_lock);

	if (ieee80211_is_data_qos(fc) && !ieee80211_is_qos_nullfunc(fc)) {
@@ -418,7 +414,6 @@ int iwlagn_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
		priv->tid_data[sta_id][tid].seq_number = seq_number;

	spin_unlock(&priv->sta_lock);
	spin_unlock_irqrestore(&priv->shrd->lock, flags);

	/*
	 * Avoid atomic ops if it isn't an associated client.
@@ -437,7 +432,6 @@ int iwlagn_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
		kmem_cache_free(priv->tx_cmd_pool, dev_cmd);
	spin_unlock(&priv->sta_lock);
drop_unlock_priv:
	spin_unlock_irqrestore(&priv->shrd->lock, flags);
	return -1;
}

@@ -445,7 +439,6 @@ int iwlagn_tx_agg_stop(struct iwl_priv *priv, struct ieee80211_vif *vif,
			struct ieee80211_sta *sta, u16 tid)
{
	struct iwl_tid_data *tid_data;
	unsigned long flags;
	int sta_id;

	sta_id = iwl_sta_id(sta);
@@ -500,9 +493,7 @@ int iwlagn_tx_agg_stop(struct iwl_priv *priv, struct ieee80211_vif *vif,

	spin_unlock_bh(&priv->sta_lock);

	spin_lock_irqsave(&priv->shrd->lock, flags);
	iwl_trans_tx_agg_disable(trans(priv), sta_id, tid);
	spin_unlock_irqrestore(&priv->shrd->lock, flags);

	ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid);

Loading