aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/fec.c
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2009-09-01 19:14:16 -0400
committerDavid S. Miller <davem@davemloft.net>2009-09-03 02:46:06 -0400
commit81538e74ca12a71ea37ce72f809ebc65a90b9538 (patch)
tree5c390159ef7d0605f6b8e65fa0b77661af77ede1 /drivers/net/fec.c
parent84177a20799072c65a69b62571660d4d9780823c (diff)
fec: don't enable irqs in hard irq context
fec_enet_mii, fec_enet_rx and fec_enet_tx are both only called by fec_enet_interrupt in interrupt context. So they must not use spin_lock_irq/spin_unlock_irq. This fixes: WARNING: at kernel/lockdep.c:2140 trace_hardirqs_on_caller+0x130/0x194() ... Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Cc: Greg Ungerer <gerg@uclinux.org> Cc: Ben Hutchings <ben@decadent.org.uk> Cc: Patrick McHardy <kaber@trash.net> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: Matt Waddel <Matt.Waddel@freescale.com> Cc: netdev@vger.kernel.org Cc: Tim Sander <tim01@vlsi.informatik.tu-darmstadt.de> Acked-by: Greg Ungerer <gerg@uclinux.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/fec.c')
-rw-r--r--drivers/net/fec.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index e730da26d290..b47201874d84 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -427,7 +427,7 @@ fec_enet_tx(struct net_device *dev)
427 struct sk_buff *skb; 427 struct sk_buff *skb;
428 428
429 fep = netdev_priv(dev); 429 fep = netdev_priv(dev);
430 spin_lock_irq(&fep->hw_lock); 430 spin_lock(&fep->hw_lock);
431 bdp = fep->dirty_tx; 431 bdp = fep->dirty_tx;
432 432
433 while (((status = bdp->cbd_sc) & BD_ENET_TX_READY) == 0) { 433 while (((status = bdp->cbd_sc) & BD_ENET_TX_READY) == 0) {
@@ -486,7 +486,7 @@ fec_enet_tx(struct net_device *dev)
486 } 486 }
487 } 487 }
488 fep->dirty_tx = bdp; 488 fep->dirty_tx = bdp;
489 spin_unlock_irq(&fep->hw_lock); 489 spin_unlock(&fep->hw_lock);
490} 490}
491 491
492 492
@@ -509,7 +509,7 @@ fec_enet_rx(struct net_device *dev)
509 flush_cache_all(); 509 flush_cache_all();
510#endif 510#endif
511 511
512 spin_lock_irq(&fep->hw_lock); 512 spin_lock(&fep->hw_lock);
513 513
514 /* First, grab all of the stats for the incoming packet. 514 /* First, grab all of the stats for the incoming packet.
515 * These get messed up if we get called due to a busy condition. 515 * These get messed up if we get called due to a busy condition.
@@ -604,7 +604,7 @@ rx_processing_done:
604 } 604 }
605 fep->cur_rx = bdp; 605 fep->cur_rx = bdp;
606 606
607 spin_unlock_irq(&fep->hw_lock); 607 spin_unlock(&fep->hw_lock);
608} 608}
609 609
610/* called from interrupt context */ 610/* called from interrupt context */
@@ -615,7 +615,7 @@ fec_enet_mii(struct net_device *dev)
615 mii_list_t *mip; 615 mii_list_t *mip;
616 616
617 fep = netdev_priv(dev); 617 fep = netdev_priv(dev);
618 spin_lock_irq(&fep->mii_lock); 618 spin_lock(&fep->mii_lock);
619 619
620 if ((mip = mii_head) == NULL) { 620 if ((mip = mii_head) == NULL) {
621 printk("MII and no head!\n"); 621 printk("MII and no head!\n");
@@ -633,7 +633,7 @@ fec_enet_mii(struct net_device *dev)
633 writel(mip->mii_regval, fep->hwp + FEC_MII_DATA); 633 writel(mip->mii_regval, fep->hwp + FEC_MII_DATA);
634 634
635unlock: 635unlock:
636 spin_unlock_irq(&fep->mii_lock); 636 spin_unlock(&fep->mii_lock);
637} 637}
638 638
639static int 639static int