Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp2370274rwb; Sun, 15 Jan 2023 14:14:47 -0800 (PST) X-Google-Smtp-Source: AMrXdXt3A2NMjeBgv/qVeL6kCQn/ceU2RUjjjzrEcLj1thDVAj3BDMqBteh8LRplZ81P44f5PhRc X-Received: by 2002:a05:6a20:179e:b0:b8:537a:5525 with SMTP id bl30-20020a056a20179e00b000b8537a5525mr4339731pzb.51.1673820887070; Sun, 15 Jan 2023 14:14:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673820887; cv=none; d=google.com; s=arc-20160816; b=iJKKBRkihNDtYTv6zOHcFUGzTdyDC2L9hwubN6gGMT7OVOlqdgZFvKDFYFgg+wscio i3GLexj1HxosrukqQXEdifuAg3LkFMs/LnTlWIUMLrLLfAUTWWMPC9XHgeeuZGDCVcD9 HkhwIFU9W4EpBOJrQIqWTusH57upNNGLj0QtYBNNqpQvjYC30/gVTfTzeBh2Tl4Redrn P9WTJUCHobhrHNZAyJMUpGD0S9OzoJtE9peMn3c8mr9FJX2x+VCJ0tMsSX0WPAIt/gXI C4EgMjCGb83JPUSfgZIT778HksKxUc8J+jAX5unO2nZ3GTPeStem/LAiU0usqnsNnTt5 5ueA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=IIANEC2vOrokwtWoEbldipND1bJMaHfk76CpGlzeLAM=; b=mR/aGfeHX+qxlDTvqz0BCS7CcVW7xBW42utmPf6xLcpTaUziUo18ktgF424ooogqWQ /EFIe5Ac/IAUnOtQ+WxkI712kVTLzNYkM26EkBtgpGdchh+dGFhheTuaA2lB6H5Gn2L4 vljajyM5fasqbrZAtUzJ4pQYEyav/xUrQWPQll5h6G3DKpbjn/F/Tq6aITkn4YHpziK/ 4RiR6T4j4BE9vnbC84JfZ91VPWM5ultd419TPLmeIT/OsFCDua9OnWrhZGdU/arKWdxf 74jrIi/5ENjGa3hO92YcilUF9ydUZfiS68YleBKjfpzLNVNjw3+JpZuM+gLneJrqHHtS tW5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=tyuBwT0Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h17-20020a631211000000b0049db2d690fcsi26500863pgl.231.2023.01.15.14.14.38; Sun, 15 Jan 2023 14:14:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=tyuBwT0Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231561AbjAOV4x (ORCPT + 54 others); Sun, 15 Jan 2023 16:56:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231535AbjAOV4r (ORCPT ); Sun, 15 Jan 2023 16:56:47 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C65918177; Sun, 15 Jan 2023 13:56:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=IIANEC2vOrokwtWoEbldipND1bJMaHfk76CpGlzeLAM=; b=tyuBwT0QOLSlcLcuNzFWyCu8kb 5nKDdf9APVJIA9CGRXrsJ1bFZtYleyktI/SDACMv7S0ggHZyocZGzFrpk8kWpv7swR+GXnsQsp8au i2uZ89dH3X4WXpbYWSythY5av9jNcBUIhHMDqjZkXlowOjleSSQcrq5GcwVC74wttj2o=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1pHAzR-0029lB-QA; Sun, 15 Jan 2023 22:56:33 +0100 Date: Sun, 15 Jan 2023 22:56:33 +0100 From: Andrew Lunn To: Pierluigi Passaro Cc: wei.fang@nxp.com, shenwei.wang@nxp.com, xiaoning.wang@nxp.com, linux-imx@nxp.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, eran.m@variscite.com, nate.d@variscite.com, francesco.f@variscite.com, pierluigi.passaro@gmail.com Subject: Re: [PATCH v2] net: fec: manage corner deferred probe condition Message-ID: References: <20230115213804.26650-1-pierluigi.p@variscite.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230115213804.26650-1-pierluigi.p@variscite.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 15, 2023 at 10:38:04PM +0100, Pierluigi Passaro wrote: > For dual fec interfaces, external phys can only be configured by fec0. > When the function of_mdiobus_register return -EPROBE_DEFER, the driver > is lately called to manage fec1, which wrongly register its mii_bus as > fec0_mii_bus. > When fec0 retry the probe, the previous assignement prevent the MDIO bus > registration. > Use a static boolean to trace the orginal MDIO bus deferred probe and > prevent further registrations until the fec0 registration completed > succesfully. The real problem here seems to be that fep->dev_id is not deterministic. I think a better fix would be to make the mdio bus name deterministic. Use pdev->id instead of fep->dev_id + 1. That is what most mdiobus drivers use. Andrew