summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn-ict.c
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2010-03-19 10:36:09 -0700
committerReinette Chatre <reinette.chatre@intel.com>2010-03-25 11:22:08 -0700
commit6e8cc38d5b05bb812f89a35bd9bf52405e67d0df (patch)
tree315cec6bbf580bdbc0e5c8dad06dfeb9da2313c5 /drivers/net/wireless/iwlwifi/iwl-agn-ict.c
parent6c69d121676761b2a85282df796af9c3f8c99b64 (diff)
downloadtalos-op-linux-6e8cc38d5b05bb812f89a35bd9bf52405e67d0df.tar.gz
talos-op-linux-6e8cc38d5b05bb812f89a35bd9bf52405e67d0df.zip
iwlwifi: change spin_lock to spin_lock_irqsave
Use spin_lock_irqsave() in interrupt handler to disable interrupts locally and provide the spinlock on SMP. This covers both interrupt and SMP concurrency. With this changes, also fix the sparse warning issues. Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Acked-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn-ict.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-ict.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-ict.c b/drivers/net/wireless/iwlwifi/iwl-agn-ict.c
index 4c5395eae956..a273e373b7b0 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-ict.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-ict.c
@@ -141,13 +141,14 @@ static irqreturn_t iwl_isr(int irq, void *data)
{
struct iwl_priv *priv = data;
u32 inta, inta_mask;
+ unsigned long flags;
#ifdef CONFIG_IWLWIFI_DEBUG
u32 inta_fh;
#endif
if (!priv)
return IRQ_NONE;
- spin_lock(&priv->lock);
+ spin_lock_irqsave(&priv->lock, flags);
/* Disable (but don't clear!) interrupts here to avoid
* back-to-back ISRs and sporadic interrupts from our NIC.
@@ -190,7 +191,7 @@ static irqreturn_t iwl_isr(int irq, void *data)
iwl_enable_interrupts(priv);
unplugged:
- spin_unlock(&priv->lock);
+ spin_unlock_irqrestore(&priv->lock, flags);
return IRQ_HANDLED;
none:
@@ -199,7 +200,7 @@ static irqreturn_t iwl_isr(int irq, void *data)
if (test_bit(STATUS_INT_ENABLED, &priv->status) && !priv->_agn.inta)
iwl_enable_interrupts(priv);
- spin_unlock(&priv->lock);
+ spin_unlock_irqrestore(&priv->lock, flags);
return IRQ_NONE;
}
@@ -216,6 +217,7 @@ irqreturn_t iwl_isr_ict(int irq, void *data)
struct iwl_priv *priv = data;
u32 inta, inta_mask;
u32 val = 0;
+ unsigned long flags;
if (!priv)
return IRQ_NONE;
@@ -226,7 +228,7 @@ irqreturn_t iwl_isr_ict(int irq, void *data)
if (!priv->_agn.use_ict)
return iwl_isr(irq, data);
- spin_lock(&priv->lock);
+ spin_lock_irqsave(&priv->lock, flags);
/* Disable (but don't clear!) interrupts here to avoid
* back-to-back ISRs and sporadic interrupts from our NIC.
@@ -290,7 +292,7 @@ irqreturn_t iwl_isr_ict(int irq, void *data)
iwl_enable_interrupts(priv);
}
- spin_unlock(&priv->lock);
+ spin_unlock_irqrestore(&priv->lock, flags);
return IRQ_HANDLED;
none:
@@ -300,6 +302,6 @@ irqreturn_t iwl_isr_ict(int irq, void *data)
if (test_bit(STATUS_INT_ENABLED, &priv->status) && !priv->_agn.inta)
iwl_enable_interrupts(priv);
- spin_unlock(&priv->lock);
+ spin_unlock_irqrestore(&priv->lock, flags);
return IRQ_NONE;
}
OpenPOWER on IntegriCloud