diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2010-03-19 13:36:09 -0400 |
---|---|---|
committer | Reinette Chatre <reinette.chatre@intel.com> | 2010-03-25 14:22:08 -0400 |
commit | 6e8cc38d5b05bb812f89a35bd9bf52405e67d0df (patch) | |
tree | 315cec6bbf580bdbc0e5c8dad06dfeb9da2313c5 /drivers/net | |
parent | 6c69d121676761b2a85282df796af9c3f8c99b64 (diff) |
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')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-ict.c | 14 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 7 |
2 files changed, 12 insertions, 9 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) | |||
141 | { | 141 | { |
142 | struct iwl_priv *priv = data; | 142 | struct iwl_priv *priv = data; |
143 | u32 inta, inta_mask; | 143 | u32 inta, inta_mask; |
144 | unsigned long flags; | ||
144 | #ifdef CONFIG_IWLWIFI_DEBUG | 145 | #ifdef CONFIG_IWLWIFI_DEBUG |
145 | u32 inta_fh; | 146 | u32 inta_fh; |
146 | #endif | 147 | #endif |
147 | if (!priv) | 148 | if (!priv) |
148 | return IRQ_NONE; | 149 | return IRQ_NONE; |
149 | 150 | ||
150 | spin_lock(&priv->lock); | 151 | spin_lock_irqsave(&priv->lock, flags); |
151 | 152 | ||
152 | /* Disable (but don't clear!) interrupts here to avoid | 153 | /* Disable (but don't clear!) interrupts here to avoid |
153 | * back-to-back ISRs and sporadic interrupts from our NIC. | 154 | * back-to-back ISRs and sporadic interrupts from our NIC. |
@@ -190,7 +191,7 @@ static irqreturn_t iwl_isr(int irq, void *data) | |||
190 | iwl_enable_interrupts(priv); | 191 | iwl_enable_interrupts(priv); |
191 | 192 | ||
192 | unplugged: | 193 | unplugged: |
193 | spin_unlock(&priv->lock); | 194 | spin_unlock_irqrestore(&priv->lock, flags); |
194 | return IRQ_HANDLED; | 195 | return IRQ_HANDLED; |
195 | 196 | ||
196 | none: | 197 | none: |
@@ -199,7 +200,7 @@ static irqreturn_t iwl_isr(int irq, void *data) | |||
199 | if (test_bit(STATUS_INT_ENABLED, &priv->status) && !priv->_agn.inta) | 200 | if (test_bit(STATUS_INT_ENABLED, &priv->status) && !priv->_agn.inta) |
200 | iwl_enable_interrupts(priv); | 201 | iwl_enable_interrupts(priv); |
201 | 202 | ||
202 | spin_unlock(&priv->lock); | 203 | spin_unlock_irqrestore(&priv->lock, flags); |
203 | return IRQ_NONE; | 204 | return IRQ_NONE; |
204 | } | 205 | } |
205 | 206 | ||
@@ -216,6 +217,7 @@ irqreturn_t iwl_isr_ict(int irq, void *data) | |||
216 | struct iwl_priv *priv = data; | 217 | struct iwl_priv *priv = data; |
217 | u32 inta, inta_mask; | 218 | u32 inta, inta_mask; |
218 | u32 val = 0; | 219 | u32 val = 0; |
220 | unsigned long flags; | ||
219 | 221 | ||
220 | if (!priv) | 222 | if (!priv) |
221 | return IRQ_NONE; | 223 | return IRQ_NONE; |
@@ -226,7 +228,7 @@ irqreturn_t iwl_isr_ict(int irq, void *data) | |||
226 | if (!priv->_agn.use_ict) | 228 | if (!priv->_agn.use_ict) |
227 | return iwl_isr(irq, data); | 229 | return iwl_isr(irq, data); |
228 | 230 | ||
229 | spin_lock(&priv->lock); | 231 | spin_lock_irqsave(&priv->lock, flags); |
230 | 232 | ||
231 | /* Disable (but don't clear!) interrupts here to avoid | 233 | /* Disable (but don't clear!) interrupts here to avoid |
232 | * back-to-back ISRs and sporadic interrupts from our NIC. | 234 | * back-to-back ISRs and sporadic interrupts from our NIC. |
@@ -290,7 +292,7 @@ irqreturn_t iwl_isr_ict(int irq, void *data) | |||
290 | iwl_enable_interrupts(priv); | 292 | iwl_enable_interrupts(priv); |
291 | } | 293 | } |
292 | 294 | ||
293 | spin_unlock(&priv->lock); | 295 | spin_unlock_irqrestore(&priv->lock, flags); |
294 | return IRQ_HANDLED; | 296 | return IRQ_HANDLED; |
295 | 297 | ||
296 | none: | 298 | none: |
@@ -300,6 +302,6 @@ irqreturn_t iwl_isr_ict(int irq, void *data) | |||
300 | if (test_bit(STATUS_INT_ENABLED, &priv->status) && !priv->_agn.inta) | 302 | if (test_bit(STATUS_INT_ENABLED, &priv->status) && !priv->_agn.inta) |
301 | iwl_enable_interrupts(priv); | 303 | iwl_enable_interrupts(priv); |
302 | 304 | ||
303 | spin_unlock(&priv->lock); | 305 | spin_unlock_irqrestore(&priv->lock, flags); |
304 | return IRQ_NONE; | 306 | return IRQ_NONE; |
305 | } | 307 | } |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index d152198f144c..9e4835240815 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -1531,10 +1531,11 @@ irqreturn_t iwl_isr_legacy(int irq, void *data) | |||
1531 | struct iwl_priv *priv = data; | 1531 | struct iwl_priv *priv = data; |
1532 | u32 inta, inta_mask; | 1532 | u32 inta, inta_mask; |
1533 | u32 inta_fh; | 1533 | u32 inta_fh; |
1534 | unsigned long flags; | ||
1534 | if (!priv) | 1535 | if (!priv) |
1535 | return IRQ_NONE; | 1536 | return IRQ_NONE; |
1536 | 1537 | ||
1537 | spin_lock(&priv->lock); | 1538 | spin_lock_irqsave(&priv->lock, flags); |
1538 | 1539 | ||
1539 | /* Disable (but don't clear!) interrupts here to avoid | 1540 | /* Disable (but don't clear!) interrupts here to avoid |
1540 | * back-to-back ISRs and sporadic interrupts from our NIC. | 1541 | * back-to-back ISRs and sporadic interrupts from our NIC. |
@@ -1572,7 +1573,7 @@ irqreturn_t iwl_isr_legacy(int irq, void *data) | |||
1572 | tasklet_schedule(&priv->irq_tasklet); | 1573 | tasklet_schedule(&priv->irq_tasklet); |
1573 | 1574 | ||
1574 | unplugged: | 1575 | unplugged: |
1575 | spin_unlock(&priv->lock); | 1576 | spin_unlock_irqrestore(&priv->lock, flags); |
1576 | return IRQ_HANDLED; | 1577 | return IRQ_HANDLED; |
1577 | 1578 | ||
1578 | none: | 1579 | none: |
@@ -1580,7 +1581,7 @@ irqreturn_t iwl_isr_legacy(int irq, void *data) | |||
1580 | /* only Re-enable if diabled by irq */ | 1581 | /* only Re-enable if diabled by irq */ |
1581 | if (test_bit(STATUS_INT_ENABLED, &priv->status)) | 1582 | if (test_bit(STATUS_INT_ENABLED, &priv->status)) |
1582 | iwl_enable_interrupts(priv); | 1583 | iwl_enable_interrupts(priv); |
1583 | spin_unlock(&priv->lock); | 1584 | spin_unlock_irqrestore(&priv->lock, flags); |
1584 | return IRQ_NONE; | 1585 | return IRQ_NONE; |
1585 | } | 1586 | } |
1586 | EXPORT_SYMBOL(iwl_isr_legacy); | 1587 | EXPORT_SYMBOL(iwl_isr_legacy); |