diff options
author | Tim Gardner <tim.gardner@canonical.com> | 2010-06-08 13:33:02 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-06-15 15:44:41 -0400 |
commit | d6a574ff6bfb842bdb98065da053881ff527be46 (patch) | |
tree | 899cdc5cdfc75d21a8c258ecfc2bc6b1e1c79895 /drivers/net/wireless/hostap/hostap_hw.c | |
parent | a69b03e941abae00380fc6bc1877fb797a1b31e6 (diff) |
hostap: Protect against initialization interrupt
Use an irq spinlock to hold off the IRQ handler until
enough early card init is complete such that the handler
can run without faulting.
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/hostap/hostap_hw.c')
-rw-r--r-- | drivers/net/wireless/hostap/hostap_hw.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c index ff9b5c882184..2f999fc94f60 100644 --- a/drivers/net/wireless/hostap/hostap_hw.c +++ b/drivers/net/wireless/hostap/hostap_hw.c | |||
@@ -2621,6 +2621,18 @@ static irqreturn_t prism2_interrupt(int irq, void *dev_id) | |||
2621 | iface = netdev_priv(dev); | 2621 | iface = netdev_priv(dev); |
2622 | local = iface->local; | 2622 | local = iface->local; |
2623 | 2623 | ||
2624 | /* Detect early interrupt before driver is fully configued */ | ||
2625 | spin_lock(&local->irq_init_lock); | ||
2626 | if (!dev->base_addr) { | ||
2627 | if (net_ratelimit()) { | ||
2628 | printk(KERN_DEBUG "%s: Interrupt, but dev not configured\n", | ||
2629 | dev->name); | ||
2630 | } | ||
2631 | spin_unlock(&local->irq_init_lock); | ||
2632 | return IRQ_HANDLED; | ||
2633 | } | ||
2634 | spin_unlock(&local->irq_init_lock); | ||
2635 | |||
2624 | prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_INTERRUPT, 0, 0); | 2636 | prism2_io_debug_add(dev, PRISM2_IO_DEBUG_CMD_INTERRUPT, 0, 0); |
2625 | 2637 | ||
2626 | if (local->func->card_present && !local->func->card_present(local)) { | 2638 | if (local->func->card_present && !local->func->card_present(local)) { |
@@ -3138,6 +3150,7 @@ prism2_init_local_data(struct prism2_helper_functions *funcs, int card_idx, | |||
3138 | spin_lock_init(&local->cmdlock); | 3150 | spin_lock_init(&local->cmdlock); |
3139 | spin_lock_init(&local->baplock); | 3151 | spin_lock_init(&local->baplock); |
3140 | spin_lock_init(&local->lock); | 3152 | spin_lock_init(&local->lock); |
3153 | spin_lock_init(&local->irq_init_lock); | ||
3141 | mutex_init(&local->rid_bap_mtx); | 3154 | mutex_init(&local->rid_bap_mtx); |
3142 | 3155 | ||
3143 | if (card_idx < 0 || card_idx >= MAX_PARM_DEVICES) | 3156 | if (card_idx < 0 || card_idx >= MAX_PARM_DEVICES) |