diff mbox

r8169: remember WOL preferences on driver load

Message ID 1376730002-9235-1-git-send-email-lekensteyn@gmail.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Peter Wu Aug. 17, 2013, 9 a.m. UTC
From: Peter Wu <lekensteyn@gmail.com>

Do not clear Broadcast/Multicast/Unicast Wake Flag or LanWake in
Config5. This is necessary to preserve WOL state when the driver is
loaded. Although the r8168 vendor driver does not write Config5 (it has
been commented out), Hayes Wang from Realtek said that masking bits like
this is more sensible.

Signed-off-by: Peter Wu <lekensteyn@gmail.com>
---
 drivers/net/ethernet/realtek/r8169.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Miller Aug. 20, 2013, 10:10 p.m. UTC | #1
From: Peter Wu <lekensteyn@gmail.com>
Date: Sat, 17 Aug 2013 11:00:02 +0200

> From: Peter Wu <lekensteyn@gmail.com>
> 
> Do not clear Broadcast/Multicast/Unicast Wake Flag or LanWake in
> Config5. This is necessary to preserve WOL state when the driver is
> loaded. Although the r8168 vendor driver does not write Config5 (it has
> been commented out), Hayes Wang from Realtek said that masking bits like
> this is more sensible.
> 
> Signed-off-by: Peter Wu <lekensteyn@gmail.com>

Can I get some reviews and Ack's for this?

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Francois Romieu Aug. 20, 2013, 11:12 p.m. UTC | #2
David Miller <davem@davemloft.net> :
[...]
> > Signed-off-by: Peter Wu <lekensteyn@gmail.com>
> 
> Can I get some reviews and Ack's for this?

It's more consistent with the {get / set}_wol parts of the driver and
it's done in a way both Hayes and myself agreed on during the previous
messages.

So you can consider it:

Acked-by: Francois Romieu <romieu@fr.zoreil.com>
David Miller Aug. 20, 2013, 11:48 p.m. UTC | #3
From: Francois Romieu <romieu@fr.zoreil.com>
Date: Wed, 21 Aug 2013 01:12:01 +0200

> David Miller <davem@davemloft.net> :
> [...]
>> > Signed-off-by: Peter Wu <lekensteyn@gmail.com>
>> 
>> Can I get some reviews and Ack's for this?
> 
> It's more consistent with the {get / set}_wol parts of the driver and
> it's done in a way both Hayes and myself agreed on during the previous
> messages.
> 
> So you can consider it:
> 
> Acked-by: Francois Romieu <romieu@fr.zoreil.com>

Thanks, applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 2943916..104eaef 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -7092,7 +7092,7 @@  rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	RTL_W8(Cfg9346, Cfg9346_Unlock);
 	RTL_W8(Config1, RTL_R8(Config1) | PMEnable);
-	RTL_W8(Config5, RTL_R8(Config5) & PMEStatus);
+	RTL_W8(Config5, RTL_R8(Config5) & (BWF | MWF | UWF | LanWake | PMEStatus));
 	if ((RTL_R8(Config3) & (LinkUp | MagicPacket)) != 0)
 		tp->features |= RTL_FEATURE_WOL;
 	if ((RTL_R8(Config5) & (UWF | BWF | MWF)) != 0)