From: Yinghai Lu <yinghai@kernel.org>
To: Kernel Mailing List <linux-kernel@vger.kernel.org>,
Yinghai Lu <yhlu.kernel@gmail.com>,
Tobias Diedrich <ranma+kernel@tdiedrich.de>,
Ayaz Abdulla <aabdulla@nvidia.com>, Jeff Garzik <jeff@garzik.org>,
"Rafael J. Wysocki" <rjw@sisk.pl>
Subject: Re: WOL with forcedeth broken since f55c21fd9a92a444e55ad1ca4e4732d56661bf2e
Date: Fri, 30 Jan 2009 00:35:33 -0800 [thread overview]
Message-ID: <86802c440901300035i6d63b8b7nc8c401c3f8b945cb@mail.gmail.com> (raw)
In-Reply-To: <86802c440901292253ie9e2a9dmb4580a3da1480c81@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 567 bytes --]
On Thu, Jan 29, 2009 at 10:53 PM, Yinghai Lu <yhlu.kernel@gmail.com> wrote:
> On Wed, Jan 28, 2009 at 10:31 PM, Philipp Matthias Hahn
> <pmhahn@titan.lahn.de> wrote:
>> Hello!
>>
>> Somewhere between 2.6.26 and 2.6.27 WOL stopped working on my MS-7350
>> motherboard with an "nVidia Corporation MCP51 Ethernet Controller (rev a3)".
>> "etherwake 00:19:db:f2:e1:35" did not work
>> "etherwake 35:e1:f2:db:19:00" did work
looks like your BIOS, already reverse the MAC addr...
please check attached ... Rafael, wonder if will break suspend/resume...
YH
[-- Attachment #2: restore_mac_orig.patch --]
[-- Type: text/x-patch, Size: 4209 bytes --]
[PATCH] forcedeth: keep mac addr to orignal
Impact: fix mac reverse for wol
some BIOS may already reverse that, try to don't touch the mac addr, so don't
confuse the WOL
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
drivers/net/forcedeth.c | 50 +++++++++++++++++++++++++++++-------------------
1 file changed, 31 insertions(+), 19 deletions(-)
Index: linux-2.6/drivers/net/forcedeth.c
===================================================================
--- linux-2.6.orig/drivers/net/forcedeth.c
+++ linux-2.6/drivers/net/forcedeth.c
@@ -748,6 +748,8 @@ struct fe_priv {
/* General data: RO fields */
dma_addr_t ring_addr;
struct pci_dev *pci_dev;
+ /* wonder if bios already reverse that */
+ int orig_mac_status;
u32 orig_mac[2];
u32 irqmask;
u32 desc_ver;
@@ -5639,14 +5641,17 @@ static int __devinit nv_probe(struct pci
/* check the workaround bit for correct mac address order */
txreg = readl(base + NvRegTransmitPoll);
if (id->driver_data & DEV_HAS_CORRECT_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;
- dev->dev_addr[2] = (np->orig_mac[0] >> 16) & 0xff;
- dev->dev_addr[3] = (np->orig_mac[0] >> 24) & 0xff;
- dev->dev_addr[4] = (np->orig_mac[1] >> 0) & 0xff;
- dev->dev_addr[5] = (np->orig_mac[1] >> 8) & 0xff;
+ np->orig_mac_status = -1;
} else if (txreg & NVREG_TRANSMITPOLL_MAC_ADDR_REV) {
+ np->orig_mac_status = 1;
+ printk(KERN_DEBUG "nv_probe: workaround bit for reversed mac addr is set\n");
+ } else {
+ np->orig_mac_status = 0;
+ writel(txreg|NVREG_TRANSMITPOLL_MAC_ADDR_REV,
+ base + NvRegTransmitPoll);
+ printk(KERN_DEBUG "nv_probe: set workaround bit for reversed mac addr\n");
+ }
+ if (np->orig_mac_status) {
/* 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;
@@ -5654,14 +5659,6 @@ static int __devinit nv_probe(struct pci
dev->dev_addr[3] = (np->orig_mac[0] >> 24) & 0xff;
dev->dev_addr[4] = (np->orig_mac[1] >> 0) & 0xff;
dev->dev_addr[5] = (np->orig_mac[1] >> 8) & 0xff;
- /*
- * Set orig mac address back to the reversed version.
- * This flag will be cleared during low power transition.
- * Therefore, we should always put back the reversed address.
- */
- np->orig_mac[0] = (dev->dev_addr[5] << 0) + (dev->dev_addr[4] << 8) +
- (dev->dev_addr[3] << 16) + (dev->dev_addr[2] << 24);
- np->orig_mac[1] = (dev->dev_addr[1] << 0) + (dev->dev_addr[0] << 8);
} else {
/* need to reverse mac address to correct order */
dev->dev_addr[0] = (np->orig_mac[1] >> 8) & 0xff;
@@ -5670,8 +5667,6 @@ static int __devinit nv_probe(struct pci
dev->dev_addr[3] = (np->orig_mac[0] >> 16) & 0xff;
dev->dev_addr[4] = (np->orig_mac[0] >> 8) & 0xff;
dev->dev_addr[5] = (np->orig_mac[0] >> 0) & 0xff;
- writel(txreg|NVREG_TRANSMITPOLL_MAC_ADDR_REV, base + NvRegTransmitPoll);
- printk(KERN_DEBUG "nv_probe: set workaround bit for reversed mac addr\n");
}
memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
@@ -5923,14 +5918,31 @@ static void nv_restore_mac_addr(struct p
{
struct net_device *dev = pci_get_drvdata(pci_dev);
struct fe_priv *np = netdev_priv(dev);
- u8 __iomem *base = get_hwbase(dev);
+ u8 __iomem *base;
+ u32 txreg;
+
+ if (np->orig_mac_status == -1)
+ return;
+
+ base = get_hwbase(dev);
+ txreg = readl(base + NvRegTransmitPoll);
+ if (np->orig_mac_status == 1) {
+ /*
+ * Set orig mac address back to the reversed version.
+ * This flag will be cleared during low power transition.
+ * Therefore, set that bit don't confuse other...
+ */
+ writel(txreg | NVREG_TRANSMITPOLL_MAC_ADDR_REV,
+ base + NvRegTransmitPoll);
+ return;
+ }
/* special op: write back the misordered MAC address - otherwise
* the next nv_probe would see a wrong address.
*/
writel(np->orig_mac[0], base + NvRegMacAddrA);
writel(np->orig_mac[1], base + NvRegMacAddrB);
- writel(readl(base + NvRegTransmitPoll) & ~NVREG_TRANSMITPOLL_MAC_ADDR_REV,
+ writel(txreg & ~NVREG_TRANSMITPOLL_MAC_ADDR_REV,
base + NvRegTransmitPoll);
}
next prev parent reply other threads:[~2009-01-30 8:35 UTC|newest]
Thread overview: 66+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-04 10:55 2.6.29-rc3-git6: Reported regressions 2.6.27 -> 2.6.28 Rafael J. Wysocki
2009-02-04 10:56 ` [Bug #11849] default IRQ affinity change in v2.6.27 (breaking several SMP PPC based systems) Rafael J. Wysocki
2009-02-04 10:58 ` [Bug #12061] snd_hda_intel: power_save: sound cracks on powerdown Rafael J. Wysocki
2009-02-04 10:58 ` [Bug #12160] networking oops after resume from s2ram (2.6.28-rc6) Rafael J. Wysocki
2009-02-04 10:58 ` [Bug #12159] 2.6.28-rc6-git1 -- No sound produced from Intel HDA ALSA driver Rafael J. Wysocki
2009-02-04 13:37 ` Miles Lane
2009-02-05 1:29 ` Rafael J. Wysocki
2009-02-04 10:58 ` [Bug #12208] uml is very slow on 2.6.28 host Rafael J. Wysocki
2009-02-04 10:58 ` [Bug #12209] oldish top core dumps (in its meminfo() function) Rafael J. Wysocki
2009-02-04 10:58 ` [Bug #12224] journal activity on inactive partition causes inactive harddrive spinup Rafael J. Wysocki
2009-02-05 2:00 ` Theodore Tso
2009-02-05 2:36 ` Andrew Morton
2009-02-04 10:58 ` [Bug #12265] FPU emulation broken in 2.6.28-rc8 ? Rafael J. Wysocki
2009-02-04 10:58 ` [Bug #12264] i915: switching from kwin in opengl mode to a VT then back to x11, x11 freezes Rafael J. Wysocki
2009-02-04 10:58 ` [Bug #12263] Sata soft reset filling log Rafael J. Wysocki
2009-02-04 10:58 ` [Bug #12391] Processor does not go below C2 state until usb.autosuspend is enabled Rafael J. Wysocki
2009-02-04 10:58 ` [Bug #12337] ~100 extra wakeups reported by powertop Rafael J. Wysocki
2009-02-04 10:58 ` [Bug #12393] debugging in dosemu causes lots of 'scheduling while atomic' Rafael J. Wysocki
2009-02-05 2:44 ` Michal Suchanek
2009-02-05 16:09 ` Rafael J. Wysocki
2009-02-05 16:25 ` Ray Lee
2009-02-04 10:58 ` [Bug #12395] 2.6.28-rc9: oprofile regression Rafael J. Wysocki
2009-02-04 10:58 ` [Bug #12396] hwinfo problem since 2.6.28 Rafael J. Wysocki
2009-02-04 14:03 ` Beschorner Daniel
2009-02-05 1:32 ` Rafael J. Wysocki
2009-02-04 10:58 ` [Bug #12401] 2.6.28 regression: xbacklight broken on ThinkPad X61s Rafael J. Wysocki
2009-02-04 10:58 ` [Bug #12405] oops in __bounce_end_io_read under kvm Rafael J. Wysocki
2009-02-06 8:13 ` Christoph Hellwig
2009-02-06 15:46 ` Rafael J. Wysocki
2009-02-04 10:58 ` [Bug #12406] 2.6.28 thinks that my PS/2 mouse is a touchpad Rafael J. Wysocki
2009-02-04 10:58 ` [Bug #12403] TTY problem on linux-2.6.28-rc7 Rafael J. Wysocki
2009-02-04 10:58 ` [Bug #12404] Oops in 2.6.28-rc9 and -rc8 -- mtrr issues / e1000e Rafael J. Wysocki
2009-02-04 10:58 ` [Bug #12407] Kernel 2.6.28 regression: Hang after hibernate Rafael J. Wysocki
2009-02-04 10:58 ` [Bug #12408] Funny problem with 2.6.28: Kernel stalls Rafael J. Wysocki
2009-02-04 10:58 ` [Bug #12411] 2.6.28: BUG in r8169 Rafael J. Wysocki
2009-02-04 10:58 ` [Bug #12409] NULL pointer dereference at get_stats() Rafael J. Wysocki
2009-02-04 10:58 ` [Bug #12426] TMDC Joystick no longer works in kernel 2.6.28 Rafael J. Wysocki
2009-02-04 13:54 ` Jiri Kosina
2009-02-05 1:34 ` Rafael J. Wysocki
2009-02-06 14:09 ` Andrew S. Johnson
2009-02-06 15:11 ` Jiri Kosina
2009-02-04 10:58 ` [Bug #12465] KVM guests stalling on 2.6.28 (bisected) Rafael J. Wysocki
2009-02-05 19:35 ` Kevin Shanahan
2009-02-05 22:37 ` Rafael J. Wysocki
2009-02-04 10:58 ` [Bug #12500] r8169: NETDEV WATCHDOG: eth0 (r8169): transmit timed out Rafael J. Wysocki
2009-02-04 10:58 ` [Bug #12520] Cannot boot 2.6.28 under Dell OptiPlex 960 Rafael J. Wysocki
2009-02-04 10:58 ` [Bug #12559] Huawei E169 doesn't work as mass storage anymore Rafael J. Wysocki
2009-02-04 10:58 ` [Bug #12612] hard lockup when interrupting cdda2wav Rafael J. Wysocki
2009-02-05 13:16 ` Matthias Reichl
2009-02-05 16:10 ` Rafael J. Wysocki
2009-02-06 7:33 ` FUJITA Tomonori
2009-02-04 10:58 ` [Bug #12614] WOL with forcedeth broken since f55c21fd9a92a444e55ad1ca4e4732d56661bf2e Rafael J. Wysocki
2009-01-29 6:31 ` Philipp Matthias Hahn
2009-01-30 6:53 ` Yinghai Lu
2009-01-30 8:35 ` Yinghai Lu [this message]
2009-01-30 21:20 ` Rafael J. Wysocki
2009-02-05 23:23 ` Philipp Matthias Hahn
2009-02-05 23:35 ` Yinghai Lu
2009-02-06 5:33 ` Philipp Matthias Hahn
2009-02-06 6:59 ` Philipp Matthias Hahn
2009-02-07 8:34 ` Philipp Matthias Hahn
2009-02-06 0:13 ` Rafael J. Wysocki
2009-02-08 15:18 ` Tobias Diedrich
2009-02-08 16:52 ` Tobias Diedrich
2009-02-09 7:28 ` Philipp Matthias Hahn
2009-02-04 10:58 ` [Bug #12619] Regression 2.6.28 and last - boot failed Rafael J. Wysocki
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=86802c440901300035i6d63b8b7nc8c401c3f8b945cb@mail.gmail.com \
--to=yinghai@kernel.org \
--cc=aabdulla@nvidia.com \
--cc=jeff@garzik.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ranma+kernel@tdiedrich.de \
--cc=rjw@sisk.pl \
--cc=yhlu.kernel@gmail.com \
/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
all inboxes | Powered by JetHome®