aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/fec_mpc52xx.c
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2010-11-03 01:56:38 -0400
committerDavid S. Miller <davem@davemloft.net>2010-11-16 14:39:08 -0500
commit9d1e5e40d6cac4bf7008e04c202d71918455ca11 (patch)
treefaa3707b83633013bc2a666fd0f26d0cd13b4bdb /drivers/net/fec_mpc52xx.c
parentb178bb3dfc30d9555bdd2401e95af98e23e83e10 (diff)
mpc52xx: cleanup locking
commit 1e4e0767ecb1 (Fix locking on fec_mpc52xx driver) assumed IRQ are enabled when an IRQ handler is called. It is not the case anymore (IRQF_DISABLED is deprecated), so we can use regular spin_lock(), no need for spin_lock_irqsave(). Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Tested-by: Jean-Michel Hautbois <jhautbois@gmail.com> Cc: Asier Llano <a.llano@ziv.es> Cc: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/fec_mpc52xx.c')
-rw-r--r--drivers/net/fec_mpc52xx.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/net/fec_mpc52xx.c b/drivers/net/fec_mpc52xx.c
index e9f5d030bc26..50c1213f61fe 100644
--- a/drivers/net/fec_mpc52xx.c
+++ b/drivers/net/fec_mpc52xx.c
@@ -366,9 +366,8 @@ static irqreturn_t mpc52xx_fec_tx_interrupt(int irq, void *dev_id)
366{ 366{
367 struct net_device *dev = dev_id; 367 struct net_device *dev = dev_id;
368 struct mpc52xx_fec_priv *priv = netdev_priv(dev); 368 struct mpc52xx_fec_priv *priv = netdev_priv(dev);
369 unsigned long flags;
370 369
371 spin_lock_irqsave(&priv->lock, flags); 370 spin_lock(&priv->lock);
372 while (bcom_buffer_done(priv->tx_dmatsk)) { 371 while (bcom_buffer_done(priv->tx_dmatsk)) {
373 struct sk_buff *skb; 372 struct sk_buff *skb;
374 struct bcom_fec_bd *bd; 373 struct bcom_fec_bd *bd;
@@ -379,7 +378,7 @@ static irqreturn_t mpc52xx_fec_tx_interrupt(int irq, void *dev_id)
379 378
380 dev_kfree_skb_irq(skb); 379 dev_kfree_skb_irq(skb);
381 } 380 }
382 spin_unlock_irqrestore(&priv->lock, flags); 381 spin_unlock(&priv->lock);
383 382
384 netif_wake_queue(dev); 383 netif_wake_queue(dev);
385 384
@@ -395,9 +394,8 @@ static irqreturn_t mpc52xx_fec_rx_interrupt(int irq, void *dev_id)
395 struct bcom_fec_bd *bd; 394 struct bcom_fec_bd *bd;
396 u32 status, physaddr; 395 u32 status, physaddr;
397 int length; 396 int length;
398 unsigned long flags;
399 397
400 spin_lock_irqsave(&priv->lock, flags); 398 spin_lock(&priv->lock);
401 399
402 while (bcom_buffer_done(priv->rx_dmatsk)) { 400 while (bcom_buffer_done(priv->rx_dmatsk)) {
403 401
@@ -429,7 +427,7 @@ static irqreturn_t mpc52xx_fec_rx_interrupt(int irq, void *dev_id)
429 427
430 /* Process the received skb - Drop the spin lock while 428 /* Process the received skb - Drop the spin lock while
431 * calling into the network stack */ 429 * calling into the network stack */
432 spin_unlock_irqrestore(&priv->lock, flags); 430 spin_unlock(&priv->lock);
433 431
434 dma_unmap_single(dev->dev.parent, physaddr, rskb->len, 432 dma_unmap_single(dev->dev.parent, physaddr, rskb->len,
435 DMA_FROM_DEVICE); 433 DMA_FROM_DEVICE);
@@ -438,10 +436,10 @@ static irqreturn_t mpc52xx_fec_rx_interrupt(int irq, void *dev_id)
438 rskb->protocol = eth_type_trans(rskb, dev); 436 rskb->protocol = eth_type_trans(rskb, dev);
439 netif_rx(rskb); 437 netif_rx(rskb);
440 438
441 spin_lock_irqsave(&priv->lock, flags); 439 spin_lock(&priv->lock);
442 } 440 }
443 441
444 spin_unlock_irqrestore(&priv->lock, flags); 442 spin_unlock(&priv->lock);
445 443
446 return IRQ_HANDLED; 444 return IRQ_HANDLED;
447} 445}
@@ -452,7 +450,6 @@ static irqreturn_t mpc52xx_fec_interrupt(int irq, void *dev_id)
452 struct mpc52xx_fec_priv *priv = netdev_priv(dev); 450 struct mpc52xx_fec_priv *priv = netdev_priv(dev);
453 struct mpc52xx_fec __iomem *fec = priv->fec; 451 struct mpc52xx_fec __iomem *fec = priv->fec;
454 u32 ievent; 452 u32 ievent;
455 unsigned long flags;
456 453
457 ievent = in_be32(&fec->ievent); 454 ievent = in_be32(&fec->ievent);
458 455
@@ -470,9 +467,9 @@ static irqreturn_t mpc52xx_fec_interrupt(int irq, void *dev_id)
470 if (net_ratelimit() && (ievent & FEC_IEVENT_XFIFO_ERROR)) 467 if (net_ratelimit() && (ievent & FEC_IEVENT_XFIFO_ERROR))
471 dev_warn(&dev->dev, "FEC_IEVENT_XFIFO_ERROR\n"); 468 dev_warn(&dev->dev, "FEC_IEVENT_XFIFO_ERROR\n");
472 469
473 spin_lock_irqsave(&priv->lock, flags); 470 spin_lock(&priv->lock);
474 mpc52xx_fec_reset(dev); 471 mpc52xx_fec_reset(dev);
475 spin_unlock_irqrestore(&priv->lock, flags); 472 spin_unlock(&priv->lock);
476 473
477 return IRQ_HANDLED; 474 return IRQ_HANDLED;
478 } 475 }