]> code.ossystems Code Review - meta-freescale.git/commitdiff
linux-imx-3.14.28: FEC: fix garbage send for huge data blocks
authorAndreas Müller <schnitzeltony@googlemail.com>
Mon, 8 Jun 2015 12:48:06 +0000 (14:48 +0200)
committerOtavio Salvador <otavio@ossystems.com.br>
Tue, 9 Jun 2015 18:46:17 +0000 (15:46 -0300)
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
meta-fsl-arm/recipes-kernel/linux/linux-imx-3.14.28/0005-Revert-net-fec-fix-the-warning-found-by-dma-debug.patch [new file with mode: 0644]
meta-fsl-arm/recipes-kernel/linux/linux-imx_3.14.28.bb

diff --git a/meta-fsl-arm/recipes-kernel/linux/linux-imx-3.14.28/0005-Revert-net-fec-fix-the-warning-found-by-dma-debug.patch b/meta-fsl-arm/recipes-kernel/linux/linux-imx-3.14.28/0005-Revert-net-fec-fix-the-warning-found-by-dma-debug.patch
new file mode 100644 (file)
index 0000000..5e5721c
--- /dev/null
@@ -0,0 +1,100 @@
+From a2fe37b69d4fe369c284d50927193fed81c238a0 Mon Sep 17 00:00:00 2001
+From: Fabio Estevam <fabio.estevam@freescale.com>
+Date: Fri, 13 Mar 2015 14:07:54 -0300
+Subject: [PATCH] Revert "net: fec: fix the warning found by dma debug"
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This reverts commit 2b995f63987013bacde99168218f9c7b252bdcf1.
+
+????? ?????? reported the following regression:
+
+"Commit 2b995f63987013bacde99168218f9c7b252bdcf1 in 4.0.0-rc3 introduces a
+nasty bug in transmit, corrupting packets.
+
+To reproduce:
+
+$ dd if=/dev/zero of=zeros bs=1M count=20
+$ md5sum -b zeros
+8f4e33f3dc3e414ff94e5fb6905cba8c *zeros
+
+This checksum is correct.
+
+Copy file "zeros" to another host with NFS, and it gets corrupted, checksum is
+changed.
+File should be big, small amounts of transmit isn't affected.
+
+I use an i.MX6 Quad board.
+
+If this commit is reverted, all works fine."
+
+Reported-by: ????? ?????? <rockford@yandex.ru>
+Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/ethernet/freescale/fec_main.c | 34 ++++++++++---------------------
+ 1 file changed, 11 insertions(+), 23 deletions(-)
+
+diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
+index 787db50..78e1ce0 100644
+--- a/drivers/net/ethernet/freescale/fec_main.c
++++ b/drivers/net/ethernet/freescale/fec_main.c
+@@ -1189,13 +1189,12 @@ static void
+ fec_enet_tx_queue(struct net_device *ndev, u16 queue_id)
+ {
+       struct  fec_enet_private *fep;
+-      struct bufdesc *bdp, *bdp_t;
++      struct bufdesc *bdp;
+       unsigned short status;
+       struct  sk_buff *skb;
+       struct fec_enet_priv_tx_q *txq;
+       struct netdev_queue *nq;
+       int     index = 0;
+-      int     i, bdnum;
+       int     entries_free;
+       fep = netdev_priv(ndev);
+@@ -1216,29 +1215,18 @@ fec_enet_tx_queue(struct net_device *ndev, u16 queue_id)
+               if (bdp == txq->cur_tx)
+                       break;
+-              bdp_t = bdp;
+-              bdnum = 1;
+-              index = fec_enet_get_bd_index(txq->tx_bd_base, bdp_t, fep);
+-              skb = txq->tx_skbuff[index];
+-              while (!skb) {
+-                      bdp_t = fec_enet_get_nextdesc(bdp_t, fep, queue_id);
+-                      index = fec_enet_get_bd_index(txq->tx_bd_base, bdp_t, fep);
+-                      skb = txq->tx_skbuff[index];
+-                      bdnum++;
+-              }
+-              if (skb_shinfo(skb)->nr_frags &&
+-                  (status = bdp_t->cbd_sc) & BD_ENET_TX_READY)
+-                      break;
++              index = fec_enet_get_bd_index(txq->tx_bd_base, bdp, fep);
+-              for (i = 0; i < bdnum; i++) {
+-                      if (!IS_TSO_HEADER(txq, bdp->cbd_bufaddr))
+-                              dma_unmap_single(&fep->pdev->dev, bdp->cbd_bufaddr,
+-                                               bdp->cbd_datlen, DMA_TO_DEVICE);
+-                      bdp->cbd_bufaddr = 0;
+-                      if (i < bdnum - 1)
+-                              bdp = fec_enet_get_nextdesc(bdp, fep, queue_id);
+-              }
++              skb = txq->tx_skbuff[index];
+               txq->tx_skbuff[index] = NULL;
++              if (!IS_TSO_HEADER(txq, bdp->cbd_bufaddr))
++                      dma_unmap_single(&fep->pdev->dev, bdp->cbd_bufaddr,
++                                      bdp->cbd_datlen, DMA_TO_DEVICE);
++              bdp->cbd_bufaddr = 0;
++              if (!skb) {
++                      bdp = fec_enet_get_nextdesc(bdp, fep, queue_id);
++                      continue;
++              }
+               /* Check for errors. */
+               if (status & (BD_ENET_TX_HB | BD_ENET_TX_LC |
+-- 
+1.9.3
+
index 5d1be545079111404cf908dfc05e3182b6d53981..ba6f99af08da878c430c83416006078247dd3b3c 100644 (file)
@@ -19,6 +19,7 @@ SRC_URI += " \
     file://0002-ARM-clk-imx6q-fix-video-divider-for-rev-T0-1.0.patch \
     file://0003-ARM-imx6sl-Disable-imx6sl-specific-code-when-imx6sl-.patch \
     file://0004-mmc-sdhci-esdhc-imx-Fixup-runtime-PM-conditions-duri.patch \
+    file://0005-Revert-net-fec-fix-the-warning-found-by-dma-debug.patch \
 "
 
 COMPATIBLE_MACHINE = "(mx6)"