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 9A631C48BF6 for ; Wed, 21 Feb 2024 09:40:01 +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=CLMLXVA3Gmfqs9w7SDiiy7Vot4OQpFffWQMXhSU1Goc=; b=Q+s2t/GfhzlN4J TPTfj0/qLvWOLfxXKkP31p963HJzozLo3oG2iFWh99PkjBs7utc+QT812SqXQOCobg2mTNFH4Q8em szF90SIPGXZUx2pIFukABPzBU2b2Kr+PGJBvph1/c4/rbr3iX+ceWkVIT2otxP81wWYGp44lvpN63 cZxm/j0LGuIumEiAvuvAgfuSB9fKJvsWJKVA/JFmEGfotrQ7gKKNF3VUaVlLDTQFI2nedCLAD5kHF bqEUOpNK/QOccyE01oyp7+/RPH+HsOvJsp0w85/qgBkawMj9zEGzbzXOjZsMljI4yZvUDOyuxkD7z LaCMQ3QXcbAsA4xdwsmw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rcj4u-00000000IQt-3luI; Wed, 21 Feb 2024 09:39:48 +0000 Received: from relay1-d.mail.gandi.net ([2001:4b98:dc4:8::221]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rcj4r-00000000IPI-0R0K for linux-arm-kernel@lists.infradead.org; Wed, 21 Feb 2024 09:39:46 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 7D2CF24000D; Wed, 21 Feb 2024 09:39:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708508380; 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=Xr1h5K30G9MBY/JWOVj85ZQBdVlWSBtQJRX0YVGUwUU=; b=OJiEUiYWioWWVy7fpqJv/3WVpgZDBbegcbSmaG4Vm34r0L7mR1K6SgLIiMIYpK9Pcs1iiV 22A26aitmZoSfA58c8LK37aXF36sli8Ho7vQushhwJRWseNe3tv6rY9SJl/otDqLGVvj1F mOyIL7jv8KQKbrZotC9sLIZnunnb1vKIGrx8NuFJuEIKCty43XsOH/6VFLzIPzSRDC/ndD 3sTjT1yuTOznavogBz4bFwe1qvEvrNiqv9VVkpa5Q1zVL69izNF649QNMQuITL2X918AFo SkoumL/Z8whT/v0o1J1ZrdIhbzIsDJyMbdMkvRBEjgySLWBoXFb7r2cXCZD+QA== Date: Wed, 21 Feb 2024 10:40:06 +0100 (CET) From: Romain Gantois To: Maxime Chevallier cc: Romain Gantois , Russell King , 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?= , 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 v3 7/7] net: pcs: rzn1-miic: Init RX clock early if MAC requires it In-Reply-To: <20240212185332.2ebf2935@device-28.home> Message-ID: References: <20240212-rxc_bugfix-v3-0-e9f2eb6b3b05@bootlin.com> <20240212-rxc_bugfix-v3-7-e9f2eb6b3b05@bootlin.com> <20240212185332.2ebf2935@device-28.home> 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-20240221_013945_378386_69519353 X-CRM114-Status: GOOD ( 18.23 ) 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 Hi Maxime, On Mon, 12 Feb 2024, Maxime Chevallier wrote: > > +static int miic_pre_init(struct phylink_pcs *pcs) > > +{ > > + struct miic_port *miic_port = phylink_pcs_to_miic_port(pcs); > > + struct miic *miic = miic_port->miic; > > + u32 val; > > + > > + /* Start RX clock if required */ > > + if (pcs->rxc_always_on) { > > + /* In MII through mode, the clock signals will be driven by the > > + * external PHY, which might not be initialized yet. Set RMII > > + * as default mode to ensure that a reference clock signal is > > + * generated. > > + */ > > + miic_port->interface = PHY_INTERFACE_MODE_RMII; > > There's this check in miic_config : > > if (interface != miic_port->interface) { > val |= FIELD_PREP(MIIC_CONVCTRL_CONV_SPEED, speed); > mask |= MIIC_CONVCTRL_CONV_SPEED; > miic_port->interface = interface; > } > > As you set the interface to RMII and set the CONV_MODE below without > really looking at the speed, is there any risk of a mismatch between > the configured mode and the speed ? Good point, it is probably necessary to set the default RMII speed in miic_pre_init(), since miic_config will not do it if the link mode hasn't changed in the meantime. However, this is only an issue if the link isn't already up when miic_config() is called. If the link is up, then that means that miic_link_up() has already been called and has set the appropriate speed anyway. Thanks, -- 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