From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D585C43381 for ; Fri, 15 Feb 2019 10:16:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CE3CF21A80 for ; Fri, 15 Feb 2019 10:16:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550225780; bh=WP6R/LQDs7/7hJn+URPX5/rHUsSFhChQAJg+MnnRud4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=RPHKpt80iMnaRxzq/gN7NLNvXebpJehD72QIyEyKF/pnlMM1N1K6bmoreZOo73sjj DagiEB3wq0KXWGpdNDgCPBeVTWTo3W713CaMgNbyEXtOs3FGeorB/yfhk13A6upXCz SZgXpADviUqG3knpZAs9jSt10ByZltjeVTCn16BE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728343AbfBOKQT (ORCPT ); Fri, 15 Feb 2019 05:16:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:35708 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726202AbfBOKQT (ORCPT ); Fri, 15 Feb 2019 05:16:19 -0500 Received: from localhost (unknown [106.199.107.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id ED8EF21A80; Fri, 15 Feb 2019 10:16:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550225778; bh=WP6R/LQDs7/7hJn+URPX5/rHUsSFhChQAJg+MnnRud4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=2kHq1KpN1R0nhdWwIDR9qCBngS1GeokOZXX6e6ZJ9kZpP7IB0NmmPbyLbuk8JJGPB geua3aQ8RxPQ8WI2VeRazTXc/tB+JLTKyKVwiXdQ9HVI1o6mE91mupgVzEAn/FNjH+ gh+Tr9UuAtW4uJV0Y1FkyHvP6nhOdrjvBOzlddgs= Date: Fri, 15 Feb 2019 15:46:12 +0530 From: Vinod Koul To: Peter Ujfalusi Cc: David S Miller , linux-arm-msm@vger.kernel.org, Bjorn Andersson , netdev@vger.kernel.org, Niklas Cassel , Andrew Lunn , Florian Fainelli , "Nori, Sekhar" , Marc Gonzalez Subject: Re: [PATCH] net: phy: at803x: disable delay only for RGMII mode Message-ID: <20190215101612.GF21884@vkoul-mobl> References: <20190212141922.12849-1-vkoul@kernel.org> <89c39811-b100-564a-da40-abf46e450c95@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <89c39811-b100-564a-da40-abf46e450c95@ti.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 13-02-19, 09:02, Peter Ujfalusi wrote: > Hi Vinod, > > On 12/02/2019 16.19, Vinod Koul wrote: > > Per "Documentation/devicetree/bindings/net/ethernet.txt" RGMII mode > > should not have delay in PHY whereas RGMII_ID and RGMII_RXID/RGMII_TXID > > can have delay in phy. > > > > So disable the delay only for RGMII mode and disable for other modes > s/disable for other modes/enable for other modes oops > > Works fine on am335x-evmsk: > Tested-by: Peter Ujfalusi Thanks for quick testing.. > > and few comment > > > Fixes: cd28d1d6e52e: ("net: phy: at803x: Disable phy delay for RGMII mode") > > Reported-by: Peter Ujfalusi > > Signed-off-by: Vinod Koul > > --- > > drivers/net/phy/at803x.c | 33 ++++++++++++++++++++++++++------- > > 1 file changed, 26 insertions(+), 7 deletions(-) > > > > diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c > > index 8ff12938ab47..7b54b54e3316 100644 > > --- a/drivers/net/phy/at803x.c > > +++ b/drivers/net/phy/at803x.c > > @@ -110,6 +110,18 @@ static int at803x_debug_reg_mask(struct phy_device *phydev, u16 reg, > > return phy_write(phydev, AT803X_DEBUG_DATA, val); > > } > > > > +static inline int at803x_enable_rx_delay(struct phy_device *phydev) > > +{ > > + return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_0, 0, > > + AT803X_DEBUG_RX_CLK_DLY_EN); > > +} > > static inline int at803x_select_rx_delay(struct phy_device *phydev, > bool enable) > { > } > > > + > > +static inline int at803x_enable_tx_delay(struct phy_device *phydev) > > +{ > > + return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_5, 0, > > + AT803X_DEBUG_TX_CLK_DLY_EN); > > +} > > static inline int at803x_select_tx_delay(struct phy_device *phydev, > bool enable) > { > } > > perhaps? Given that we would again branch off on enable, I see this as no better case so I will keep existing > > > + > > static inline int at803x_disable_rx_delay(struct phy_device *phydev) > > { > > return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_0, > > @@ -255,18 +267,25 @@ static int at803x_config_init(struct phy_device *phydev) > > if (ret < 0) > > return ret; > > > > - if (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID || > > - phydev->interface == PHY_INTERFACE_MODE_RGMII_ID || > > - phydev->interface == PHY_INTERFACE_MODE_RGMII) { > > + if (phydev->interface == PHY_INTERFACE_MODE_RGMII) { > > ret = at803x_disable_rx_delay(phydev); > > if (ret < 0) > > return ret; > > + ret = at803x_disable_tx_delay(phydev); > > + if (ret < 0) > > + return ret; > > is it a possibility to have PHY_INTERFACE_MODE_RGMII and other RGMII_ID > || RGMII_TXID || RGMII_RXID set at the same time? Nope that would not make sense > if not you can just return from here, no need to check for other RGMII > modes? for RGMII yes indeed.. -- ~Vinod