Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp544940imm; Wed, 1 Aug 2018 00:52:58 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf+Mr/hJeZewWxbq2h0A4cpHOtEv9u6NyXpjn6HUacZiTtpmcLDw0G0eWnNm0U8O+1CV87x X-Received: by 2002:a62:3c4f:: with SMTP id j76-v6mr25774663pfa.119.1533109978700; Wed, 01 Aug 2018 00:52:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533109978; cv=none; d=google.com; s=arc-20160816; b=V1/GTqpQxed3BSH819fE/MZzrLCRhhrrEEu3ckDRD7xULfFcPY90UNGxgi94c9UEmJ ETEninPH380sBM6V2Z/nzj8BbaMm8iVM2fpfYIWMHkoj4GUv4Mt1DK9nGbGO4wMkKVKE C3uX2bVM885kzBhKemODumlYDtR1yiX+kCuUgofQvFRHVSarSqryU5R/iH26ZNHZybe6 BxsWfIRCuv/oY/L62Ss/5m+rpxZVHeK2nhEaN0iRU2YkuyRk8eCepg3JOFYU5rcyNcHO oK0ICnuhO45rAcbipECTQW1vNZqHW7tRjmxRqtTjz9wfDj4Tt2d7yyt/fg+9Q1cRUkJh BcnQ== 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:arc-authentication-results; bh=UqZf8cCGTxp0g0qVA5xXFJbJ2ShpLULArQrIy7O9a6Q=; b=WimDr84rSnsOgHP7tQj2Hrao/VuDnBSfpn4bglxUOoYieXW9FjL6gox56/m95tcRKT eMvCSHpPAkGTUtg4vvFlAemyak9rciEjtSlOMe7WsqEjunVd5KG60jlxTi0Eq3OUT+IB THf+9yPIN4caUcTkDhHcL4P0nmGsuxuQafP4hhAC9fSw0AcEW+bO75u4Gseb+n+rz8E3 jhSa4HuWWxa7sJFfcrGykf1HNwxiLLe3nodyzKmIYrgm2qXc0Zs2cQ3c3WFTCsdgoz5G 9qDVGBY6W9X6wXvEhMzCQH0hcqD/quZKz5spAyjM5CytIX7My1CFgibKBPNfTTFkZlJ9 A/gQ== 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 o8-v6si13877698pll.193.2018.08.01.00.52.43; Wed, 01 Aug 2018 00:52:58 -0700 (PDT) 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 S2387629AbeHAJgW (ORCPT + 99 others); Wed, 1 Aug 2018 05:36:22 -0400 Received: from mail.bootlin.com ([62.4.15.54]:60503 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387411AbeHAJgW (ORCPT ); Wed, 1 Aug 2018 05:36:22 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 2D0F720799; Wed, 1 Aug 2018 09:51:55 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from qschulz (AAubervilliers-681-1-89-120.w90-88.abo.wanadoo.fr [90.88.30.120]) by mail.bootlin.com (Postfix) with ESMTPSA id 5BD62206D8; Wed, 1 Aug 2018 09:51:44 +0200 (CEST) Date: Wed, 1 Aug 2018 09:51:44 +0200 From: Quentin Schulz To: Andrew Lunn Cc: alexandre.belloni@bootlin.com, ralf@linux-mips.org, paul.burton@mips.com, jhogan@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, davem@davemloft.net, kishon@ti.com, f.fainelli@gmail.com, linux-mips@linux-mips.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, allan.nielsen@microsemi.com, thomas.petazzoni@bootlin.com Subject: Re: [PATCH net-next 10/10] net: mscc: ocelot: make use of SerDes PHYs for handling their configuration Message-ID: <20180801075143.s3fthewteu3n3evf@qschulz> References: <0ce1b3e8466064741dc6e484f87bbe48542cb978.1532954208.git-series.quentin.schulz@bootlin.com> <20180730135018.GF13198@lunn.ch> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="zs5rv4pdrmnxsur6" Content-Disposition: inline In-Reply-To: <20180730135018.GF13198@lunn.ch> User-Agent: NeoMutt/20171215 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --zs5rv4pdrmnxsur6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Andrew, On Mon, Jul 30, 2018 at 03:50:18PM +0200, Andrew Lunn wrote: > On Mon, Jul 30, 2018 at 02:43:55PM +0200, Quentin Schulz wrote: >=20 > > + err =3D of_get_phy_mode(portnp); > > + if (err < 0) > > + ocelot->ports[port]->phy_mode =3D PHY_INTERFACE_MODE_NA; > > + else > > + ocelot->ports[port]->phy_mode =3D err; > > + > > + if (ocelot->ports[port]->phy_mode =3D=3D PHY_INTERFACE_MODE_NA) > > + continue; > > + > > + if (ocelot->ports[port]->phy_mode =3D=3D PHY_INTERFACE_MODE_SGMII) > > + phy_mode =3D PHY_MODE_SGMII; > > + else > > + phy_mode =3D PHY_MODE_QSGMII; >=20 > Hi Quentin >=20 > Say somebody puts RGMII as the phy-mode? It would be better to verify > it is only SGMII or QSGMII and return -EINVAL otherwise. >=20 I'll replace this with a switch case to handle other cases. > > + > > + serdes =3D devm_of_phy_get(ocelot->dev, portnp, NULL); > > + if (IS_ERR(serdes)) { > > + if (PTR_ERR(serdes) =3D=3D -EPROBE_DEFER) { > > + dev_err(ocelot->dev, "deferring probe\n"); >=20 > dev_dbg() ? It is not really an error. >=20 Ack. > > + err =3D -EPROBE_DEFER; > > + goto err_probe_ports; > > + } > > + > > + dev_err(ocelot->dev, "missing SerDes phys for port%d\n", > > + port); > > + err =3D -ENODEV; >=20 > err =3D PTR_ERR(serdes) so we get the actual error? >=20 Ack. Thanks, Quentin --zs5rv4pdrmnxsur6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEXeEYjDsJh38OoyMzhLiadT7g8aMFAlthZo8ACgkQhLiadT7g 8aPbkRAAlZG/slUFYQUoRGChoRoiIBCl+L+pqmXc587iGWF0D42nkgIqjNZ7ahHb 8IqFYGSINc8iYWkvDKXJeR0OtktOreUrldWSXaegihEc3mwnd++TXcyfzhPzTZuX dFJk0Epc89hVisiOWrVZfbId7sVlGJYc+w7QXLX3yhJGZ9riycMhzmRvM5Vk8s/y tDrXHe+3/lkv89H1Sk8+hKMm9ruNoN9kWxd4IAbArTcxFNDHvK53OtKAyGWaiQ6Q AbwhHgkkEiiniS0johMTI15ouf+EHu6XXB/mj69FoOgkGqoXw9pg0gg+ocCIkBUI NmyODHe9XT7aTnwFIZa+BYJQCjITGe00xAVAwUFRHw3DTiRaCaEC4dF8NxLRuhEX nuiZjRJ+Tlu/WIUBpNktKCZLywRYqsq2OXrZaUCZwozibVF8Mg+bUgH+J4MlNBxb tQ+Hh/P5fKpLknBhsvbeYnz4SSqlWIXpCO4ImmyC87iS8NIoZmdOGTtnvRj6DY+u gah04QVxoBc4ja9PnBkAbZw+P1sSRHJjss+CClijHfdJZF6o+jYS1ys0hIsl/qDw MG0buoT10ZdqKOc9vBhATw/EjnmEJqC7ox0pi9x6FgkPPyCdFy32NEkjbUu04tf2 mJLvQNy05E1pWGTg4WXq+uUAI/PdCazxzoltt5lyI8H1Jf1CMrk= =3Ulf -----END PGP SIGNATURE----- --zs5rv4pdrmnxsur6--