]>
Commit | Line | Data |
---|---|---|
c5c12c9c AF |
1 | From fc70a4a5cb616bf390cee03390265045de5cf06a Mon Sep 17 00:00:00 2001 |
2 | From: Feng Tang <feng.tang@intel.com> | |
3 | Date: Fri, 24 Jun 2016 15:26:05 +0800 | |
4 | Subject: net: alx: Work around the DMA RX overflow issue | |
5 | ||
6 | [ Upstream commit 881d0327db37ad917a367c77aff1afa1ee41e0a9 ] | |
7 | ||
8 | Note: This is a verified backported patch for stable 4.4 kernel, and it | |
9 | could also be applied to 4.3/4.2/4.1/3.18/3.16 | |
10 | ||
11 | There is a problem with alx devices, that the network link will be | |
12 | lost in 1-5 minutes after the device is up. | |
13 | ||
14 | >From debugging without datasheet, we found the error always | |
15 | happen when the DMA RX address is set to 0x....fc0, which is very | |
16 | likely to be a HW/silicon problem. | |
17 | ||
18 | This patch will apply rx skb with 64 bytes longer space, and if the | |
19 | allocated skb has a 0x...fc0 address, it will use skb_resever(skb, 64) | |
20 | to advance the address, so that the RX overflow can be avoided. | |
21 | ||
22 | Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=70761 | |
23 | Signed-off-by: Feng Tang <feng.tang@intel.com> | |
24 | Suggested-by: Eric Dumazet <edumazet@google.com> | |
25 | Tested-by: Ole Lukoie <olelukoie@mail.ru> | |
26 | Signed-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 | ||
31 | diff --git a/drivers/net/ethernet/atheros/alx/main.c b/drivers/net/ethernet/atheros/alx/main.c | |
32 | index 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 | -- | |
52 | cgit v0.12 | |
53 |