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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 06177C46CD2 for ; Tue, 30 Jan 2024 13:40:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:Message-ID: In-Reply-To:Subject:cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LECHnx6Bi62VEUtyWgfk+oJGnAsgTaYsKRhAkRC5U/c=; b=n/ct7qJNmOyYT2 D+1m56ehoe+RZB3d9clTXu65eLCaCXJqoq2hUvotZzPz17wmW8VG7/znHmZT5QoXx1retTcFG7i/S PmNdIBjYM1DkmX4RfNNllCKIMl757U2VtJeZEumN+rNbG0xCsFAEb2SMCMBuCHmMuAme2UcAfkzad 1om6iztnd7KYldkJzWaInwSwcvyjhkrsSC3Qi3K0VGR2y0kutunIeVDWU2J/b9l3ikCPcqiF2s+m5 39BtsGU4WIKUIO287UE09jDFUzfrQOxmkoRyOZUbptullHrWRA34VYmSjGPYqYcualb7BfVizqDiJ uxrhFibbQDTOQwRE/BgQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rUoLZ-0000000Gs9l-1I8r; Tue, 30 Jan 2024 13:40:17 +0000 Received: from relay5-d.mail.gandi.net ([217.70.183.197]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rUoLW-0000000Gs8h-1WYo for linux-arm-kernel@lists.infradead.org; Tue, 30 Jan 2024 13:40:15 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id BB1221C0005; Tue, 30 Jan 2024 13:40:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1706622010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=A3wtrD2uoXhVlXOQf9qkwgkVdNZsFSpbdjrR4OR46j4=; b=LrKfnFVsBIoEn/8B5X8Q4FrVyf8P3XnWHnYRgT04wSxgpV6el0DMo9SCrOYyuTlNWRy9F6 HiMifCO0TYFOfj1nXd7yppKz47BmgspAYw26tmMHKIroClhx4tqd94/B2C7y1n9iIs7nM2 5AhD1nOEdr729xRmPWHdrlVN+0yjF3PF3u4ih5/SG2gfgZTc7l46mgcAWQ2OhaNeJMiwJd hJmhwDRxnp3iwd88Jqru9WGzBoBTH1yEWeMs6ITKE79IvuRZtRyQzWckvB5Qid55y+yUrd ZCfiUJZfROj1ZhBBYxDvSMdZQrem47kgWHWsZX5uxyP+SYZu1LypAurOGVhPyw== Date: Tue, 30 Jan 2024 14:40:31 +0100 (CET) From: Romain Gantois To: "Russell King (Oracle)" cc: Romain Gantois , Andrew Lunn , Heiner Kallweit , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexandre Torgue , Jose Abreu , Maxime Coquelin , =?ISO-8859-15?Q?Cl=E9ment_L=E9ger?= , 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 v2 2/7] net: phy: add rxc_always_on flag to phylink_pcs In-Reply-To: Message-ID: <3e1617d8-b8c9-64d6-030d-5b6781544692@bootlin.com> References: <20240130-rxc_bugfix-v2-0-5e6c3168e5f0@bootlin.com> <20240130-rxc_bugfix-v2-2-5e6c3168e5f0@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: romain.gantois@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240130_054014_692723_180C1ADD X-CRM114-Status: GOOD ( 19.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hello Russell, On Tue, 30 Jan 2024, Russell King (Oracle) wrote: ... > > +int phylink_pcs_pre_init(struct phylink *pl, struct phylink_pcs *pcs) > > +{ > > + int ret = 0; > > + > > + /* Signal to PCS driver that MAC requires RX clock for init */ > > + if (pl->config->mac_requires_rxc) > > + pcs->rxc_always_on = true; > > + > > + if (pcs->ops->pcs_pre_init) > > + ret = pcs->ops->pcs_pre_init(pcs, pl->link_config.interface); > > Given that: > 1) phylink supports switching between mutliple different interfaces, > 2) from what I can see you are only calling this from stmmac's > initialisation path, > 3) you pass the interface mode to the PCS here > > then we don't want the PCS to configure itself for the interface mode > passed in, because this function won't be called when the interface > mode changes - and PCS driver authors will have to bear that in mind. > So... > ... > However, do we really need it - if the PCS is supplying the RXC to > the MAC, then is the interface mode between the PCS and PHY all that > relevant at this point? If a PCS can set the needed clock signal without configuring the details of a particular link mode, then passing the interface mode to pcs_pre_init() would indeed not be relevant. Generally, I agree that setting the interface mode shouldn't be the concern of the pre-initialization function. I'll dig a bit more into the PCS datasheet and run more tests to see if I can get away with enabling the RX clock selectively for this particular PCS model. If not, then maybe I can hardcode a "default" interface mode for the pre-initialization that will not interfere with the rest of the link setup process. Best Regards, -- Romain Gantois, Bootlin Embedded Linux and Kernel engineering https://bootlin.com _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel