Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp8053928ybc; Fri, 29 Nov 2019 05:02:40 -0800 (PST) X-Google-Smtp-Source: APXvYqx3eJwQZMZVObpEA9AYNFpiXuGK23ZGnS6BSfziFIj//Kod2xeSWBVg1PWU2BaYLiT0AJiz X-Received: by 2002:a19:cc08:: with SMTP id c8mr35155458lfg.124.1575032559907; Fri, 29 Nov 2019 05:02:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575032559; cv=none; d=google.com; s=arc-20160816; b=NzkrzaN7M9HlHN/mW6/C4w7fnnuSJkY1mlRouj8rVrGj5h/uK7deZ+zNEVMko4PTvF dOev6JEux+Z+80shm8MIdqFMB0XF5sEtOwRRE6/TiwpMi94kgIx7kQJRCIvOhtCqj1+s og5uCEsV36KCAU2YkzPMJudU9NChlPJk3Fecr1Wkp3iYYYSliqUiTJtli2L+BVoM17XK +jJ1cSNKCTDnjW0Zn2kIL8DqJTk/ZkF7uUcApHsM9OSUsGPOSQAkLuZEn12QGY9UqiJK /r8VyinbQcxsRgaQOyxOAbs2K3fOWhnspeI/y7vAGusa/BEJSA9Nn7MxAfKQmmQHbpBz aHtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=6uLhX2s84T3ZLvrJSIq6ldy7s4d4NdmgHO0UOECEHNM=; b=vlsAakKqHbbZPCLBvE9GX0vzDusJls7ItzHgjhGEmwVPlZ3V2pzBDn9m0RXqXL9jNO i3QMAQkiH7HVLPFbR5MeA0oM7n/evUCK1gAwU6j8qUPrgO2McDa0IBzKEnEUroI72T1/ hDsZ6oZHhcLlzyQ0evCqTwysF0t5v8DZw04tDh0rc04WqPU54O4f7zvlNrsRmw4GDqWk JI+Y6ynHHGJFJQBY8QvQfOLXIkQuwNWrj5wBKlsUGZzObzW7X2SqiNxwTOgxhAzJyPfG mwVthgntq/7jANWLfsTPgc10EuwjaqzV4rje+y0aCW5+2sJIXEo8D+VyIJJA6rh8XvXd Um3Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g6si512383lfh.140.2019.11.29.05.02.09; Fri, 29 Nov 2019 05:02:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726878AbfK2NA0 (ORCPT + 99 others); Fri, 29 Nov 2019 08:00:26 -0500 Received: from jabberwock.ucw.cz ([46.255.230.98]:51850 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726360AbfK2NA0 (ORCPT ); Fri, 29 Nov 2019 08:00:26 -0500 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 370921C2463; Fri, 29 Nov 2019 14:00:24 +0100 (CET) Date: Fri, 29 Nov 2019 14:00:23 +0100 From: Pavel Machek To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Florian Fainelli , "David S. Miller" , Sasha Levin Subject: Re: [PATCH 4.19 223/306] net: dsa: bcm_sf2: Turn on PHY to allow successful registration Message-ID: <20191129130023.GA7809@amd> References: <20191127203114.766709977@linuxfoundation.org> <20191127203131.347612884@linuxfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tKW2IUtsqtDRztdT" Content-Disposition: inline In-Reply-To: <20191127203131.347612884@linuxfoundation.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --tKW2IUtsqtDRztdT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > From: Florian Fainelli >=20 > [ Upstream commit c04a17d2a9ccf1eaba1c5a56f83e997540a70556 ] >=20 > 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. >=20 > Signed-off-by: Florian Fainelli > Signed-off-by: David S. Miller > Signed-off-by: Sasha Levin > --- > drivers/net/dsa/bcm_sf2.c | 4 ++++ > 1 file changed, 4 insertions(+) >=20 > 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_devic= e *pdev) > return ret; > } > =20 > + bcm_sf2_gphy_enable_set(priv->dev->ds, true); > + > ret =3D bcm_sf2_mdio_register(ds); > if (ret) { > pr_err("failed to register MDIO bus\n"); > return ret; > } > =20 > + 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 =3D 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; } =20 Best regards, Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --tKW2IUtsqtDRztdT Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAl3hFmcACgkQMOfwapXb+vKB0ACgn7bNTsp42GpDv+r0VLMRWvJy VZ4AnjyFzFilf9D4/DNFpG9q8Xf0B7N5 =Tao/ -----END PGP SIGNATURE----- --tKW2IUtsqtDRztdT--