octeon: add 3 upstream patches that fix issues on the esr-lite
[openwrt/staging/chunkeey.git] / target / linux / octeon / patches-3.10 / 0007-MIPS-Octeon-ethernet-irq-enable.patch
1 From patchwork Thu Sep 5 18:44:01 2013
2 Content-Type: text/plain; charset="utf-8"
3 MIME-Version: 1.0
4 Content-Transfer-Encoding: 7bit
5 Subject: [3/3] staging: octeon-ethernet: rgmii: enable interrupts that we can
6 handle
7 From: Aaro Koskinen <aaro.koskinen@iki.fi>
8 X-Patchwork-Id: 5810
9 Message-Id: <1378406641-16530-4-git-send-email-aaro.koskinen@iki.fi>
10 To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
11 devel@driverdev.osuosl.org, linux-mips@linux-mips.org
12 Cc: David Daney <david.daney@cavium.com>,
13 "Jason A. Donenfeld" <Jason@zx2c4.com>, richard@nod.at,
14 Aaro Koskinen <aaro.koskinen@iki.fi>
15 Date: Thu, 5 Sep 2013 21:44:01 +0300
16
17 Enable only those interrupts that we can handle & acknowledge in the
18 interrupt handler.
19
20 At least on EdgeRouter Lite, the hardware may occasionally interrupt with
21 some error condition when the physical link status changes frequently.
22 Since the interrupt condition is not acked properly, this leads to the
23 following warning and the IRQ gets disabled completely:
24
25 [ 41.324700] eth0: Link down
26 [ 44.324721] eth0: 1000 Mbps Full duplex, port 0, queue 0
27 [ 44.885590] irq 117: nobody cared (try booting with the "irqpoll" option)
28 [ 44.892397] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.11.0-rc5-edge-los.git-27d042f-dirty-00950-gaa42f2d-dirty #8
29 [ 44.902825] Stack : ffffffff815c0000 0000000000000004 0000000000000003 0000000000000000
30 ffffffff81fd0000 ffffffff815c0000 0000000000000004 ffffffff8118530c
31 ffffffff815c0000 ffffffff811858d8 0000000000000000 0000000000000000
32 ffffffff81fd0000 ffffffff81fc0000 ffffffff8152f3a0 ffffffff815b7bf7
33 ffffffff81fc6688 ffffffff815b8060 0000000000000000 0000000000000000
34 0000000000000000 ffffffff815346c8 ffffffff815346b0 ffffffff814a6a18
35 ffffffff8158b848 ffffffff81145614 ffffffff81593800 ffffffff81187174
36 ffffffff815b7d00 ffffffff8158b760 0000000000000000 ffffffff814a9184
37 0000000000000000 0000000000000000 0000000000000000 0000000000000000
38 0000000000000000 ffffffff811203b8 0000000000000000 0000000000000000
39 ...
40 [ 44.968408] Call Trace:
41 [ 44.970873] [<ffffffff811203b8>] show_stack+0x68/0x80
42 [ 44.975937] [<ffffffff814a9184>] dump_stack+0x78/0xb8
43 [ 44.980999] [<ffffffff811aac54>] __report_bad_irq+0x44/0x108
44 [ 44.986662] [<ffffffff811ab238>] note_interrupt+0x248/0x2a0
45 [ 44.992240] [<ffffffff811a85e4>] handle_irq_event_percpu+0x144/0x200
46 [ 44.998598] [<ffffffff811a86f4>] handle_irq_event+0x54/0x90
47 [ 45.004176] [<ffffffff811ab908>] handle_level_irq+0xd0/0x148
48 [ 45.009839] [<ffffffff811a7b04>] generic_handle_irq+0x34/0x50
49 [ 45.015589] [<ffffffff8111dae8>] do_IRQ+0x18/0x30
50 [ 45.020301] [<ffffffff8110486c>] plat_irq_dispatch+0x74/0xb8
51 [ 45.025958]
52 [ 45.027451] handlers:
53 [ 45.029731] [<ffffffff813fca10>] cvm_oct_rgmii_rml_interrupt
54 [ 45.035397] Disabling IRQ #117
55 [ 45.038742] Port 0 receive error code 13, packet dropped
56 [ 46.324719] eth0: Link down
57 [ 48.324733] eth0: 1000 Mbps Full duplex, port 0, queue 0
58
59 Reported-by: "Jason A. Donenfeld" <Jason@zx2c4.com>
60 Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
61 Acked-by: David Daney <david.daney@cavium.com>
62
63 ---
64 drivers/staging/octeon/ethernet-rgmii.c | 4 +---
65 1 file changed, 1 insertion(+), 3 deletions(-)
66
67 diff --git a/drivers/staging/octeon/ethernet-rgmii.c b/drivers/staging/octeon/ethernet-rgmii.c
68 index d8f5f69..ea53af3 100644
69 --- a/drivers/staging/octeon/ethernet-rgmii.c
70 +++ b/drivers/staging/octeon/ethernet-rgmii.c
71 @@ -373,9 +373,7 @@ int cvm_oct_rgmii_init(struct net_device *dev)
72 * Enable interrupts on inband status changes
73 * for this port.
74 */
75 - gmx_rx_int_en.u64 =
76 - cvmx_read_csr(CVMX_GMXX_RXX_INT_EN
77 - (index, interface));
78 + gmx_rx_int_en.u64 = 0;
79 gmx_rx_int_en.s.phy_dupx = 1;
80 gmx_rx_int_en.s.phy_link = 1;
81 gmx_rx_int_en.s.phy_spd = 1;