Skip to content

Commit ab2bb14

Browse files
paravoidralfbaechle
authored andcommitted
MIPS: Octeon: Fix DT pruning bug with pip ports
During the pruning of the device tree octeon_fdt_pip_iface() is called for each PIP interface and every port up to the port count is removed from the device tree. However, the count was set to the return value of cvmx_helper_interface_enumerate() which doesn't actually return the count but just returns zero on success. This effectively removed *all* ports from the tree. Use cvmx_helper_ports_on_interface() instead to fix this. This successfully restores the 3 ports of my ERLite-3 and fixes the "kernel assigns random MAC addresses" issue. Signed-off-by: Faidon Liambotis <[email protected]> Tested-by: Aaro Koskinen <[email protected]> Acked-by: David Daney <[email protected]> Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/5587/ Signed-off-by: Ralf Baechle <[email protected]>
1 parent f2a5b1d commit ab2bb14

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

arch/mips/cavium-octeon/octeon-platform.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,10 @@ static void __init octeon_fdt_pip_iface(int pip, int idx, u64 *pmac)
334334
char name_buffer[20];
335335
int iface;
336336
int p;
337-
int count;
337+
int count = 0;
338338

339-
count = cvmx_helper_interface_enumerate(idx);
339+
if (cvmx_helper_interface_enumerate(idx) == 0)
340+
count = cvmx_helper_ports_on_interface(idx);
340341

341342
snprintf(name_buffer, sizeof(name_buffer), "interface@%d", idx);
342343
iface = fdt_subnode_offset(initial_boot_params, pip, name_buffer);

0 commit comments

Comments
 (0)