Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp429233rdh; Thu, 23 Nov 2023 07:42:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IEmpgFzovz6TNgOzJ/Y66b5fF4AeQbbF3QoFpMGzW8cd6Een/g41o3DMSHZwHftl75yWQs5 X-Received: by 2002:a17:90b:4a4b:b0:285:8073:7115 with SMTP id lb11-20020a17090b4a4b00b0028580737115mr417441pjb.19.1700754172052; Thu, 23 Nov 2023 07:42:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700754172; cv=none; d=google.com; s=arc-20160816; b=IBM6EgmYtvE7ccyckP0+vkLgakF++5/llCGLCIZxFga3EKHdnbygYJC6g8djrhIc3y M1/h7yPKjlug98xXvtGXe0tO33O7VnxI4bgA0aFPNkD1yLiClnqZHOJacjsPq3NCsmn1 AeLMmMNRFdOG7YeDxuMXlJIvZTLpAr+NsIfTa6h7w5GunzcF9WgIS9LlbMWdOa6iUHSf ihHIJMxAs7kZ+MQqp0X4mSo4/XXOLnZzMriENMszGREx+ECyVqrIMyfPjJ3MLSwfOufu EPAdEV7zdqc6xSPHieJFm2mTTFdvxVb7iympPIORR+vg4IruomrakEEzqaW/ayZ1QNXl T+/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:organization:message-id:date:subject:cc:to :from:dkim-signature; bh=guZurlbG4ZmKDrecv6uyaxAN6HLRHdL0ODaQdkQw54g=; fh=K4hjNzLdXAYQJrprVQC9zhtFiIFV/aF8D7XpaKHm2WQ=; b=fKwkTpCDAEIMIM8E6MZ5OkhVZ+/dbGBOXGPwtl6fq5hE/9CW0S14R75n5VZKRsePXv /G8m+XC+Yfzk6p0ufZyzG43zTBdncoHqxfCg43XRm9BoWA/Pjo/J7MKoHWm1Ly1I0mVN 0WAeBmenx//1WkqVF9iHL+/Dn4VKo7wlv8Yti11sxJ8xF7nyGU+/b57xb0Vobu5LhAi4 ibXkFgqudlDitAUCHSO6okVK9qjZgsx/abZ0qge3ZiTpyJzu0ySTs1VPpvqHjCl1a/Tk +xgzJDVLffce5Po0CzNNIoOzNGs4xjXJfxu5Gu23yu0o5jmkPHlsABzEsMN0sk83kkpa LSlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tq-group.com header.s=key1 header.b="H6Az/NWg"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tq-group.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id w8-20020a17090a15c800b00279020d1fb0si1500054pjd.129.2023.11.23.07.42.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 07:42:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@tq-group.com header.s=key1 header.b="H6Az/NWg"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tq-group.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 6A401826102F; Thu, 23 Nov 2023 07:42:49 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346100AbjKWPmd (ORCPT + 99 others); Thu, 23 Nov 2023 10:42:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229602AbjKWPmc (ORCPT ); Thu, 23 Nov 2023 10:42:32 -0500 Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C20ED54; Thu, 23 Nov 2023 07:42:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1700754158; x=1732290158; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=guZurlbG4ZmKDrecv6uyaxAN6HLRHdL0ODaQdkQw54g=; b=H6Az/NWgeG9eEcWG9PjQARMHbBVT8oufcy908lUrV8+TvrkYDRNpeLQt vskWTViDtcwUoBZXO6d/v9VhDgJ5yvI/fG1etuhZsBHR87pFP8ik8blyB Vd8DOAT0N7MpcaJ3Ore71gpsJktwD045kMHOBkrc30PteuQjTagQk9bQd d2jTpdwkAPYkyyhEbwMLTV7Cw65VYSfsiNC14Q1Q9rtjtY3yUUaYMLETk J4W9PKjyZUD3ov8+KsBFvAo8BnYz/uh50PtADUeBn+kGFoedBpsdm17/r HVCxGmSeX9Yn+rlu3kfipVzqmvl3qfSv/8/mb5d+b5eg9fVp9UK+S3mN2 Q==; X-IronPort-AV: E=Sophos;i="6.04,222,1695679200"; d="scan'208";a="34146565" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 23 Nov 2023 16:42:36 +0100 Received: from steina-w.localnet (steina-w.tq-net.de [10.123.53.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by vtuxmail01.tq-net.de (Postfix) with ESMTPSA id F3ED2280075; Thu, 23 Nov 2023 16:42:35 +0100 (CET) From: Alexander Stein To: netdev@vger.kernel.org, Heiko Schocher , hs@denx.de Cc: Clark Wang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , NXP Linux Team , Paolo Abeni , Shenwei Wang , Wei Fang , linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: fec: fix probing of fec1 when fec0 is not probed yet Date: Thu, 23 Nov 2023 16:42:35 +0100 Message-ID: <2305704.ElGaqSPkdT@steina-w> Organization: TQ-Systems GmbH In-Reply-To: <1af63dea-e333-cef7-2bc6-bbf4eb8c3881@denx.de> References: <20231123132744.62519-1-hs@denx.de> <5992842.lOV4Wx5bFT@steina-w> <1af63dea-e333-cef7-2bc6-bbf4eb8c3881@denx.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Thu, 23 Nov 2023 07:42:49 -0800 (PST) Hello Heiko, Am Donnerstag, 23. November 2023, 16:26:18 CET schrieb Heiko Schocher: > Hello Alexander, >=20 > On 23.11.23 16:11, Alexander Stein wrote: > > Hello Heiko, > >=20 > > Am Donnerstag, 23. November 2023, 14:27:43 CET schrieb Heiko Schocher: > >> it is possible that fec1 is probed before fec0. On SoCs > >> with FEC_QUIRK_SINGLE_MDIO set (which means fec1 uses mii > >> from fec0) init of mii fails for fec1 when fec0 is not yet > >> probed, as fec0 setups mii bus. In this case fec_enet_mii_init > >> for fec1 returns with -ENODEV, and so fec1 never comes up. > >>=20 > >> Return here with -EPROBE_DEFER so interface gets later > >> probed again. > >>=20 > >> Found this on imx8qxp based board, using 2 ethernet interfaces, > >> and from time to time, fec1 interface came not up. > >=20 > > But FEC_QUIRK_SINGLE_MDIO is only set for imx28. How is this related to > > imx8qxp? >=20 > Ah, yes ... customer uses NXP based kernel there is: >=20 > /* board only enable one mii bus in default */ > if (!of_get_property(np, "fsl,mii-exclusive", NULL)) > fep->quirks |=3D FEC_QUIRK_SINGLE_MDIO; >=20 > which is missing in mainline... nevertheless patch fixes a problem > with boards having quirk FEC_QUIRK_SINGLE_MDIO set. But this seems wrong. Apparently fec driver fails if MDIO bus is not (yet)= =20 available. But 'fsl,mii-exclusive' + FEC_QUIRK_SINGLE_MDIO assumes both=20 interfaces use fec, no? Will this work e.g. on imx8mp if the FEC PHY is=20 attached to STMMAC (EQOS) PHY? > > Will this also help for imx6ul when fec1 is almost always probed before > > fec0 due to order of DT nodes? >=20 > Yep, I think so... do you have the chance to test such a setup? I have a board for that. But I'm not able to test at the moment. Best regards, Alexander > bye, > Heiko >=20 > > Best regards, > > Alexander > >=20 > >> Signed-off-by: Heiko Schocher > >> --- > >>=20 > >> drivers/net/ethernet/freescale/fec_main.c | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >>=20 > >> diff --git a/drivers/net/ethernet/freescale/fec_main.c > >> b/drivers/net/ethernet/freescale/fec_main.c index > >> c3b7694a7485..d956f95e7a65 100644 > >> --- a/drivers/net/ethernet/freescale/fec_main.c > >> +++ b/drivers/net/ethernet/freescale/fec_main.c > >> @@ -2445,7 +2445,7 @@ static int fec_enet_mii_init(struct platform_dev= ice > >> *pdev) mii_cnt++; > >>=20 > >> return 0; > >> =09 > >> } > >>=20 > >> - return -ENOENT; > >> + return -EPROBE_DEFER; > >>=20 > >> } > >> =09 > >> bus_freq =3D 2500000; /* 2.5MHz by default */ =2D-=20 TQ-Systems GmbH | M=FChlstra=DFe 2, Gut Delling | 82229 Seefeld, Germany Amtsgericht M=FCnchen, HRB 105018 Gesch=E4ftsf=FChrer: Detlef Schneider, R=FCdiger Stahl, Stefan Schneider http://www.tq-group.com/