summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2014-05-16 22:41:53 +0200
committerDavid S. Miller <davem@davemloft.net>2014-05-16 22:41:53 +0200
commite0a1272cfacd53ff99c768b9e09b64cfdd77159c (patch)
tree702e57caf0fe830c9de5366ebf08c862e0a28ef6
parentMerge branch 'bonding-next' (diff)
parentnet: systemport: wait for packet in umac_enable_set() (diff)
downloadlinux-e0a1272cfacd53ff99c768b9e09b64cfdd77159c.tar.xz
linux-e0a1272cfacd53ff99c768b9e09b64cfdd77159c.zip
Merge branch 'systemport-next'
Florian Fainelli says: ==================== net: systemport: DMA and MAC fixes This patch series contains a critical fix in how the DMA unmapping of packet is done, as well as a less critical fix in how we disable the Ethernet MAC RX/TX functions. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/broadcom/bcmsysport.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c
index 8edc0980cdf5..d40c5b969e9e 100644
--- a/drivers/net/ethernet/broadcom/bcmsysport.c
+++ b/drivers/net/ethernet/broadcom/bcmsysport.c
@@ -479,7 +479,7 @@ static unsigned int bcm_sysport_desc_rx(struct bcm_sysport_priv *priv,
cb = &priv->rx_cbs[priv->rx_read_ptr];
skb = cb->skb;
dma_unmap_single(kdev, dma_unmap_addr(cb, dma_addr),
- dma_unmap_len(cb, dma_len), DMA_FROM_DEVICE);
+ RX_BUF_LENGTH, DMA_FROM_DEVICE);
/* Extract the Receive Status Block prepended */
rsb = (struct rsb *)skb->data;
@@ -1244,6 +1244,12 @@ static inline void umac_enable_set(struct bcm_sysport_priv *priv,
else
reg &= ~(CMD_RX_EN | CMD_TX_EN);
umac_writel(priv, reg, UMAC_CMD);
+
+ /* UniMAC stops on a packet boundary, wait for a full-sized packet
+ * to be processed (1 msec).
+ */
+ if (enable == 0)
+ usleep_range(1000, 2000);
}
static inline int umac_reset(struct bcm_sysport_priv *priv)