summaryrefslogtreecommitdiff
path: root/drivers/staging/cw1200/sta.c
diff options
context:
space:
mode:
authorDmitry Tarnyagin <dmitry.tarnyagin@stericsson.com>2011-05-19 22:47:37 +0200
committerRobert Marklund <robert.marklund@stericsson.com>2011-10-05 12:12:26 +0200
commit7c399d9287d00678a9641a46ee3af2be848c9f81 (patch)
tree922ad095f22c47a8c4272bc0cb1991e653420268 /drivers/staging/cw1200/sta.c
parentfef8d948aaadb68b76093a2477967a4218c57dbd (diff)
cw1200: Spin lock usage review.
Expensive spin_lock_irqsave calls are replaced by more adequate spin_lock / spin_lock_bh. Locking strategy: queue: spin_lock_bh event_queue: spin_lock tx_policy: spin_lock_bh wsm_cmd: spin_lock sdio handlers: spin_lock_irqsave Signed-off-by: Dmitry Tarnyagin <dmitry.tarnyagin@stericsson.com> Change-Id: I3a13ef337ac125c0533de00651e54a4b4a45ba16 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/23603 Reviewed-by: Bartosz MARKOWSKI <bartosz.markowski@tieto.com> Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com>
Diffstat (limited to 'drivers/staging/cw1200/sta.c')
-rw-r--r--drivers/staging/cw1200/sta.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/staging/cw1200/sta.c b/drivers/staging/cw1200/sta.c
index 9a99f032d3f..6cebf530f40 100644
--- a/drivers/staging/cw1200/sta.c
+++ b/drivers/staging/cw1200/sta.c
@@ -80,7 +80,6 @@ out:
void cw1200_stop(struct ieee80211_hw *dev)
{
struct cw1200_common *priv = dev->priv;
- unsigned long flags;
LIST_HEAD(list);
int i;
@@ -132,9 +131,9 @@ void cw1200_stop(struct ieee80211_hw *dev)
priv->softled_state = 0;
/* cw1200_set_leds(priv); */
- spin_lock_irqsave(&priv->event_queue_lock, flags);
+ spin_lock(&priv->event_queue_lock);
list_splice_init(&priv->event_queue, &list);
- spin_unlock_irqrestore(&priv->event_queue_lock, flags);
+ spin_unlock(&priv->event_queue_lock);
__cw1200_free_event_queue(&list);
priv->delayed_link_loss = 0;
@@ -294,18 +293,17 @@ int cw1200_config(struct ieee80211_hw *dev, u32 changed)
}
if (changed & IEEE80211_CONF_CHANGE_RETRY_LIMITS) {
- unsigned long flags;
sta_printk(KERN_DEBUG "[STA] Retry limits: %d (long), " \
"%d (short).\n",
conf->long_frame_max_tx_count,
conf->short_frame_max_tx_count);
- spin_lock_irqsave(&priv->tx_policy_cache.lock, flags);
+ spin_lock_bh(&priv->tx_policy_cache.lock);
priv->long_frame_max_tx_count = conf->long_frame_max_tx_count;
priv->short_frame_max_tx_count =
(conf->short_frame_max_tx_count < 0x0F) ?
conf->short_frame_max_tx_count : 0x0F;
priv->hw->max_rate_tries = priv->short_frame_max_tx_count;
- spin_unlock_irqrestore(&priv->tx_policy_cache.lock, flags);
+ spin_unlock_bh(&priv->tx_policy_cache.lock);
/* TBD: I think we don't need tx_policy_force_upload().
* Outdated policies will leave cache in a normal way. */
/* WARN_ON(tx_policy_force_upload(priv)); */
@@ -634,27 +632,25 @@ void cw1200_rx_cb(struct cw1200_common *priv,
void cw1200_free_event_queue(struct cw1200_common *priv)
{
- unsigned long flags;
LIST_HEAD(list);
- spin_lock_irqsave(&priv->event_queue_lock, flags);
+ spin_lock(&priv->event_queue_lock);
list_splice_init(&priv->event_queue, &list);
- spin_unlock_irqrestore(&priv->event_queue_lock, flags);
+ spin_unlock(&priv->event_queue_lock);
__cw1200_free_event_queue(&list);
}
void cw1200_event_handler(struct work_struct *work)
{
- unsigned long flags;
struct cw1200_common *priv =
container_of(work, struct cw1200_common, event_handler);
struct cw1200_wsm_event *event;
LIST_HEAD(list);
- spin_lock_irqsave(&priv->event_queue_lock, flags);
+ spin_lock(&priv->event_queue_lock);
list_splice_init(&priv->event_queue, &list);
- spin_unlock_irqrestore(&priv->event_queue_lock, flags);
+ spin_unlock(&priv->event_queue_lock);
list_for_each_entry(event, &list, link) {
switch (event->evt.eventId) {