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

Re: Annoying problem with udev

On 29/11/2010 20:27, Frans van Berckel wrote:
On Mon, 2010-11-29 at 17:05 +0000, Richard Mortimer wrote:
Both devices have local-mac-address properties in the device tree. That
suggests that there is something wrong with the logic in driver itself.


I had a quick look at the 2.3.36 driver on kernel.org


and a cursory look at that shows code for parsing local-mac-address
(circa line 3290). I haven't looked very deeply but it seems like the
driver is failing to read the VPD rom and falling back onto a random

There doesn't seem to be anything obvious in the recent history that
suggests where this might have been fixed.

Next step would likely be to try a 2.6.36 kernel to see whether it
already has a fix etc.

Thanks for looking into it Richard, but the stable does not boot at all, with a serial console on Sparc64. But that's outside the scoop of the cassini driver stuff we are looking for.


Having had another glance at the code I suspect that will not get the MAC addresses right either but we really need to confirm that before pushing upstream.

Unfortunately I don't have a build infrastructure setup or a machine to compile/test against but I suspect that the eventual fix will be fairly simple to do. Basically when cas_get_vpd_info in cassini.c fails to read the MAC from the ROM and drops down to the "use_random_mac_addr" label it should test for the local-mac-address property in the same way that gem_get_device_address does in gem.c. If that doesn't work then fallback to the current random address.

i.e. insert the following (with a bit of cleanup to make the of_node available at that point and fall through to the random address stuff instead of the KERN_ERR bit).

#if defined(CONFIG_SPARC) || defined(CONFIG_PPC_PMAC)
        struct net_device *dev = gp->dev;
        const unsigned char *addr;

        addr = of_get_property(gp->of_node, "local-mac-address", NULL);
        if (addr == NULL) {
                addr = idprom->id_ethaddr;
                printk(KERN_ERR "%s: can't get mac-address\n", dev->name);
                return -1;
        memcpy(dev->dev_addr, addr, 6);



Reply to: