]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/backports/backports-linux-upstream-3.patch
core117: Regenerate language cache
[ipfire-2.x.git] / src / patches / backports / backports-linux-upstream-3.patch
CommitLineData
c5c12c9c
AF
1From fc70a4a5cb616bf390cee03390265045de5cf06a Mon Sep 17 00:00:00 2001
2From: Feng Tang <feng.tang@intel.com>
3Date: Fri, 24 Jun 2016 15:26:05 +0800
4Subject: net: alx: Work around the DMA RX overflow issue
5
6[ Upstream commit 881d0327db37ad917a367c77aff1afa1ee41e0a9 ]
7
8Note: This is a verified backported patch for stable 4.4 kernel, and it
9could also be applied to 4.3/4.2/4.1/3.18/3.16
10
11There is a problem with alx devices, that the network link will be
12lost in 1-5 minutes after the device is up.
13
14>From debugging without datasheet, we found the error always
15happen when the DMA RX address is set to 0x....fc0, which is very
16likely to be a HW/silicon problem.
17
18This patch will apply rx skb with 64 bytes longer space, and if the
19allocated skb has a 0x...fc0 address, it will use skb_resever(skb, 64)
20to advance the address, so that the RX overflow can be avoided.
21
22Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=70761
23Signed-off-by: Feng Tang <feng.tang@intel.com>
24Suggested-by: Eric Dumazet <edumazet@google.com>
25Tested-by: Ole Lukoie <olelukoie@mail.ru>
26Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
27---
28 drivers/net/ethernet/atheros/alx/main.c | 7 ++++++-
29 1 file changed, 6 insertions(+), 1 deletion(-)
30
31diff --git a/drivers/net/ethernet/atheros/alx/main.c b/drivers/net/ethernet/atheros/alx/main.c
32index 3e1d7d2..7585960 100644
33--- a/drivers/net/ethernet/atheros/alx/main.c
34+++ b/drivers/net/ethernet/atheros/alx/main.c
35@@ -86,9 +86,14 @@ static int alx_refill_rx_ring(struct alx_priv *alx, gfp_t gfp)
36 while (!cur_buf->skb && next != rxq->read_idx) {
37 struct alx_rfd *rfd = &rxq->rfd[cur];
38
39- skb = __netdev_alloc_skb(alx->dev, alx->rxbuf_size, gfp);
40+ skb = __netdev_alloc_skb(alx->dev, alx->rxbuf_size + 64, gfp);
41 if (!skb)
42 break;
43+
44+ /* Workround for the HW RX DMA overflow issue */
45+ if (((unsigned long)skb->data & 0xfff) == 0xfc0)
46+ skb_reserve(skb, 64);
47+
48 dma = dma_map_single(&alx->hw.pdev->dev,
49 skb->data, alx->rxbuf_size,
50 DMA_FROM_DEVICE);
51--
52cgit v0.12
53