diff options
-rw-r--r-- | meta-fsl-arm/recipes-kernel/linux/linux-imx-3.14.28/0005-Revert-net-fec-fix-the-warning-found-by-dma-debug.patch | 100 | ||||
-rw-r--r-- | meta-fsl-arm/recipes-kernel/linux/linux-imx_3.14.28.bb | 1 |
2 files changed, 101 insertions, 0 deletions
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 index 00000000..5e5721cf --- /dev/null +++ b/meta-fsl-arm/recipes-kernel/linux/linux-imx-3.14.28/0005-Revert-net-fec-fix-the-warning-found-by-dma-debug.patch | |||
@@ -0,0 +1,100 @@ | |||
1 | From a2fe37b69d4fe369c284d50927193fed81c238a0 Mon Sep 17 00:00:00 2001 | ||
2 | From: Fabio Estevam <fabio.estevam@freescale.com> | ||
3 | Date: Fri, 13 Mar 2015 14:07:54 -0300 | ||
4 | Subject: [PATCH] Revert "net: fec: fix the warning found by dma debug" | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | This reverts commit 2b995f63987013bacde99168218f9c7b252bdcf1. | ||
10 | |||
11 | ????? ?????? reported the following regression: | ||
12 | |||
13 | "Commit 2b995f63987013bacde99168218f9c7b252bdcf1 in 4.0.0-rc3 introduces a | ||
14 | nasty bug in transmit, corrupting packets. | ||
15 | |||
16 | To reproduce: | ||
17 | |||
18 | $ dd if=/dev/zero of=zeros bs=1M count=20 | ||
19 | $ md5sum -b zeros | ||
20 | 8f4e33f3dc3e414ff94e5fb6905cba8c *zeros | ||
21 | |||
22 | This checksum is correct. | ||
23 | |||
24 | Copy file "zeros" to another host with NFS, and it gets corrupted, checksum is | ||
25 | changed. | ||
26 | File should be big, small amounts of transmit isn't affected. | ||
27 | |||
28 | I use an i.MX6 Quad board. | ||
29 | |||
30 | If this commit is reverted, all works fine." | ||
31 | |||
32 | Reported-by: ????? ?????? <rockford@yandex.ru> | ||
33 | Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> | ||
34 | Signed-off-by: David S. Miller <davem@davemloft.net> | ||
35 | --- | ||
36 | drivers/net/ethernet/freescale/fec_main.c | 34 ++++++++++--------------------- | ||
37 | 1 file changed, 11 insertions(+), 23 deletions(-) | ||
38 | |||
39 | diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c | ||
40 | index 787db50..78e1ce0 100644 | ||
41 | --- a/drivers/net/ethernet/freescale/fec_main.c | ||
42 | +++ b/drivers/net/ethernet/freescale/fec_main.c | ||
43 | @@ -1189,13 +1189,12 @@ static void | ||
44 | fec_enet_tx_queue(struct net_device *ndev, u16 queue_id) | ||
45 | { | ||
46 | struct fec_enet_private *fep; | ||
47 | - struct bufdesc *bdp, *bdp_t; | ||
48 | + struct bufdesc *bdp; | ||
49 | unsigned short status; | ||
50 | struct sk_buff *skb; | ||
51 | struct fec_enet_priv_tx_q *txq; | ||
52 | struct netdev_queue *nq; | ||
53 | int index = 0; | ||
54 | - int i, bdnum; | ||
55 | int entries_free; | ||
56 | |||
57 | fep = netdev_priv(ndev); | ||
58 | @@ -1216,29 +1215,18 @@ fec_enet_tx_queue(struct net_device *ndev, u16 queue_id) | ||
59 | if (bdp == txq->cur_tx) | ||
60 | break; | ||
61 | |||
62 | - bdp_t = bdp; | ||
63 | - bdnum = 1; | ||
64 | - index = fec_enet_get_bd_index(txq->tx_bd_base, bdp_t, fep); | ||
65 | - skb = txq->tx_skbuff[index]; | ||
66 | - while (!skb) { | ||
67 | - bdp_t = fec_enet_get_nextdesc(bdp_t, fep, queue_id); | ||
68 | - index = fec_enet_get_bd_index(txq->tx_bd_base, bdp_t, fep); | ||
69 | - skb = txq->tx_skbuff[index]; | ||
70 | - bdnum++; | ||
71 | - } | ||
72 | - if (skb_shinfo(skb)->nr_frags && | ||
73 | - (status = bdp_t->cbd_sc) & BD_ENET_TX_READY) | ||
74 | - break; | ||
75 | + index = fec_enet_get_bd_index(txq->tx_bd_base, bdp, fep); | ||
76 | |||
77 | - for (i = 0; i < bdnum; i++) { | ||
78 | - if (!IS_TSO_HEADER(txq, bdp->cbd_bufaddr)) | ||
79 | - dma_unmap_single(&fep->pdev->dev, bdp->cbd_bufaddr, | ||
80 | - bdp->cbd_datlen, DMA_TO_DEVICE); | ||
81 | - bdp->cbd_bufaddr = 0; | ||
82 | - if (i < bdnum - 1) | ||
83 | - bdp = fec_enet_get_nextdesc(bdp, fep, queue_id); | ||
84 | - } | ||
85 | + skb = txq->tx_skbuff[index]; | ||
86 | txq->tx_skbuff[index] = NULL; | ||
87 | + if (!IS_TSO_HEADER(txq, bdp->cbd_bufaddr)) | ||
88 | + dma_unmap_single(&fep->pdev->dev, bdp->cbd_bufaddr, | ||
89 | + bdp->cbd_datlen, DMA_TO_DEVICE); | ||
90 | + bdp->cbd_bufaddr = 0; | ||
91 | + if (!skb) { | ||
92 | + bdp = fec_enet_get_nextdesc(bdp, fep, queue_id); | ||
93 | + continue; | ||
94 | + } | ||
95 | |||
96 | /* Check for errors. */ | ||
97 | if (status & (BD_ENET_TX_HB | BD_ENET_TX_LC | | ||
98 | -- | ||
99 | 1.9.3 | ||
100 | |||
diff --git a/meta-fsl-arm/recipes-kernel/linux/linux-imx_3.14.28.bb b/meta-fsl-arm/recipes-kernel/linux/linux-imx_3.14.28.bb index 5d1be545..ba6f99af 100644 --- a/meta-fsl-arm/recipes-kernel/linux/linux-imx_3.14.28.bb +++ b/meta-fsl-arm/recipes-kernel/linux/linux-imx_3.14.28.bb | |||
@@ -19,6 +19,7 @@ SRC_URI += " \ | |||
19 | file://0002-ARM-clk-imx6q-fix-video-divider-for-rev-T0-1.0.patch \ | 19 | file://0002-ARM-clk-imx6q-fix-video-divider-for-rev-T0-1.0.patch \ |
20 | file://0003-ARM-imx6sl-Disable-imx6sl-specific-code-when-imx6sl-.patch \ | 20 | file://0003-ARM-imx6sl-Disable-imx6sl-specific-code-when-imx6sl-.patch \ |
21 | file://0004-mmc-sdhci-esdhc-imx-Fixup-runtime-PM-conditions-duri.patch \ | 21 | file://0004-mmc-sdhci-esdhc-imx-Fixup-runtime-PM-conditions-duri.patch \ |
22 | file://0005-Revert-net-fec-fix-the-warning-found-by-dma-debug.patch \ | ||
22 | " | 23 | " |
23 | 24 | ||
24 | COMPATIBLE_MACHINE = "(mx6)" | 25 | COMPATIBLE_MACHINE = "(mx6)" |