LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: netdev@vger.kernel.org, michael.pyne@kdemail.net,
	AAbdulla@nvidia.com, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [patch 2/4] forcedeth: fix MAC address detection on network card (regression in 2.6.23)
Date: Tue, 05 Feb 2008 14:08:45 -0500	[thread overview]
Message-ID: <47A8B43D.5070601@garzik.org> (raw)
In-Reply-To: <20080205105909.fd8c6dbe.akpm@linux-foundation.org>

[-- Attachment #1: Type: text/plain, Size: 619 bytes --]

Andrew Morton wrote:
> On Tue, 05 Feb 2008 13:20:59 -0500 Jeff Garzik <jeff@garzik.org> wrote:
> 
>>> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
>> NAK - this fixes one set of users, and breaks a working set of users.
>>
>> Need to add DMI check for the specific motherboard (dmi_check_system), 
>> and flip flag according to success/failure of that check.
> 
> OK :)  I added the above to the changelog for next time.
> 
> You guys can hide, but this patch isn't going away!

In the original thread, I even posted a 
fill-in-the-blanks-with-the-motherboard-name patch.  I'll attach it again...

	Jeff




[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 1459 bytes --]

diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 3634223..eab85fa 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -147,6 +147,7 @@
 #include <linux/init.h>
 #include <linux/if_vlan.h>
 #include <linux/dma-mapping.h>
+#include <linux/dmi.h>
 
 #include <asm/irq.h>
 #include <asm/io.h>
@@ -4992,6 +4993,26 @@ static int nv_close(struct net_device *dev)
 	return 0;
 }
 
+static int nv_reversed_macaddr(void)
+{
+	static const struct dmi_system_id sysids[] = {
+		{
+			.ident = "",
+			.matches = {
+				DMI_MATCH(DMI_SYS_VENDOR, ""),
+				DMI_MATCH(DMI_PRODUCT_NAME, ""),
+			},
+		},
+
+		{ }	/* terminate list */
+	};
+
+	if (dmi_check_system(sysids))
+		return 1;
+	
+	return 0;
+}
+
 static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_id *id)
 {
 	struct net_device *dev;
@@ -5187,8 +5208,9 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
 
 	/* check the workaround bit for correct mac address order */
 	txreg = readl(base + NvRegTransmitPoll);
-	if ((txreg & NVREG_TRANSMITPOLL_MAC_ADDR_REV) ||
-	    (id->driver_data & DEV_HAS_CORRECT_MACADDR)) {
+	if (((txreg & NVREG_TRANSMITPOLL_MAC_ADDR_REV) ||
+	    (id->driver_data & DEV_HAS_CORRECT_MACADDR))) &&
+	    (!nv_reversed_macaddr())) {
 		/* mac address is already in correct order */
 		dev->dev_addr[0] = (np->orig_mac[0] >>  0) & 0xff;
 		dev->dev_addr[1] = (np->orig_mac[0] >>  8) & 0xff;

      parent reply	other threads:[~2008-02-05 19:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200802050746.m157ktY9010399@imap1.linux-foundation.org>
2008-02-05 18:20 ` [patch 2/4] forcedeth: fix MAC address detection on network card (regression in 2.6.23) Jeff Garzik
2008-02-05 18:38   ` H. Peter Anvin
2008-02-05 18:42     ` Jeff Garzik
2008-02-05 20:11       ` H. Peter Anvin
2008-02-05 18:59   ` Andrew Morton
2008-02-04 17:33     ` Ayaz Abdulla
2008-02-05 19:13       ` Jeff Garzik
2008-02-04 17:57         ` Ayaz Abdulla
2008-02-06  2:06           ` [patch 2/4] forcedeth: fix MAC address detection on network card (regression in 2.6.23) \0 Michael Pyne
2008-02-05 19:08     ` Jeff Garzik [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47A8B43D.5070601@garzik.org \
    --to=jeff@garzik.org \
    --cc=AAbdulla@nvidia.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.pyne@kdemail.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).