lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181129055510.GB17675@lunn.ch>
Date:   Thu, 29 Nov 2018 06:55:10 +0100
From:   Andrew Lunn <andrew@...n.ch>
To:     Palmer Dabbelt <palmer@...ive.com>
Cc:     f.fainelli@...il.com, sergei.shtylyov@...entembedded.com,
        atish.patra@....com, schwab@...e.de, nicolas.ferre@...rochip.com,
        netdev@...r.kernel.org, linux-riscv@...ts.infradead.org,
        linux-kernel@...r.kernel.org, hkallweit1@...il.com
Subject: Re: macb: probe of 10090000.ethernet failed with error -110

>    diff --git a/drivers/net/phy/mscc.c b/drivers/net/phy/mscc.c
>    index 7cae17517744..8e0a71ee6bab 100644
>    --- a/drivers/net/phy/mscc.c
>    +++ b/drivers/net/phy/mscc.c
>    @@ -1822,6 +1822,24 @@ static int vsc85xx_probe(struct phy_device *phydev)
>     	return vsc85xx_dt_led_modes_get(phydev, default_mode);
>     }
>    +static int vsc8541_reset(struct phy_device *phydev, int value)
>    +{
>    +	WARN_ON(value != 0 || value != 1);
>    +	mdio_device_reset(&phydev->mdio, value);
>    +	if (value == 1) {
>    +		/* The VSC8541 has an unexpected feature where a single reset
>    +		 * rising edge can only be used to enter managed mode.  For
>    +		 * unmanaged mode a pair of reset rising edges is necessary.
>    +		 * */
>    +		mdio_device_reset(&phydev_mdio, 0);
>    +		mdio_device_reset(&phydev_mdio, 1);
>    +
>    +		/* After this pair of reset rising edges we must wait at least
>    +		 * 15ms before writing any phy registers. */
>    +		msleep(15);
>    +	}
>    +}
>    +
>     /* Microsemi VSC85xx PHYs */
>     static struct phy_driver vsc85xx_driver[] = {
>     {
>    @@ -1927,6 +1945,7 @@ static struct phy_driver vsc85xx_driver[] = {
>     	.get_sset_count = &vsc85xx_get_sset_count,
>     	.get_strings    = &vsc85xx_get_strings,
>     	.get_stats      = &vsc85xx_get_stats,
>    +	.reset          = &vsc8541_reset,

So if we assume you can identify the PHY using its ID registers, you
can put this reset code into the soft_reset call. That gets called
first before anything else. There is no need to add a new function to
phy_driver.

	Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ