diff mbox series

[U-Boot] net: sun8i_emac: Fix PHY initialization

Message ID 20180128055320.29424-1-samuel@sholland.org
State Accepted
Commit 2d53018a0ef268ba73aebe2441f1fd7c65533d78
Delegated to: Jagannadha Sutradharudu Teki
Headers show
Series [U-Boot] net: sun8i_emac: Fix PHY initialization | expand

Commit Message

Samuel Holland Jan. 28, 2018, 5:53 a.m. UTC
The previous code tried to update the PHY parameters without waiting for
autonegotiation to complete. This caused wrong values to be written to
the EMAC in sun8i_adjust_link(). As a result, any commands that called
eth_start() before autonegotiation completed would find the network
nonfunctional. Fix this by using the correct function to start up the
PHY.

Signed-off-by: Samuel Holland <samuel@sholland.org>
---
 drivers/net/sun8i_emac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Joe Hershberger Feb. 27, 2018, 10:17 p.m. UTC | #1
On Sat, Jan 27, 2018 at 11:53 PM, Samuel Holland <samuel@sholland.org> wrote:
> The previous code tried to update the PHY parameters without waiting for
> autonegotiation to complete. This caused wrong values to be written to
> the EMAC in sun8i_adjust_link(). As a result, any commands that called
> eth_start() before autonegotiation completed would find the network
> nonfunctional. Fix this by using the correct function to start up the
> PHY.
>
> Signed-off-by: Samuel Holland <samuel@sholland.org>

Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Jagan Teki March 13, 2018, 3:48 p.m. UTC | #2
On Wed, Feb 28, 2018 at 3:47 AM, Joe Hershberger <joe.hershberger@ni.com> wrote:
> On Sat, Jan 27, 2018 at 11:53 PM, Samuel Holland <samuel@sholland.org> wrote:
>> The previous code tried to update the PHY parameters without waiting for
>> autonegotiation to complete. This caused wrong values to be written to
>> the EMAC in sun8i_adjust_link(). As a result, any commands that called
>> eth_start() before autonegotiation completed would find the network
>> nonfunctional. Fix this by using the correct function to start up the
>> PHY.
>>
>> Signed-off-by: Samuel Holland <samuel@sholland.org>
>
> Acked-by: Joe Hershberger <joe.hershberger@ni.com>

Applied to u-boot-sunxi/master
diff mbox series

Patch

diff --git a/drivers/net/sun8i_emac.c b/drivers/net/sun8i_emac.c
index 3ccc6b0bb6..be43472b1a 100644
--- a/drivers/net/sun8i_emac.c
+++ b/drivers/net/sun8i_emac.c
@@ -431,7 +431,7 @@  static int _sun8i_emac_eth_init(struct emac_eth_dev *priv, u8 *enetaddr)
 	tx_descs_init(priv);
 
 	/* PHY Start Up */
-	genphy_parse_link(priv->phydev);
+	phy_startup(priv->phydev);
 
 	sun8i_adjust_link(priv, priv->phydev);