diff options
Diffstat (limited to 'drivers/net/meth.c')
-rw-r--r-- | drivers/net/meth.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/drivers/net/meth.c b/drivers/net/meth.c index aa08987f6e81..dbd3436912b8 100644 --- a/drivers/net/meth.c +++ b/drivers/net/meth.c | |||
@@ -127,11 +127,11 @@ static unsigned long mdio_read(struct meth_private *priv, unsigned long phyreg) | |||
127 | static int mdio_probe(struct meth_private *priv) | 127 | static int mdio_probe(struct meth_private *priv) |
128 | { | 128 | { |
129 | int i; | 129 | int i; |
130 | unsigned long p2, p3; | 130 | unsigned long p2, p3, flags; |
131 | /* check if phy is detected already */ | 131 | /* check if phy is detected already */ |
132 | if(priv->phy_addr>=0&&priv->phy_addr<32) | 132 | if(priv->phy_addr>=0&&priv->phy_addr<32) |
133 | return 0; | 133 | return 0; |
134 | spin_lock(&priv->meth_lock); | 134 | spin_lock_irqsave(&priv->meth_lock, flags); |
135 | for (i=0;i<32;++i){ | 135 | for (i=0;i<32;++i){ |
136 | priv->phy_addr=i; | 136 | priv->phy_addr=i; |
137 | p2=mdio_read(priv,2); | 137 | p2=mdio_read(priv,2); |
@@ -157,7 +157,7 @@ static int mdio_probe(struct meth_private *priv) | |||
157 | break; | 157 | break; |
158 | } | 158 | } |
159 | } | 159 | } |
160 | spin_unlock(&priv->meth_lock); | 160 | spin_unlock_irqrestore(&priv->meth_lock, flags); |
161 | if(priv->phy_addr<32) { | 161 | if(priv->phy_addr<32) { |
162 | return 0; | 162 | return 0; |
163 | } | 163 | } |
@@ -373,14 +373,14 @@ static int meth_release(struct net_device *dev) | |||
373 | static void meth_rx(struct net_device* dev, unsigned long int_status) | 373 | static void meth_rx(struct net_device* dev, unsigned long int_status) |
374 | { | 374 | { |
375 | struct sk_buff *skb; | 375 | struct sk_buff *skb; |
376 | unsigned long status; | 376 | unsigned long status, flags; |
377 | struct meth_private *priv = netdev_priv(dev); | 377 | struct meth_private *priv = netdev_priv(dev); |
378 | unsigned long fifo_rptr = (int_status & METH_INT_RX_RPTR_MASK) >> 8; | 378 | unsigned long fifo_rptr = (int_status & METH_INT_RX_RPTR_MASK) >> 8; |
379 | 379 | ||
380 | spin_lock(&priv->meth_lock); | 380 | spin_lock_irqsave(&priv->meth_lock, flags); |
381 | priv->dma_ctrl &= ~METH_DMA_RX_INT_EN; | 381 | priv->dma_ctrl &= ~METH_DMA_RX_INT_EN; |
382 | mace->eth.dma_ctrl = priv->dma_ctrl; | 382 | mace->eth.dma_ctrl = priv->dma_ctrl; |
383 | spin_unlock(&priv->meth_lock); | 383 | spin_unlock_irqrestore(&priv->meth_lock, flags); |
384 | 384 | ||
385 | if (int_status & METH_INT_RX_UNDERFLOW) { | 385 | if (int_status & METH_INT_RX_UNDERFLOW) { |
386 | fifo_rptr = (fifo_rptr - 1) & 0x0f; | 386 | fifo_rptr = (fifo_rptr - 1) & 0x0f; |
@@ -452,12 +452,12 @@ static void meth_rx(struct net_device* dev, unsigned long int_status) | |||
452 | mace->eth.rx_fifo = priv->rx_ring_dmas[priv->rx_write]; | 452 | mace->eth.rx_fifo = priv->rx_ring_dmas[priv->rx_write]; |
453 | ADVANCE_RX_PTR(priv->rx_write); | 453 | ADVANCE_RX_PTR(priv->rx_write); |
454 | } | 454 | } |
455 | spin_lock(&priv->meth_lock); | 455 | spin_lock_irqsave(&priv->meth_lock, flags); |
456 | /* In case there was underflow, and Rx DMA was disabled */ | 456 | /* In case there was underflow, and Rx DMA was disabled */ |
457 | priv->dma_ctrl |= METH_DMA_RX_INT_EN | METH_DMA_RX_EN; | 457 | priv->dma_ctrl |= METH_DMA_RX_INT_EN | METH_DMA_RX_EN; |
458 | mace->eth.dma_ctrl = priv->dma_ctrl; | 458 | mace->eth.dma_ctrl = priv->dma_ctrl; |
459 | mace->eth.int_stat = METH_INT_RX_THRESHOLD; | 459 | mace->eth.int_stat = METH_INT_RX_THRESHOLD; |
460 | spin_unlock(&priv->meth_lock); | 460 | spin_unlock_irqrestore(&priv->meth_lock, flags); |
461 | } | 461 | } |
462 | 462 | ||
463 | static int meth_tx_full(struct net_device *dev) | 463 | static int meth_tx_full(struct net_device *dev) |
@@ -470,11 +470,11 @@ static int meth_tx_full(struct net_device *dev) | |||
470 | static void meth_tx_cleanup(struct net_device* dev, unsigned long int_status) | 470 | static void meth_tx_cleanup(struct net_device* dev, unsigned long int_status) |
471 | { | 471 | { |
472 | struct meth_private *priv = netdev_priv(dev); | 472 | struct meth_private *priv = netdev_priv(dev); |
473 | unsigned long status; | 473 | unsigned long status, flags; |
474 | struct sk_buff *skb; | 474 | struct sk_buff *skb; |
475 | unsigned long rptr = (int_status&TX_INFO_RPTR) >> 16; | 475 | unsigned long rptr = (int_status&TX_INFO_RPTR) >> 16; |
476 | 476 | ||
477 | spin_lock(&priv->meth_lock); | 477 | spin_lock_irqsave(&priv->meth_lock, flags); |
478 | 478 | ||
479 | /* Stop DMA notification */ | 479 | /* Stop DMA notification */ |
480 | priv->dma_ctrl &= ~(METH_DMA_TX_INT_EN); | 480 | priv->dma_ctrl &= ~(METH_DMA_TX_INT_EN); |
@@ -527,12 +527,13 @@ static void meth_tx_cleanup(struct net_device* dev, unsigned long int_status) | |||
527 | } | 527 | } |
528 | 528 | ||
529 | mace->eth.int_stat = METH_INT_TX_EMPTY | METH_INT_TX_PKT; | 529 | mace->eth.int_stat = METH_INT_TX_EMPTY | METH_INT_TX_PKT; |
530 | spin_unlock(&priv->meth_lock); | 530 | spin_unlock_irqrestore(&priv->meth_lock, flags); |
531 | } | 531 | } |
532 | 532 | ||
533 | static void meth_error(struct net_device* dev, unsigned status) | 533 | static void meth_error(struct net_device* dev, unsigned status) |
534 | { | 534 | { |
535 | struct meth_private *priv = netdev_priv(dev); | 535 | struct meth_private *priv = netdev_priv(dev); |
536 | unsigned long flags; | ||
536 | 537 | ||
537 | printk(KERN_WARNING "meth: error status: 0x%08x\n",status); | 538 | printk(KERN_WARNING "meth: error status: 0x%08x\n",status); |
538 | /* check for errors too... */ | 539 | /* check for errors too... */ |
@@ -547,7 +548,7 @@ static void meth_error(struct net_device* dev, unsigned status) | |||
547 | printk(KERN_WARNING "meth: Rx overflow\n"); | 548 | printk(KERN_WARNING "meth: Rx overflow\n"); |
548 | if (status & (METH_INT_RX_UNDERFLOW)) { | 549 | if (status & (METH_INT_RX_UNDERFLOW)) { |
549 | printk(KERN_WARNING "meth: Rx underflow\n"); | 550 | printk(KERN_WARNING "meth: Rx underflow\n"); |
550 | spin_lock(&priv->meth_lock); | 551 | spin_lock_irqsave(&priv->meth_lock, flags); |
551 | mace->eth.int_stat = METH_INT_RX_UNDERFLOW; | 552 | mace->eth.int_stat = METH_INT_RX_UNDERFLOW; |
552 | /* more underflow interrupts will be delivered, | 553 | /* more underflow interrupts will be delivered, |
553 | * effectively throwing us into an infinite loop. | 554 | * effectively throwing us into an infinite loop. |
@@ -555,7 +556,7 @@ static void meth_error(struct net_device* dev, unsigned status) | |||
555 | priv->dma_ctrl &= ~METH_DMA_RX_EN; | 556 | priv->dma_ctrl &= ~METH_DMA_RX_EN; |
556 | mace->eth.dma_ctrl = priv->dma_ctrl; | 557 | mace->eth.dma_ctrl = priv->dma_ctrl; |
557 | DPRINTK("Disabled meth Rx DMA temporarily\n"); | 558 | DPRINTK("Disabled meth Rx DMA temporarily\n"); |
558 | spin_unlock(&priv->meth_lock); | 559 | spin_unlock_irqrestore(&priv->meth_lock, flags); |
559 | } | 560 | } |
560 | mace->eth.int_stat = METH_INT_ERROR; | 561 | mace->eth.int_stat = METH_INT_ERROR; |
561 | } | 562 | } |