Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp335753rdh; Thu, 23 Nov 2023 05:28:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IGhlK2oFgqxNyrlmsfisKkcTYrtwTTkw+g0AsGpp5E2A5QWwuDVqHQxULFebgUuEiZpiobq X-Received: by 2002:a05:6a00:2794:b0:6cb:a60c:14 with SMTP id bd20-20020a056a00279400b006cba60c0014mr5646277pfb.18.1700746090225; Thu, 23 Nov 2023 05:28:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700746090; cv=none; d=google.com; s=arc-20160816; b=oGlwmcqfRO8aZ6AyMeKBLLvf/1l8MrbPBrsymtHMgafrkAhTUZoXWTbA2QO093FFqV /7IkMxveZtEZ6Ymx4PaVzf+PM2VyK87HEsjKhhffwq/B2Ju3nEITc6tmhKbI673q/y2I 0Tpem38mXHsnZV0GCSaNIo61hxswW4Gql5ISHO92IO5vVUKQQ1BJpN81FCUMyawMivrv +67SyvADpPAPXE5GwkyfyxEe0wrPCcp5Zroe3y84ENjRjrgEydSDAkAMLYDh105AZ5/N tMabbftnhG0HbNXVsUkfACytw/3I31VNK+OXgUIOlSFTW8+C6FU+x/vmbhFGlFtm4uCT w/Cg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=kIaXLjCHkUTAIQFu51DPbKbv3RKHWgAAWQUBqR3AlJg=; fh=coTf92WjhO9eBT+5ZBGOhV/+SBR2yQMy4gnGNWILm8c=; b=TfA/iJ1DfaUgfmovL4v0512jcVDsateStUlDu/B0riDNSDghqFboEOhqrId5UIFvla RymErie3B41A5U3N192NDPvNSQuaIBnvA98PgcXyBwNkli59LaL2HLeTkXtUek854QRv Ts2xy6fcXUFBJIjAwOhF63nRt4ngOdBrHMK+rl6hgXIoB8y5LfTw3ggTYx4gKZWfvdo8 lXgY3USONA+LHKsmMgHlKnaLg5z9sogC0/kF0FLa5b5K9GsoFobxnRWjL2YvFPSJsR4O GeKpMq20FyrgygXD7AfNWQ8qKwSs8fGV9LCTNDpjrMhtIvQSJ6vynnwLxYKSi1dKeKKa 315A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=SftnxtIJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id f34-20020a631f22000000b005be007363a9si1289047pgf.730.2023.11.23.05.28.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 05:28:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=SftnxtIJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id F3A6382AAF82; Thu, 23 Nov 2023 05:28:07 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345466AbjKWN1o (ORCPT + 99 others); Thu, 23 Nov 2023 08:27:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345464AbjKWN1n (ORCPT ); Thu, 23 Nov 2023 08:27:43 -0500 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39D0F9A; Thu, 23 Nov 2023 05:27:49 -0800 (PST) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-507b9408c61so1159580e87.0; Thu, 23 Nov 2023 05:27:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700746067; x=1701350867; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=kIaXLjCHkUTAIQFu51DPbKbv3RKHWgAAWQUBqR3AlJg=; b=SftnxtIJvMpOM2NOYta5KFSDGMuIdrgqte5PIYc1hqpo5Tz8HUs6tC6nmS39HSkg/d qu/llnIgm3lIx/DLvBTm0cA/HZepdIAc9AnDEmtaWfZFvPICBKIx8d5mbk2FFcsL1V4k orc7pUw2frDZtgWvRvFslZfiWUd2QJaK2KbG/Vo4f6/YXfwGBscqQR40aMp8KPnBmv93 nEJXZXluV6P2jEGr8OXwGBNDh8W1KRfbq4nPswC7COa73Rtr4UWWfm7F7jkHVQrA4tzz SaP+LeWgqxTU51wTg1gg/0UHDVgjCU+GNJUdmI6hgbt0w7IYNKbk4b/IzpDkHNt5QTv4 4QuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700746067; x=1701350867; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=kIaXLjCHkUTAIQFu51DPbKbv3RKHWgAAWQUBqR3AlJg=; b=Ft2QwNk+D9FD4HfF1TFB36AYzr4Uzlm/4yxCxgke5jELuaIAkv8HmfAfGAr55o+WAE CZQCPWq/kL3TYQ+Tqzunqne39+UmupPkxENu+UPmCSTFJ/kat9a22k6Gsz3c/3DWOtYk hyJXDFWsChmEF7j3no0cg7fgUyaF8CR2ynXtZROdpIfHAZe5Ky51vS3eR34bRAAI4Utr jD6N/GA1pBYH1XvBtJd1pxXdaR4oXKxUyOZKcCOER4jKOgukw9RlJnuBA5fzxdZwOg6r nQKvsWGkgPpH3tWoqPvpsi86mFsHSW5EVMSw3RLayrrpT2CvGA1bGuFZ0Qs2BDnPMArV 4Ecg== X-Gm-Message-State: AOJu0Yyo6hyvkTWuYWBv1mWpRlB1KB/Frknj+bgyd/aY1u8ymqrD7d2u IH6iL9J2127lMz0eK+iV1Nn7pMTP5sKV6g== X-Received: by 2002:a05:6512:3ca0:b0:509:4587:bdd0 with SMTP id h32-20020a0565123ca000b005094587bdd0mr5173837lfv.7.1700746067158; Thu, 23 Nov 2023 05:27:47 -0800 (PST) Received: from threadripper.localdomain (89-186-112-232.pool.digikabel.hu. [89.186.112.232]) by smtp.gmail.com with ESMTPSA id g14-20020a170906594e00b009fc6ac28110sm783069ejr.20.2023.11.23.05.27.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 05:27:46 -0800 (PST) From: Heiko Schocher X-Google-Original-From: Heiko Schocher To: netdev@vger.kernel.org Cc: Heiko Schocher , Clark Wang , "David S. Miller" , Eric Dumazet , Jakub Kicinski , NXP Linux Team , Paolo Abeni , Shenwei Wang , Wei Fang , linux-kernel@vger.kernel.org Subject: [PATCH] net: fec: fix probing of fec1 when fec0 is not probed yet Date: Thu, 23 Nov 2023 14:27:43 +0100 Message-Id: <20231123132744.62519-1-hs@denx.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 agentk.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 (agentk.vger.email [0.0.0.0]); Thu, 23 Nov 2023 05:28:08 -0800 (PST) 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. Return here with -EPROBE_DEFER so interface gets later probed again. Found this on imx8qxp based board, using 2 ethernet interfaces, and from time to time, fec1 interface came not up. Signed-off-by: Heiko Schocher --- drivers/net/ethernet/freescale/fec_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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_device *pdev) mii_cnt++; return 0; } - return -ENOENT; + return -EPROBE_DEFER; } bus_freq = 2500000; /* 2.5MHz by default */ -- 2.20.1