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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9BD6C7EE29 for ; Sun, 4 Jun 2023 12:50:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229635AbjFDMuP (ORCPT ); Sun, 4 Jun 2023 08:50:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229462AbjFDMuP (ORCPT ); Sun, 4 Jun 2023 08:50:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 694DAAB; Sun, 4 Jun 2023 05:50:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F018D614AB; Sun, 4 Jun 2023 12:50:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF2F9C433EF; Sun, 4 Jun 2023 12:50:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685883013; bh=st6rITNeMkA28xYwqynrWkwTwwzdBr6+2EomXGWAPSE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DbhxItIgU/jVbU7GQSr7P+Q6HQWm5kachurpeydFjzaklQKOe9vntZ//5Irpl0Vk+ LSXcs6o2EsrdOAxe/TJ4HspcIukFEk+98O3mYrmxxZLiPkQlQn/lz4yIOOIWbWTRKl ERbQfxmCN9LwHV7Y8C8JflOjSjYSDQGKl7afXvnpizQVOcc3aNmvTQBUH2fmSIixnq 03T0j48clRqylxk0eHCvxXTNcFaJ3xtMyRNsBi3JtHHQiCSoRPwnbFrtE6NLf+Rcg2 T5x+0L3VId4q6MNl1OVJs7ouIQ4q4UGVi1zshV68urpl15Ghf4AS4cJqkj3h2xugPo QjXcXp8+1NoxA== Date: Sun, 4 Jun 2023 20:49:47 +0800 From: Shawn Guo To: Hugo Villeneuve Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Hugo Villeneuve , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64: dts: imx8mn-var-som: add 20ms delay to ethernet regulator enable Message-ID: <20230604124947.GL4199@dragon> References: <20230529193311.1033939-1-hugo@hugovil.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230529193311.1033939-1-hugo@hugovil.com> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Mon, May 29, 2023 at 03:33:12PM -0400, Hugo Villeneuve wrote: > From: Hugo Villeneuve > > This commit is taken from Variscite linux kernel public git repository. > Original patch author: Nate Drude > See: https://github.com/varigit/linux-imx/blob/5.15-2.0.x-imx_var01/drivers/net/ethernet/freescale/fec_main.c#L3993-L4050 > > The ethernet phy reset was moved from the fec controller to the > mdio bus, see for example: 0e825b32c033e1998d0ebaf247f5dab3c340e3bf > > When the fec driver managed the reset, the regulator had time to > settle during the fec phy reset before calling of_mdiobus_register, > which probes the mii bus for the phy id to match the correct driver. > > Now that the mdio bus controls the reset, the fec driver no longer has > any delay between enabling the regulator and calling of_mdiobus_register. > If the regulator voltage has not settled, the phy id will not be read > correctly and the generic phy driver will be used. > > The following call tree explains in more detail: > > fec_probe > fec_reset_phy <- no longer introduces delay after migration to mdio reset > fec_enet_mii_init > of_mdiobus_register > of_mdiobus_register_phy > fwnode_mdiobus_register_phy > get_phy_device <- mii probe for phy id to match driver happens here > ... > fwnode_mdiobus_phy_device_register > phy_device_register > mdiobus_register_device > mdio_device_reset <- mdio reset assert / deassert delay happens here > > Add a 20ms enable delay to the regulator to fix the issue. > > Signed-off-by: Hugo Villeneuve Applied, thanks!