Skip to contentSkip to conversation

via-rhine: Work around invalid MAC address error

PATCH In review Alex G. 2 participants 3 messages Mar 9, 2011 – Mar 10, 2011

Subsystems (2)
lore
Share & tools
lore

Alex G.

author
#0 lore raw

PATCH 1/1 via-rhine: Work around invalid MAC address error

via-rhine drops out of the init code if the hardware provides an invalid MAC address. Roger Luethi has had several reports of Rhine NICs doing just that. The hardware still works, though; assigning a random MAC address allows the NIC to be used as usual. Tested as a standalone interface, as carrier for ppp, and as bonding slave.

drivers/net/via-rhine.c renamed from drivers/net/via-rhine.c.orig +8 -5
index 4930f9d..4c1b9e7 100644
@@ -762,13 +762,16 @@ static int __devinit rhine_init_one(struct pci_dev *pdev,
 
 	for (i = 0; i < 6; i++)
 		dev->dev_addr[i] = ioread8(ioaddr + StationAddr + i);
-	memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
 
-	if (!is_valid_ether_addr(dev->perm_addr)) {
-		rc = -EIO;
-		printk(KERN_ERR "Invalid MAC address\n");
-		goto err_out_unmap;
+	if (!is_valid_ether_addr(dev->dev_addr)) {
+		printk(KERN_ERR "via-rhine: Invalid MAC address: %pM. \n",
+				dev->dev_addr);
+		/* The device may still be used normally if a valid MAC is configured */
+		random_ether_addr(dev->dev_addr);
+		printk(KERN_ERR "via-rhine: Using randomly generated address: %pM instead. \n",
+				dev->dev_addr);
 	}
+	memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
 
 	/* For Rhine-I/II, phy_id is loaded from EEPROM */
 	if (!phy_id)
maintainer
#1 lore raw

From: "Alex G." <[email protected]>
Date: Wed, 09 Mar 2011 23:34:11 +0200

drivers/net/via-rhine.c

Quoted 12 lines

via-rhine drops out of the init code if the hardware provides an invalid MAC address. Roger Luethi has had several reports of Rhine NICs doing just that. The hardware still works, though; assigning a random MAC address allows the NIC to be used as usual. Tested as a standalone interface, as carrier for ppp, and as bonding slave.

drivers/net/via-rhine.c renamed from drivers/net/via-rhine.c.orig +0 -0
index 4930f9d..4c1b9e7 100644

This is getting rediculious:

davem@sunset:~/src/GIT/net-2.6$ git apply --check --whitespace=error-all via-rhine-Work-around-invalid-MAC-address-error.patch
error: drivers/net/via-rhine.c.orig: No such file or directory
davem@sunset:~/src/GIT/net-2.6$ 
davem@sunset:~/src/GIT/net-2.6$ git am --signoff via-rhine-Work-around-invalid-MAC-address-error.patch 
Applying: via-rhine: Work around invalid MAC address error
error: drivers/net/via-rhine.c.orig: does not exist in index
Patch failed at 0001 via-rhine: Work around invalid MAC address error
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".
You have new mail in /var/mail/davem
davem@sunset:~/src/GIT/net-2.6$ git am --abort

Sorry.

I'm going to ignore you're postings for a day or two, I've already invested an enormous amount of time and energy into getting you to submit patches which are properly formed and actually get accepted by the tools that we all use. Nobody else has these kinds of problems and can submit properly formed patches.

I would strongly suggest that you try to email the patch to yourself, save the email into a file, and feed it to "git am" on a fresh tree, making sure that when then looking at what the resulting commit looks like.

author
#2 lore raw
Quoted 2 lines · David Miller

Sorry.

Don't sweat it.

Quoted 1 line

I'm going to ignore you're postings for a day or two,

That means I can bash you and you won't notice too soon.

Quoted 4 lines

I've already
invested an enormous amount of time and energy into getting you to submit patches which are properly formed and actually get accepted by the tools that we all use.

You have done nothing more than point me to obsolete documentation, and bash me after following it. If the the less than five minutes of your life that you have spent giving me short, uninformative, or outright wrong information are "an enormous amount of time and energy", please tell me how much you get paid an hour, so that I can pay you for those minutes (preferably via PayPal). Please be advised, that I will ask my bank for a chargeback should it come to this.

Quoted 3 lines

Nobody else has these kinds of problems
and can submit properly formed patches.

I assume this tool is" git". If so, it is called "git" for a reason.

I simply wanted to fix a problem I found. I don't know what tools you are using, how they work, etc. Please don't expect me to guess. If you want _everybody_ to get it right the first time, then have the decency to update the fucking documentation, before insolently directing people to it.

Quoted 4 lines

I would strongly suggest that you try to email the patch to yourself, save the email into a file, and feed it to "git am" on a fresh tree, making sure that when then looking at what the resulting commit looks like.

Now this is the first useful bit of information you have bothered giving me this whole time.

Alex