aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDongdong Deng <dongdong.deng@windriver.com>2009-09-16 12:10:47 -0400
committerDavid S. Miller <davem@davemloft.net>2009-09-16 23:49:47 -0400
commite99b1f04d922f132ffab8310b470bcc93d3ddf80 (patch)
tree608230959790644dd22c1e6f81c812d497169b09 /drivers
parent3933fc952a5a5af4cf23fca94e20203251c9d825 (diff)
b44: the poll handler b44_poll must not enable IRQ unconditionally
net/core/netpoll.c::netpoll_send_skb() calls the poll handler when it is available. As netconsole can be used from almost any context, IRQ must not be enabled blindly in the NAPI handler of the driver which supports netpoll. Call trace: netpoll_send_skb() { local_irq_save(flags) -> netpoll_poll() -> poll_napi() -> poll_one_napi() -> napi->poll() -> b44_poll() local_irq_restore(flags) } Signed-off-by: Dongdong Deng <dongdong.deng@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/b44.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/b44.c b/drivers/net/b44.c
index 0189dcd36f31..e046943ef29d 100644
--- a/drivers/net/b44.c
+++ b/drivers/net/b44.c
@@ -847,23 +847,22 @@ static int b44_poll(struct napi_struct *napi, int budget)
847{ 847{
848 struct b44 *bp = container_of(napi, struct b44, napi); 848 struct b44 *bp = container_of(napi, struct b44, napi);
849 int work_done; 849 int work_done;
850 unsigned long flags;
850 851
851 spin_lock_irq(&bp->lock); 852 spin_lock_irqsave(&bp->lock, flags);
852 853
853 if (bp->istat & (ISTAT_TX | ISTAT_TO)) { 854 if (bp->istat & (ISTAT_TX | ISTAT_TO)) {
854 /* spin_lock(&bp->tx_lock); */ 855 /* spin_lock(&bp->tx_lock); */
855 b44_tx(bp); 856 b44_tx(bp);
856 /* spin_unlock(&bp->tx_lock); */ 857 /* spin_unlock(&bp->tx_lock); */
857 } 858 }
858 spin_unlock_irq(&bp->lock); 859 spin_unlock_irqrestore(&bp->lock, flags);
859 860
860 work_done = 0; 861 work_done = 0;
861 if (bp->istat & ISTAT_RX) 862 if (bp->istat & ISTAT_RX)
862 work_done += b44_rx(bp, budget); 863 work_done += b44_rx(bp, budget);
863 864
864 if (bp->istat & ISTAT_ERRORS) { 865 if (bp->istat & ISTAT_ERRORS) {
865 unsigned long flags;
866
867 spin_lock_irqsave(&bp->lock, flags); 866 spin_lock_irqsave(&bp->lock, flags);
868 b44_halt(bp); 867 b44_halt(bp);
869 b44_init_rings(bp); 868 b44_init_rings(bp);