Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1434303 > unrolled thread

[PATCH net] r8152: clear LINK_OFF_WAKE_EN after autoresume

Started byHayes Wang <hayeswang@realtek.com>
First post2016-06-30 09:40 +0200
Last post2016-07-01 12:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH net] r8152: clear LINK_OFF_WAKE_EN after autoresume Hayes Wang <hayeswang@realtek.com> - 2016-06-30 09:40 +0200
    Re: [PATCH net] r8152: clear LINK_OFF_WAKE_EN after autoresume David Miller <davem@davemloft.net> - 2016-07-01 12:10 +0200

#1434303 — [PATCH net] r8152: clear LINK_OFF_WAKE_EN after autoresume

FromHayes Wang <hayeswang@realtek.com>
Date2016-06-30 09:40 +0200
Subject[PATCH net] r8152: clear LINK_OFF_WAKE_EN after autoresume
Message-ID<rPEJQ-6JB-19@gated-at.bofh.it>
LINK_OFF_WAKE_EN should be cleared after autoresume, otherwise after
system suspend, the system would wake up when linking off occurs.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
---
 drivers/net/usb/r8152.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 4e257b8..d7f20a9 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -2421,7 +2421,18 @@ static void rtl_runtime_suspend_enable(struct r8152 *tp, bool enable)
 
 		ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CRWECR, CRWECR_NORAML);
 	} else {
+		u32 ocp_data;
+
 		__rtl_set_wol(tp, tp->saved_wolopts);
+
+		ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CRWECR, CRWECR_CONFIG);
+
+		ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_CONFIG34);
+		ocp_data &= ~LINK_OFF_WAKE_EN;
+		ocp_write_word(tp, MCU_TYPE_PLA, PLA_CONFIG34, ocp_data);
+
+		ocp_write_byte(tp, MCU_TYPE_PLA, PLA_CRWECR, CRWECR_NORAML);
+
 		r8153_u2p3en(tp, true);
 		r8153_u1u2en(tp, true);
 	}
-- 
2.4.11

[toc] | [next] | [standalone]


#1435229

FromDavid Miller <davem@davemloft.net>
Date2016-07-01 12:10 +0200
Message-ID<rQ3yx-5kw-1@gated-at.bofh.it>
In reply to#1434303
From: Hayes Wang <hayeswang@realtek.com>
Date: Thu, 30 Jun 2016 15:33:35 +0800

> LINK_OFF_WAKE_EN should be cleared after autoresume, otherwise after
> system suspend, the system would wake up when linking off occurs.
> 
> Signed-off-by: Hayes Wang <hayeswang@realtek.com>

Applied, thanks.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web