* [patch for 2.6.27? 6/6] net: forcedeth: call restore mac addr in nv_shutdown path
@ 2008-09-05 21:04 akpm
2008-09-09 5:25 ` Simon Horman
0 siblings, 1 reply; 2+ messages in thread
From: akpm @ 2008-09-05 21:04 UTC (permalink / raw)
To: jeff; +Cc: netdev, akpm, yhlu.kernel, aabdulla, jgarzik, ranma+kernel, rjw
From: Yinghai Lu <yhlu.kernel@gmail.com>
after
| commit f735a2a1a4f2a0f5cd823ce323e82675990469e2
| Author: Tobias Diedrich <ranma+kernel@tdiedrich.de>
| Date: Sun May 18 15:02:37 2008 +0200
|
| [netdrvr] forcedeth: setup wake-on-lan before shutting down
|
| When hibernating in 'shutdown' mode, after saving the image the suspend hook
| is not called again.
| However, if the device is in promiscous mode, wake-on-lan will not work.
| This adds a shutdown hook to setup wake-on-lan before the final shutdown.
|
| Signed-off-by: Tobias Diedrich <ranma+kernel@tdiedrich.de>
| Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
my servers with nvidia ck804 and mcp55 will reverse mac address with kexec.
it turns out that we need to restore the mac addr in nv_shutdown().
[akpm@linux-foundation.org: fix typo in printk]
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Cc: Tobias Diedrich <ranma+kernel@tdiedrich.de>
Cc: Ayaz Abdulla <aabdulla@nvidia.com>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/net/forcedeth.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff -puN drivers/net/forcedeth.c~net-forcedeth-call-restore-mac-addr-in-nv_shutdown-path-v2 drivers/net/forcedeth.c
--- a/drivers/net/forcedeth.c~net-forcedeth-call-restore-mac-addr-in-nv_shutdown-path-v2
+++ a/drivers/net/forcedeth.c
@@ -5651,6 +5651,7 @@ static int __devinit nv_probe(struct pci
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);
@@ -5898,14 +5899,12 @@ static void nv_restore_phy(struct net_de
}
}
-static void __devexit nv_remove(struct pci_dev *pci_dev)
+static void nv_restore_mac_addr(struct pci_dev *pci_dev)
{
struct net_device *dev = pci_get_drvdata(pci_dev);
struct fe_priv *np = netdev_priv(dev);
u8 __iomem *base = get_hwbase(dev);
- unregister_netdev(dev);
-
/* special op: write back the misordered MAC address - otherwise
* the next nv_probe would see a wrong address.
*/
@@ -5913,6 +5912,15 @@ static void __devexit nv_remove(struct p
writel(np->orig_mac[1], base + NvRegMacAddrB);
writel(readl(base + NvRegTransmitPoll) & ~NVREG_TRANSMITPOLL_MAC_ADDR_REV,
base + NvRegTransmitPoll);
+}
+
+static void __devexit nv_remove(struct pci_dev *pci_dev)
+{
+ struct net_device *dev = pci_get_drvdata(pci_dev);
+
+ unregister_netdev(dev);
+
+ nv_restore_mac_addr(pci_dev);
/* restore any phy related changes */
nv_restore_phy(dev);
@@ -5990,6 +5998,8 @@ static void nv_shutdown(struct pci_dev *
if (netif_running(dev))
nv_close(dev);
+ nv_restore_mac_addr(pdev);
+
pci_disable_device(pdev);
if (system_state == SYSTEM_POWER_OFF) {
if (pci_enable_wake(pdev, PCI_D3cold, np->wolenabled))
_
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [patch for 2.6.27? 6/6] net: forcedeth: call restore mac addr in nv_shutdown path
2008-09-05 21:04 [patch for 2.6.27? 6/6] net: forcedeth: call restore mac addr in nv_shutdown path akpm
@ 2008-09-09 5:25 ` Simon Horman
0 siblings, 0 replies; 2+ messages in thread
From: Simon Horman @ 2008-09-09 5:25 UTC (permalink / raw)
To: akpm; +Cc: jeff, netdev, yhlu.kernel, aabdulla, jgarzik, ranma+kernel, rjw
On Fri, Sep 05, 2008 at 02:04:10PM -0700, akpm@linux-foundation.org wrote:
> From: Yinghai Lu <yhlu.kernel@gmail.com>
>
> after
>
> | commit f735a2a1a4f2a0f5cd823ce323e82675990469e2
> | Author: Tobias Diedrich <ranma+kernel@tdiedrich.de>
> | Date: Sun May 18 15:02:37 2008 +0200
> |
> | [netdrvr] forcedeth: setup wake-on-lan before shutting down
> |
> | When hibernating in 'shutdown' mode, after saving the image the suspend hook
> | is not called again.
> | However, if the device is in promiscous mode, wake-on-lan will not work.
> | This adds a shutdown hook to setup wake-on-lan before the final shutdown.
> |
> | Signed-off-by: Tobias Diedrich <ranma+kernel@tdiedrich.de>
> | Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
>
> my servers with nvidia ck804 and mcp55 will reverse mac address with kexec.
>
> it turns out that we need to restore the mac addr in nv_shutdown().
Does this problem also occur during kdump?
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-09-09 5:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-05 21:04 [patch for 2.6.27? 6/6] net: forcedeth: call restore mac addr in nv_shutdown path akpm
2008-09-09 5:25 ` Simon Horman
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).