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:   Fri, 29 Nov 2019 14:00:23 +0100
From:   Pavel Machek <pavel@...x.de>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     linux-kernel@...r.kernel.org, stable@...r.kernel.org,
        Florian Fainelli <f.fainelli@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Sasha Levin <sashal@...nel.org>
Subject: Re: [PATCH 4.19 223/306] net: dsa: bcm_sf2: Turn on PHY to allow
 successful registration

Hi!

> From: Florian Fainelli <f.fainelli@...il.com>
> 
> [ Upstream commit c04a17d2a9ccf1eaba1c5a56f83e997540a70556 ]
> 
> We are binding to the PHY using the SF2 slave MDIO bus that we create,
> binding involves reading the PHY's MII_PHYSID1/2 which won't be possible
> if the PHY is turned off. Temporarily turn it on/off for the bus probing
> to succeeed. This fixes unbind/bind problems where the port connecting
> to that PHY would be in error since it could not connect to it.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@...il.com>
> Signed-off-by: David S. Miller <davem@...emloft.net>
> Signed-off-by: Sasha Levin <sashal@...nel.org>
> ---
>  drivers/net/dsa/bcm_sf2.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
> index ca3655d28e00f..17cec68e56b4f 100644
> --- a/drivers/net/dsa/bcm_sf2.c
> +++ b/drivers/net/dsa/bcm_sf2.c
> @@ -1099,12 +1099,16 @@ static int bcm_sf2_sw_probe(struct platform_device *pdev)
>  		return ret;
>  	}
>  
> +	bcm_sf2_gphy_enable_set(priv->dev->ds, true);
> +
>  	ret = bcm_sf2_mdio_register(ds);
>  	if (ret) {
>  		pr_err("failed to register MDIO bus\n");
>  		return ret;
>  	}
>  
> +	bcm_sf2_gphy_enable_set(priv->dev->ds, false);
> +

This fails to turn off the PHY in the error case. Reordering like this
should fix it:

  	ret = bcm_sf2_mdio_register(ds);
 +	bcm_sf2_gphy_enable_set(priv->dev->ds, false);
  	if (ret) {
  		pr_err("failed to register MDIO bus\n");
  		return ret;
  	}
  
Best regards,
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ