diff options
author | Brian Norris <computersforpeace@gmail.com> | 2015-05-18 10:50:43 -0700 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2015-05-18 10:50:43 -0700 |
commit | 2ddd8db90a22fc4ac708cd8497ed5e46b7f24d49 (patch) | |
tree | 10924a4ec59c9b2d114c2287bd35e6debc72595f /drivers/net/ethernet/cadence/macb.c | |
parent | 02787daadbdad80c9c79487b5ef8284aff734a7b (diff) | |
parent | e26081808edadfd257c6c9d81014e3b25e9a6118 (diff) | |
download | op-kernel-dev-2ddd8db90a22fc4ac708cd8497ed5e46b7f24d49.zip op-kernel-dev-2ddd8db90a22fc4ac708cd8497ed5e46b7f24d49.tar.gz |
Merge tag 'v4.1-rc4' into MTD's -next
Diffstat (limited to 'drivers/net/ethernet/cadence/macb.c')
-rw-r--r-- | drivers/net/ethernet/cadence/macb.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c index 9f53872..61aa570 100644 --- a/drivers/net/ethernet/cadence/macb.c +++ b/drivers/net/ethernet/cadence/macb.c @@ -707,6 +707,9 @@ static void gem_rx_refill(struct macb *bp) /* properly align Ethernet header */ skb_reserve(skb, NET_IP_ALIGN); + } else { + bp->rx_ring[entry].addr &= ~MACB_BIT(RX_USED); + bp->rx_ring[entry].ctrl = 0; } } @@ -978,7 +981,7 @@ static irqreturn_t macb_interrupt(int irq, void *dev_id) struct macb_queue *queue = dev_id; struct macb *bp = queue->bp; struct net_device *dev = bp->dev; - u32 status; + u32 status, ctrl; status = queue_readl(queue, ISR); @@ -1034,6 +1037,15 @@ static irqreturn_t macb_interrupt(int irq, void *dev_id) * add that if/when we get our hands on a full-blown MII PHY. */ + if (status & MACB_BIT(RXUBR)) { + ctrl = macb_readl(bp, NCR); + macb_writel(bp, NCR, ctrl & ~MACB_BIT(RE)); + macb_writel(bp, NCR, ctrl | MACB_BIT(RE)); + + if (bp->caps & MACB_CAPS_ISR_CLEAR_ON_WRITE) + macb_writel(bp, ISR, MACB_BIT(RXUBR)); + } + if (status & MACB_BIT(ISR_ROVR)) { /* We missed at least one packet */ if (macb_is_gem(bp)) @@ -1473,9 +1485,9 @@ static void macb_init_rings(struct macb *bp) for (i = 0; i < TX_RING_SIZE; i++) { bp->queues[0].tx_ring[i].addr = 0; bp->queues[0].tx_ring[i].ctrl = MACB_BIT(TX_USED); - bp->queues[0].tx_head = 0; - bp->queues[0].tx_tail = 0; } + bp->queues[0].tx_head = 0; + bp->queues[0].tx_tail = 0; bp->queues[0].tx_ring[TX_RING_SIZE - 1].ctrl |= MACB_BIT(TX_WRAP); bp->rx_tail = 0; |