Skip to content

Commit

Permalink
fec: don't enable irqs in hard irq context
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Uwe Kleine-König authored and David S. Miller committed Sep 3, 2009
1 parent 84177a2 commit 81538e7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/net/fec.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ fec_enet_tx(struct net_device *dev)
struct sk_buff *skb;

fep = netdev_priv(dev);
spin_lock_irq(&fep->hw_lock);
spin_lock(&fep->hw_lock);
bdp = fep->dirty_tx;

while (((status = bdp->cbd_sc) & BD_ENET_TX_READY) == 0) {
Expand Down Expand Up @@ -486,7 +486,7 @@ fec_enet_tx(struct net_device *dev)
}
}
fep->dirty_tx = bdp;
spin_unlock_irq(&fep->hw_lock);
spin_unlock(&fep->hw_lock);
}


Expand All @@ -509,7 +509,7 @@ fec_enet_rx(struct net_device *dev)
flush_cache_all();
#endif

spin_lock_irq(&fep->hw_lock);
spin_lock(&fep->hw_lock);

/* First, grab all of the stats for the incoming packet.
* These get messed up if we get called due to a busy condition.
Expand Down Expand Up @@ -604,7 +604,7 @@ fec_enet_rx(struct net_device *dev)
}
fep->cur_rx = bdp;

spin_unlock_irq(&fep->hw_lock);
spin_unlock(&fep->hw_lock);
}

/* called from interrupt context */
Expand All @@ -615,7 +615,7 @@ fec_enet_mii(struct net_device *dev)
mii_list_t *mip;

fep = netdev_priv(dev);
spin_lock_irq(&fep->mii_lock);
spin_lock(&fep->mii_lock);

if ((mip = mii_head) == NULL) {
printk("MII and no head!\n");
Expand All @@ -633,7 +633,7 @@ fec_enet_mii(struct net_device *dev)
writel(mip->mii_regval, fep->hwp + FEC_MII_DATA);

unlock:
spin_unlock_irq(&fep->mii_lock);
spin_unlock(&fep->mii_lock);
}

static int
Expand Down

0 comments on commit 81538e7

Please sign in to comment.