apm821xx: explicitly build the rootfs.img.gz target
[oweals/openwrt.git] / target / linux / mvebu / patches-4.9 / 473-fix-marvell-phy-initialization-issues.patch
1 From: Marko Ratkaj <marko.ratkaj@sartura.hr>
2 Date: Fri, 7 Apr 2017 13:30:30 +0200
3 Subject: [PATCH] fix marvell phy initialization issues
4
5 Fix Marvell PHYs initialization issues and optimize
6 logic for page changing during init
7
8 Board affected with initialization bug:
9   SolidRun ClearFog Base
10
11 Signed-off-by: Marko Ratkaj <marko.ratkaj@sartura.hr>
12 ---
13  drivers/net/phy/marvell.c | 9 ++++-----
14  1 file changed, 4 insertions(+), 5 deletions(-)
15
16 --- a/drivers/net/phy/marvell.c
17 +++ b/drivers/net/phy/marvell.c
18 @@ -369,7 +369,7 @@ static int m88e1111_config_aneg(struct p
19  static int marvell_of_reg_init(struct phy_device *phydev)
20  {
21         const __be32 *paddr;
22 -       int len, i, saved_page, current_page, page_changed, ret;
23 +       int len, i, saved_page, current_page, ret;
24  
25         if (!phydev->mdio.dev.of_node)
26                 return 0;
27 @@ -382,7 +382,6 @@ static int marvell_of_reg_init(struct ph
28         saved_page = phy_read(phydev, MII_MARVELL_PHY_PAGE);
29         if (saved_page < 0)
30                 return saved_page;
31 -       page_changed = 0;
32         current_page = saved_page;
33  
34         ret = 0;
35 @@ -396,7 +395,6 @@ static int marvell_of_reg_init(struct ph
36  
37                 if (reg_page != current_page) {
38                         current_page = reg_page;
39 -                       page_changed = 1;
40                         ret = phy_write(phydev, MII_MARVELL_PHY_PAGE, reg_page);
41                         if (ret < 0)
42                                 goto err;
43 @@ -419,7 +417,7 @@ static int marvell_of_reg_init(struct ph
44  
45         }
46  err:
47 -       if (page_changed) {
48 +       if (current_page != saved_page) {
49                 i = phy_write(phydev, MII_MARVELL_PHY_PAGE, saved_page);
50                 if (ret == 0)
51                         ret = i;