am3517: davinci_emac always generates a random mac-address

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

When no valid mac address is set in the device tree, a random one
is generated on linux 4.8. This happens because since the instance
is selected as 1 in net/ethernet/ti/davinci_emac.c instead of 0.

    res_ctrl = platform_get_resource(pdev, IORESOURCE_MEM, 1);

        ....

    rc = davinci_emac_try_get_mac(pdev, res_ctrl ? 0 : 1, priv->mac_addr);
    if (!rc)
        ether_addr_copy(ndev->dev_addr, priv->mac_addr);


To get the correct mac address the instance needs to be 0.
Shouldn't / can the instance be the other way around, so the
instance is 0 in the non special case?

Above is done unconditionally, so if a mac address was given
from the device tree it will get overwritten.. So it should be
within a if (!is_valid_ether_addr(priv->mac_addr)) it seems.

With kind regards,

Jeroen

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux