procd: update to latest git HEAD
[openwrt/staging/wigyori.git] / target / linux / ath79 / patches-5.4 / 201-ag71xx-Call-ag71xx_hw_disable-in-case-phy_conenct-fa.patch
1 From 2f8c5a68d0030ae5e65fca1bf5ca44929d5b3b06 Mon Sep 17 00:00:00 2001
2 From: Hauke Mehrtens <hauke@hauke-m.de>
3 Date: Mon, 17 Feb 2020 23:50:23 +0100
4 Subject: [PATCH 2/3] ag71xx: Call ag71xx_hw_disable() in case phy_conenct
5 fails
6
7 When the ag71xx_phy_connect() failed only parts of the actions done
8 previously in this function wrere reverted, because only
9 ag71xx_rings_cleanup() was called. My system crashed the next time
10 open() was called because napi_disable() was not called again and this
11 resulted in two calls to napi_enable(), which is not allowed.
12
13 Fix this by disabling the device again.
14
15 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
16 Fixes: d51b6ce441d3 ("net: ethernet: add ag71xx driver")
17 ---
18 drivers/net/ethernet/atheros/ag71xx.c | 8 ++++----
19 1 file changed, 4 insertions(+), 4 deletions(-)
20
21 --- a/drivers/net/ethernet/atheros/ag71xx.c
22 +++ b/drivers/net/ethernet/atheros/ag71xx.c
23 @@ -1263,18 +1263,18 @@ static int ag71xx_open(struct net_device
24
25 ret = ag71xx_hw_enable(ag);
26 if (ret)
27 - goto err;
28 + return ret;
29
30 ret = ag71xx_phy_connect(ag);
31 if (ret)
32 - goto err;
33 + goto err_hw_disable;
34
35 phy_start(ndev->phydev);
36
37 return 0;
38
39 -err:
40 - ag71xx_rings_cleanup(ag);
41 +err_hw_disable:
42 + ag71xx_hw_disable(ag);
43 return ret;
44 }
45