kernel: update 3.10 to 3.10.9
[openwrt.git] / target / linux / octeon / patches-3.10 / 0001-MIPS-Octeon-Fix-DT-pruning-bug-with-pip-ports.patch
1 From ab2bb148c5932712d2717a7f3a452846f07a660a Mon Sep 17 00:00:00 2001
2 From: Faidon Liambotis <paravoid@debian.org>
3 Date: Thu, 11 Jul 2013 21:08:09 +0000
4 Subject: [PATCH] MIPS: Octeon: Fix DT pruning bug with pip ports
5
6 During the pruning of the device tree octeon_fdt_pip_iface() is called
7 for each PIP interface and every port up to the port count is removed
8 from the device tree. However, the count was set to the return value of
9 cvmx_helper_interface_enumerate() which doesn't actually return the
10 count but just returns zero on success. This effectively removed *all*
11 ports from the tree.
12
13 Use cvmx_helper_ports_on_interface() instead to fix this. This
14 successfully restores the 3 ports of my ERLite-3 and fixes the "kernel
15 assigns random MAC addresses" issue.
16
17 Signed-off-by: Faidon Liambotis <paravoid@debian.org>
18 Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
19 Acked-by: David Daney <david.daney@cavium.com>
20 Cc: linux-mips@linux-mips.org
21 Patchwork: https://patchwork.linux-mips.org/patch/5587/
22 Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
23 ---
24  arch/mips/cavium-octeon/octeon-platform.c |    5 +++--
25  1 file changed, 3 insertions(+), 2 deletions(-)
26
27 --- a/arch/mips/cavium-octeon/octeon-platform.c
28 +++ b/arch/mips/cavium-octeon/octeon-platform.c
29 @@ -334,9 +334,10 @@ static void __init octeon_fdt_pip_iface(
30         char name_buffer[20];
31         int iface;
32         int p;
33 -       int count;
34 +       int count = 0;
35  
36 -       count = cvmx_helper_interface_enumerate(idx);
37 +       if (cvmx_helper_interface_enumerate(idx) == 0)
38 +               count = cvmx_helper_ports_on_interface(idx);
39  
40         snprintf(name_buffer, sizeof(name_buffer), "interface@%d", idx);
41         iface = fdt_subnode_offset(initial_boot_params, pip, name_buffer);