From: Sergei Shtylyov Subject: Re: [PATCH net-next] net: phy: mscc: Fix the VSC 8530/31/40/41 Chips Init sequence Date: Tue, 18 Dec 2018 11:49:50 +0300 Message-ID: References: <1545111780-20206-1-git-send-email-Raju.Lakkaraju@microchip.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: f.fainelli@gmail.com, andrew@lunn.ch, UNGLinuxDriver@microchip.com To: Raju Lakkaraju , netdev@vger.kernel.org Return-path: Received: from mail-lj1-f193.google.com ([209.85.208.193]:45573 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726316AbeLRIt7 (ORCPT ); Tue, 18 Dec 2018 03:49:59 -0500 Received: by mail-lj1-f193.google.com with SMTP id s5-v6so13449658ljd.12 for ; Tue, 18 Dec 2018 00:49:58 -0800 (PST) In-Reply-To: <1545111780-20206-1-git-send-email-Raju.Lakkaraju@microchip.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: Hello! On 18.12.2018 8:43, Raju Lakkaraju wrote: > From: Raju Lakkaraju > > Fix the VSC 8530/31/40/41 Chips Init sequence > - Turn on Broadcast writes > - UNH 1.8.1 clear bias for UNH 1000BT distortion > - UNH 1.8.7 optimize pre-emphasis for 100BasTx UNH 100W fix > - Enable Token-ring during 'Coma Mode' > > Signed-off-by: Raju Lakkaraju > --- > drivers/net/phy/mscc.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 53 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/phy/mscc.c b/drivers/net/phy/mscc.c > index cfe680f..766d64e 100644 > --- a/drivers/net/phy/mscc.c > +++ b/drivers/net/phy/mscc.c [...] > @@ -1650,7 +1695,7 @@ static int vsc8584_config_init(struct phy_device *phydev) > > static int vsc85xx_config_init(struct phy_device *phydev) > { > - int rc, i; > + int rc, i, phy_id; > struct vsc8531_private *vsc8531 = phydev->priv; > > rc = vsc85xx_default_config(phydev); > @@ -1665,6 +1710,13 @@ static int vsc85xx_config_init(struct phy_device *phydev) > if (rc) > return rc; > > + phy_id = phydev->drv->phy_id & phydev->drv->phy_id_mask; > + if (PHY_ID_VSC8531 == phy_id || PHY_ID_VSC8541 == phy_id || > + PHY_ID_VSC8530 == phy_id || PHY_ID_VSC8540 == phy_id) This is asking for *switch*. And the immediates should be on the right side of ==, anyway. > + rc = vsc8531_pre_init_seq_set(phydev); > + if (rc) > + return rc; > + > rc = vsc85xx_eee_init_seq_set(phydev); > if (rc) > return rc; MBR, Sergei