Commit 9a8d4d15 authored by David S. Miller's avatar David S. Miller

Merge branch 'systemport-next'

Florian Fainelli says:

====================
net: systemport: misc fixes

This patch series contains some misc fixes for the SYSTEMPORT driver.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 6934e79e f532e744
...@@ -514,7 +514,7 @@ static unsigned int bcm_sysport_desc_rx(struct bcm_sysport_priv *priv, ...@@ -514,7 +514,7 @@ static unsigned int bcm_sysport_desc_rx(struct bcm_sysport_priv *priv,
if (unlikely(status & (RX_STATUS_ERR | RX_STATUS_OVFLOW))) { if (unlikely(status & (RX_STATUS_ERR | RX_STATUS_OVFLOW))) {
netif_err(priv, rx_err, ndev, "error packet\n"); netif_err(priv, rx_err, ndev, "error packet\n");
if (RX_STATUS_OVFLOW) if (status & RX_STATUS_OVFLOW)
ndev->stats.rx_over_errors++; ndev->stats.rx_over_errors++;
ndev->stats.rx_dropped++; ndev->stats.rx_dropped++;
ndev->stats.rx_errors++; ndev->stats.rx_errors++;
...@@ -528,9 +528,9 @@ static unsigned int bcm_sysport_desc_rx(struct bcm_sysport_priv *priv, ...@@ -528,9 +528,9 @@ static unsigned int bcm_sysport_desc_rx(struct bcm_sysport_priv *priv,
if (likely(status & DESC_L4_CSUM)) if (likely(status & DESC_L4_CSUM))
skb->ip_summed = CHECKSUM_UNNECESSARY; skb->ip_summed = CHECKSUM_UNNECESSARY;
/* Hardware pre-pends packets with 2bytes between Ethernet /* Hardware pre-pends packets with 2bytes before Ethernet
* and IP header plus we have the Receive Status Block, strip * header plus we have the Receive Status Block, strip off all
* off all of this from the SKB. * of this from the SKB.
*/ */
skb_pull(skb, sizeof(*rsb) + 2); skb_pull(skb, sizeof(*rsb) + 2);
len -= (sizeof(*rsb) + 2); len -= (sizeof(*rsb) + 2);
...@@ -637,10 +637,11 @@ static unsigned int bcm_sysport_tx_reclaim(struct bcm_sysport_priv *priv, ...@@ -637,10 +637,11 @@ static unsigned int bcm_sysport_tx_reclaim(struct bcm_sysport_priv *priv,
struct bcm_sysport_tx_ring *ring) struct bcm_sysport_tx_ring *ring)
{ {
unsigned int released; unsigned int released;
unsigned long flags;
spin_lock(&ring->lock); spin_lock_irqsave(&ring->lock, flags);
released = __bcm_sysport_tx_reclaim(priv, ring); released = __bcm_sysport_tx_reclaim(priv, ring);
spin_unlock(&ring->lock); spin_unlock_irqrestore(&ring->lock, flags);
return released; return released;
} }
...@@ -822,6 +823,7 @@ static netdev_tx_t bcm_sysport_xmit(struct sk_buff *skb, ...@@ -822,6 +823,7 @@ static netdev_tx_t bcm_sysport_xmit(struct sk_buff *skb,
struct netdev_queue *txq; struct netdev_queue *txq;
struct dma_desc *desc; struct dma_desc *desc;
unsigned int skb_len; unsigned int skb_len;
unsigned long flags;
dma_addr_t mapping; dma_addr_t mapping;
u32 len_status; u32 len_status;
u16 queue; u16 queue;
...@@ -831,8 +833,8 @@ static netdev_tx_t bcm_sysport_xmit(struct sk_buff *skb, ...@@ -831,8 +833,8 @@ static netdev_tx_t bcm_sysport_xmit(struct sk_buff *skb,
txq = netdev_get_tx_queue(dev, queue); txq = netdev_get_tx_queue(dev, queue);
ring = &priv->tx_rings[queue]; ring = &priv->tx_rings[queue];
/* lock against tx reclaim in BH context */ /* lock against tx reclaim in BH context and TX ring full interrupt */
spin_lock(&ring->lock); spin_lock_irqsave(&ring->lock, flags);
if (unlikely(ring->desc_count == 0)) { if (unlikely(ring->desc_count == 0)) {
netif_tx_stop_queue(txq); netif_tx_stop_queue(txq);
netdev_err(dev, "queue %d awake and ring full!\n", queue); netdev_err(dev, "queue %d awake and ring full!\n", queue);
...@@ -914,7 +916,7 @@ static netdev_tx_t bcm_sysport_xmit(struct sk_buff *skb, ...@@ -914,7 +916,7 @@ static netdev_tx_t bcm_sysport_xmit(struct sk_buff *skb,
ret = NETDEV_TX_OK; ret = NETDEV_TX_OK;
out: out:
spin_unlock(&ring->lock); spin_unlock_irqrestore(&ring->lock, flags);
return ret; return ret;
} }
...@@ -1593,6 +1595,9 @@ static int bcm_sysport_probe(struct platform_device *pdev) ...@@ -1593,6 +1595,9 @@ static int bcm_sysport_probe(struct platform_device *pdev)
*/ */
dev->flags &= ~IFF_MULTICAST; dev->flags &= ~IFF_MULTICAST;
/* libphy will adjust the link state accordingly */
netif_carrier_off(dev);
ret = register_netdev(dev); ret = register_netdev(dev);
if (ret) { if (ret) {
dev_err(&pdev->dev, "failed to register net_device\n"); dev_err(&pdev->dev, "failed to register net_device\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment