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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 13 Dec 2018 04:44:41 +0000
From:   Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>
To:     Sasha Levin <sashal@...nel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "stable@...r.kernel.org" <stable@...r.kernel.org>
CC:     "David S . Miller" <davem@...emloft.net>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: [PATCH AUTOSEL 4.19 45/73] net: phy: micrel: add toggling phy
 reset if PHY is not attached

Hi,

> From: Sasha Levin <sashal@...nel.org>, Sent: Thursday, December 13, 2018 1:28 PM
> 
> From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>
> 
> [ Upstream commit 8c85f4b81296a530b8af2796c110fa482ac42d4f ]

Since this upstream commit are reverted by the following commit,
we should not backport it.

---
commit 7b566f70e1bf65b189b66eb3de6f431c30f7dff2
Author: David S. Miller <davem@...emloft.net>
Date:   Tue Dec 4 08:47:44 2018 -0800

    phy: Revert toggling reset changes.

    This reverts:

    ef1b5bf506b1 ("net: phy: Fix not to call phy_resume() if PHY is not attached
    8c85f4b81296 ("net: phy: micrel: add toggling phy reset if PHY is not  attac

    Andrew Lunn informs me that there are alternative efforts
    underway to fix this more properly.

    Signed-off-by: David S. Miller <davem@...emloft.net>
---

Best regards,
Yoshihiro Shimoda

> This patch adds toggling phy reset if PHY is not attached. Otherwise,
> some boards (e.g. R-Car H3 Salvator-XS) cannot link up correctly if
> we do the following method:
> 
>  1) Kernel boots by using initramfs.
>  --> No open the nic, so phy_device_register() and phy_probe()
>      deasserts the reset.
>  2) Kernel enters the suspend.
>  --> So, keep the reset signal as deassert.
>  --> On R-Car Salvator-XS board, unfortunately, the board power is
>      turned off.
>  3) Kernel returns from suspend.
>  4) ifconfig eth0 up
>  --> Then, since edge signal of the reset doesn't happen,
>      it cannot link up.
>  5) ifconfig eth0 down
>  6) ifconfig eth0 up
>  --> In this case, it can link up.
> 
> Reported-by: Hiromitsu Yamasaki <hiromitsu.yamasaki.ym@...esas.com>
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>
> Signed-off-by: David S. Miller <davem@...emloft.net>
> Signed-off-by: Sasha Levin <sashal@...nel.org>
> ---
>  drivers/net/phy/micrel.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
> index 3db06b40580d..327f00034d01 100644
> --- a/drivers/net/phy/micrel.c
> +++ b/drivers/net/phy/micrel.c
> @@ -23,6 +23,7 @@
>   *			 ksz9477
>   */
> 
> +#include <linux/delay.h>
>  #include <linux/kernel.h>
>  #include <linux/module.h>
>  #include <linux/phy.h>
> @@ -725,6 +726,13 @@ static int kszphy_resume(struct phy_device *phydev)
>  {
>  	int ret;
> 
> +	if (!phydev->attached_dev) {
> +		/* If the PHY is not attached, toggle the reset */
> +		phy_device_reset(phydev, 1);
> +		udelay(1);
> +		phy_device_reset(phydev, 0);
> +	}
> +
>  	genphy_resume(phydev);
> 
>  	ret = kszphy_config_reset(phydev);
> --
> 2.19.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ