diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-05-19 21:43:50 -0400 | 
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-05-19 21:43:50 -0400 | 
| commit | fbb5ba92766a0a7803635f053220c325d26def9c (patch) | |
| tree | 4cf6d9ed725b5d1254d4d29f5750c37676173490 /drivers/net/meth.c | |
| parent | 4fe1103201057e74f630b1cb8d8d49bd6ce0e666 (diff) | |
| parent | bc8a5397433e4effbaddfa7e462d10b3c060cabb (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
  ipv4: make default for INET_LRO consistent with help text
  net: fix skb_seq_read returning wrong offset/length for page frag data
  pkt_sched: gen_estimator: use 64 bit intermediate counters for bps
  be2net: add two new pci device ids to pci device table
  sch_teql: should not dereference skb after ndo_start_xmit()
  tcp: fix MSG_PEEK race check
  Doc: fixed descriptions on /proc/sys/net/core/* and /proc/sys/net/unix/*
  Neterion: *FIFO1_DMA_ERR set twice, should 2nd be *FIFO2_DMA_ERR?
  mv643xx_eth: fix PPC DMA breakage
  bonding: fix link down handling in 802.3ad mode
  bridge: fix initial packet flood if !STP
  bridge: relay bridge multicast pkgs if !STP
  NET: Meth: Fix unsafe mix of irq and non-irq spinlocks.
  mlx4_en: Fix not deleted napi structures
  ipconfig: handle case of delayed DHCP server
  netpoll: don't dereference NULL dev from np
  wimax/i2400m: fix device crash: fix optimization in _roq_queue_update_ws
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 | } | 
