Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp4834123rwb; Tue, 8 Aug 2023 14:55:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFGrdHdFXcWeIJDjC8eaHMpH/epKCMIvYTjSiNnYdzkVibcrACBCElpexZJeKKdqJbMwrUx X-Received: by 2002:a05:6512:70e:b0:4fd:fabf:b923 with SMTP id b14-20020a056512070e00b004fdfabfb923mr501451lfs.14.1691531759221; Tue, 08 Aug 2023 14:55:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691531759; cv=none; d=google.com; s=arc-20160816; b=UQe/pgYiMB6taZp5f7wfPils0/UEsr0k7aRLGTigdiQQxtV/OHRWKwtMmb7WuN88fF +isNWjF2QtzvMu2U09OKF7CEJuRyQi6mkPAUd2eYEMWkd5UlMa7wgoeZha/5OxKabWKk IfArSwBUlsKxubmQKR/Z5YSKjsOEdYtesbEKluQth75QV4P75+Y7so5v++cEs/84vuiy TDtyN4hZVd/nb7hFIsZ72AMGQsybyfEHgS+awOC5Bf50ao12+2Eafb/RsmW7ROgwlnbw TgexaglNbpimBBeT+Agzf5yflT6FfQ/yEqHh3q2L6hvkB4hx9GYumrIzjE8pR2sQsLTD gzCQ== 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=QkuDXA4j1tGMsv4/ORMgt9CX3zHb9CYX5634imlS4UY=; fh=H6iVGnQmUpfDyegAF9F1ciw97hMwInrS63bgTzeAf0A=; b=gsHiWZpcaysXoNAjU4CGDrvYlOMwDh/yf7IiJtuEiFqcjegMYuLWT4lCGJ1HcRBtSC GL8CakNUNF2PXaAJmlA0H/Y/gFFcZi2MRkP6ndGrI6KVcwzYsY/WpYWdDtKGMAy3eFm6 5lET7dTJwz6qLMKnu1B30gnggwQ3mC5Qpgc5/pSqqRu6ax4cVn3Ktajhn5+0A5k4zlsC B0iLn1lSPy3K92DTTqorlCR5MaPstlB6yyNNY5gTe5qKffxlrbxnOeAd7sPtYkYrO2Be NCp1WLePGMFTDGIG1/N1BAUGUSShvpAJ0leEGZzKNYjGu04fADjpUOgdds3qmR+uT8A3 VJOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=GnxRtNBN; 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 j18-20020aa7c412000000b00523384b2e83si3574499edq.56.2023.08.08.14.55.35; Tue, 08 Aug 2023 14:55:59 -0700 (PDT) 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=GnxRtNBN; 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 S232207AbjHHSxV (ORCPT + 99 others); Tue, 8 Aug 2023 14:53:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231464AbjHHSw7 (ORCPT ); Tue, 8 Aug 2023 14:52:59 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F371915790D; Tue, 8 Aug 2023 10:07:35 -0700 (PDT) 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=QkuDXA4j1tGMsv4/ORMgt9CX3zHb9CYX5634imlS4UY=; b=GnxRtNBN9QfTDtlrGsdD6R8saj xV1PknLE+Z7yZpqrg/i9TuFRLGbD0aHl1PKQye/yCUOuYHNkCfFcs/U3baUwd2vFSTI86v9XnNXC5 xcaqPSDA6UMnKbd7JdrzPpwXnuW/GPPkvcOOjj09KQDskJpC2OcfIGOMnBgvZaPOiJig=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1qTMSy-003SxZ-Ku; Tue, 08 Aug 2023 15:09:40 +0200 Date: Tue, 8 Aug 2023 15:09:40 +0200 From: Andrew Lunn To: Bartosz Golaszewski Cc: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Andrew Halaney , Alex Elder , Srini Kandagatla , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: Re: [PATCH 0/2] net: stmmac: allow sharing MDIO lines Message-ID: <05e574e3-688e-49d6-b3e6-80b36bfc5158@lunn.ch> References: <20230807193102.6374-1-brgl@bgdev.pl> <54421791-75fa-4ed3-8432-e21184556cde@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_00,DATE_IN_PAST_03_06, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=no 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 > Ok so upon some further investigation, the actual culprit is in stmmac > platform code - it always tries to register an MDIO bus - independent > of whether there is an actual mdio child node - unless the MAC is > marked explicitly as having a fixed-link. If the MDIO bus does exist registering it should not be a problem. Ideally it should have an internal pull up on its MDIO line, so that all reads return 0xffff. The phylib core will then determine there are no devices on it. Not actually registering it because there is no MDIO node in DT is just an optimisation. > When I fixed that, MAC1's probe is correctly deferred until MAC0 has > created the MDIO bus. Great. That is how it should work. > Even so, isn't it useful to actually reference the shared MDIO bus in some way? Why? Linux does not care where the PHY is. There are some SoCs with an independent MDIO bus masters. They have there own node in DT, there own driver etc. You can create an MDIO bus from two or three GPIOs and bit banging, again as an node in DT. There are Ethernet switches which can have 11 ports, and 2 MDIO busses, one purely internal and one external, and the PHYs are scattered over these busses. All linux needs is a phandle to the PHY, nothing more. Andrew