]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.18.114/net-phy-marvell-clear-wol-event-before-setting-it.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.18.114 / net-phy-marvell-clear-wol-event-before-setting-it.patch
1 From foo@baz Sun Jun 17 13:19:44 CEST 2018
2 From: Jingju Hou <Jingju.Hou@synaptics.com>
3 Date: Mon, 23 Apr 2018 15:22:49 +0800
4 Subject: net: phy: marvell: clear wol event before setting it
5
6 From: Jingju Hou <Jingju.Hou@synaptics.com>
7
8 [ Upstream commit b6a930fa88083b41d26ddf1cab95cbd740936c22 ]
9
10 If WOL event happened once, the LED[2] interrupt pin will not be
11 cleared unless we read the CSISR register. If interrupts are in use,
12 the normal interrupt handling will clear the WOL event. Let's clear the
13 WOL event before enabling it if !phy_interrupt_is_valid().
14
15 Signed-off-by: Jingju Hou <Jingju.Hou@synaptics.com>
16 Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
17 Signed-off-by: David S. Miller <davem@davemloft.net>
18 Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
19 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20 ---
21 drivers/net/phy/marvell.c | 9 +++++++++
22 1 file changed, 9 insertions(+)
23
24 --- a/drivers/net/phy/marvell.c
25 +++ b/drivers/net/phy/marvell.c
26 @@ -828,6 +828,15 @@ static int m88e1318_set_wol(struct phy_d
27 if (err < 0)
28 return err;
29
30 + /* If WOL event happened once, the LED[2] interrupt pin
31 + * will not be cleared unless we reading the interrupt status
32 + * register. If interrupts are in use, the normal interrupt
33 + * handling will clear the WOL event. Clear the WOL event
34 + * before enabling it if !phy_interrupt_is_valid()
35 + */
36 + if (!phy_interrupt_is_valid(phydev))
37 + phy_read(phydev, MII_M1011_IEVENT);
38 +
39 /* Enable the WOL interrupt */
40 temp = phy_read(phydev, MII_88E1318S_PHY_CSIER);
41 temp |= MII_88E1318S_PHY_CSIER_WOL_EIE;