* [PATCH] r8169: WakeOnLan fix for the 8168
@ 2009-07-24 22:34 Francois Romieu
2009-07-27 3:19 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Francois Romieu @ 2009-07-24 22:34 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Jaromír Cápík, Edward Hsu
More stuff for http://bugzilla.kernel.org/show_bug.cgi?id=9512
Some 8168 are unable to WoL when receiving is not enabled (plain
old 8169 do not seem to care).
It is not exactly pretty to leave the receiver enabled but we
should now enable DMA late enough for it to be safe. Some late
stage boot failure due to pxe and friends may benefit from the
delayed enabling of bus-mastering as well.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Tested-by: Jaromír Cápík <tavvva@volny.cz>
Cc: Edward Hsu <edward_hsu@realtek.com.tw>
---
drivers/net/r8169.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 4b53b58..b82780d 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -2060,8 +2060,6 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
}
}
- pci_set_master(pdev);
-
/* ioremap MMIO region */
ioaddr = ioremap(pci_resource_start(pdev, region), R8169_REGS_SIZE);
if (!ioaddr) {
@@ -2089,6 +2087,8 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
RTL_W16(IntrStatus, 0xffff);
+ pci_set_master(pdev);
+
/* Identify chip attached to board */
rtl8169_get_mac_version(tp, ioaddr);
@@ -3874,6 +3874,15 @@ static void rtl_shutdown(struct pci_dev *pdev)
spin_unlock_irq(&tp->lock);
if (system_state == SYSTEM_POWER_OFF) {
+ /* WoL fails with some 8168 when the receiver is disabled. */
+ if (tp->features & RTL_FEATURE_WOL) {
+ pci_clear_master(pdev);
+
+ RTL_W8(ChipCmd, CmdRxEnb);
+ /* PCI commit */
+ RTL_R8(ChipCmd);
+ }
+
pci_wake_from_d3(pdev, true);
pci_set_power_state(pdev, PCI_D3hot);
}
--
1.6.2.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] r8169: WakeOnLan fix for the 8168
2009-07-24 22:34 [PATCH] r8169: WakeOnLan fix for the 8168 Francois Romieu
@ 2009-07-27 3:19 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2009-07-27 3:19 UTC (permalink / raw)
To: romieu; +Cc: netdev, tavvva, edward_hsu
From: Francois Romieu <romieu@fr.zoreil.com>
Date: Sat, 25 Jul 2009 00:34:19 +0200
> More stuff for http://bugzilla.kernel.org/show_bug.cgi?id=9512
>
> Some 8168 are unable to WoL when receiving is not enabled (plain
> old 8169 do not seem to care).
>
> It is not exactly pretty to leave the receiver enabled but we
> should now enable DMA late enough for it to be safe. Some late
> stage boot failure due to pxe and friends may benefit from the
> delayed enabling of bus-mastering as well.
>
> Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
> Tested-by: Jaromír Cápík <tavvva@volny.cz>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-07-27 3:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-24 22:34 [PATCH] r8169: WakeOnLan fix for the 8168 Francois Romieu
2009-07-27 3:19 ` David Miller
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).