From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BFB5179DD6; Wed, 21 Feb 2024 19:07:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708542466; cv=none; b=bVFZ1nDk6QaFa12jxRv0nfpvbnbdycxFfr7LQgpAUj+/YY3sgiQiSdvBWbH/7WwVOzQ6rfGFMl5Q030dqLMVGDP93Z/9JHRjykLM3GMnsjNR8GL1Ks2SLlhn++lOCMsaVsOeYw55ngfZb1zQL/UfeRvdGgU/wVqH55lswoVOVqE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708542466; c=relaxed/simple; bh=XqrbVgcMe+9uJTpreaIDujp6VV6ORFBxTdYAfPyFRic=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uciWfen2IPHemHJ857LgKJK/zTl2bUIftRUUDYJBS5U+u14ajlvGVOYBLOk10riCEo0qqKHITSYd1MDaF5De9EdN3Rbuy5Y29cn8GraY175vl38u+JhKwQiAGVMsPmSjKP1QdzbBKIUOiSEklY6JzmR25CiN/O+REx1UNY2JleY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tNqhnJJ+; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tNqhnJJ+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90A4EC433C7; Wed, 21 Feb 2024 19:07:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708542466; bh=XqrbVgcMe+9uJTpreaIDujp6VV6ORFBxTdYAfPyFRic=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tNqhnJJ+13DYcaf0zhZAM+yPKK81nXX6w0b+qgQaMr8ASYEtFySKv8Hot3tMAHcJy r8vNVwX8wSCU6DfCnS7iQBUfgjBVfolWuRf6vnLsbEc2OLtkLprwy44aHfrTqbpqJ8 +HrC94gw5BIoKuX6d8+jpK5SFmRTxwbBQPbQqntm+MUhubdsljEndKVdT2SPmsl8ZL thfmTLOdo6XG5oaT2bE/mSytHqz6PYGn2v2MCXDhTpKVOHak3iqwmQl8P/xgC3aRoQ 43hWq8XZbgH/mG0pYVYDTam/t4xjWLtfgDF3WnwBTy/TJl3J7+EfNi0768rZDz+gJV tXx2hBbDoFJKQ== Date: Wed, 21 Feb 2024 19:07:40 +0000 From: Simon Horman To: Romain Gantois Cc: Russell King , Andrew Lunn , Heiner Kallweit , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexandre Torgue , Jose Abreu , Maxime Coquelin , =?utf-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= , Maxime Chevallier , Miquel Raynal , Thomas Petazzoni , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org Subject: Re: [PATCH net-next v4 2/7] net: phylink: add rxc_always_on flag to phylink_pcs Message-ID: <20240221190740.GG722610@kernel.org> References: <20240221-rxc_bugfix-v4-0-4883ee1cc7b1@bootlin.com> <20240221-rxc_bugfix-v4-2-4883ee1cc7b1@bootlin.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240221-rxc_bugfix-v4-2-4883ee1cc7b1@bootlin.com> On Wed, Feb 21, 2024 at 02:04:19PM +0100, Romain Gantois wrote: > Some MAC drivers (e.g. stmmac) require a continuous receive clock signal to > be generated by a PCS that is handled by a standalone PCS driver. > > Such a PCS driver does not have access to a PHY device, thus cannot check > the PHY_F_RXC_ALWAYS_ON flag. They cannot check max_requires_rxc in the > phylink config either, since it is a private member. Therefore, a new flag > is needed to signal to the PCS that it should keep the RX clock signal up > at all times. > > Suggested-by: Russell King > Signed-off-by: Romain Gantois ... > @@ -549,6 +557,34 @@ void pcs_an_restart(struct phylink_pcs *pcs); > */ > void pcs_link_up(struct phylink_pcs *pcs, unsigned int neg_mode, > phy_interface_t interface, int speed, int duplex); > + > +/** > + * pcs_pre_init() - Configure PCS components necessary for MAC initialization > + * @pcs: a pointer to a &struct phylink_pcs. > + * > + * This function can be called by MAC drivers through the > + * phylink_pcs_pre_init() wrapper, before their hardware is initialized. It > + * should not be called after the link is brought up, as reconfiguring the PCS > + * at this point could break the link. > + * > + * Some MAC devices require specific hardware initialization to be performed by > + * their associated PCS device before they can properly initialize their own > + * hardware. An example of this is the initialization of stmmac controllers, > + * which requires an active REF_CLK signal to be provided by the PHY/PCS. > + * > + * By calling phylink_pcs_pre_init(), MAC drivers can ensure that the PCS is > + * setup in a way that allows for successful hardware initialization. > + * > + * The specific configuration performed by pcs_pre_init() is dependent on the > + * model of PCS and the requirements of the MAC device attached to it. PCS > + * driver authors should consider whether their target device is to be used in > + * conjunction with a MAC device whose driver calls phylink_pcs_pre_init(). MAC > + * driver authors should document their requirements for the PCS > + * pre-initialization. > + * > + */ > +int pcs_config(struct phylink_pcs *pcs); Hi Romain, Should this be pcs_pre_init instead of pcs_config? > + > #endif > > struct phylink *phylink_create(struct phylink_config *, ...