Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp4746293rwb; Tue, 8 Aug 2023 13:11:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFZL42V9lAcFLKDN1uTYmSbhQ2EkJZKLi5oa9C4wxDGFJsv3wKi4tgvHOtxhe5J1DC4J6tU X-Received: by 2002:a17:907:2ce8:b0:99c:9e98:70aa with SMTP id hz8-20020a1709072ce800b0099c9e9870aamr448523ejc.47.1691525476124; Tue, 08 Aug 2023 13:11:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691525476; cv=none; d=google.com; s=arc-20160816; b=pI1o94oeWCGS3uYrhfXvkcIIMDgkwvbALKUHvoxrF4c32Crj+bMFEEV3f2rJf/WfS+ oLS/J0QohBcF1TgxEM1py2P/C6xno7OSkk/bNQvrbDne9Q7YoQU/9Y11I/DDR/kzYHX8 aMuAhP6fSiSB0x2ZrVWCn/rCV2DHDBps/cFbI/fD3nNSQy8TyOpeo/I78SHPHS+ByePg Hwvi401uEeZxwDznBy8/SEixQZE5v85h5FrT9gozP3yIKbYF6b9QNH9SS3IB726nKhap MiZmn9W6XbxJoo2AP93+Cau/GjdOCjLk9Xai2uDYdZm+kCi4SrLWeLe7C5OtmxypumBK 50tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=GFaCPHe174CVGEE8zH9Ahbm1V8fDZn/hHt9ByI29bII=; fh=aPX4HCClsdzvV20bd+2VbD7ZsSOG1292aRfmUObPth4=; b=Bah362fRJmcrqx5HpgsgxKbqfKiE8EJ5Qy7US8RiRGDHtAUpqKO4KoRy8PqZ2d35VT rtSQKPw37spdruRmgfMaYaDEGGXfhIqsgVwFwI4FHXSUKcnSDhVP2hlMOHvNh/+gjBjt k4J7eehvrp309UssAUrgD5wWTQSw1d/EY7Dq6JGvUfLk9Kn+bCzNgY2l6K7vbw5pr2N/ 2+zm3vHWhwkUogVcsiDSMBDxlGQxBcbrje1S6U7mlzTEk99xpkRSJl2dcKpbugDurnmj JLbIx1Kkz89OBiqBcN5HsYPhEKQ48JyrVnoTywf2NaMCpgvVZDsMUuEa28yrT5cAfNKM FkoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=xpxuUzoN; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q15-20020a1709060f8f00b0099b5c6c643fsi6941444ejj.316.2023.08.08.13.10.51; Tue, 08 Aug 2023 13:11:16 -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=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=xpxuUzoN; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233380AbjHHTLo (ORCPT + 99 others); Tue, 8 Aug 2023 15:11:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230397AbjHHTL3 (ORCPT ); Tue, 8 Aug 2023 15:11:29 -0400 Received: from mail-ot1-x334.google.com (mail-ot1-x334.google.com [IPv6:2607:f8b0:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD90D31018 for ; Tue, 8 Aug 2023 09:33:10 -0700 (PDT) Received: by mail-ot1-x334.google.com with SMTP id 46e09a7af769-6bb07d274feso4825148a34.0 for ; Tue, 08 Aug 2023 09:33:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1691512364; x=1692117164; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=GFaCPHe174CVGEE8zH9Ahbm1V8fDZn/hHt9ByI29bII=; b=xpxuUzoNiwS4nE334fmSiwp7P75jSG9xDNu5MfxY+1Q5ohkvkrOYHvj5b0SsKqYSuo lg25mZqZB8X3BZ6CZfz0AWg0Oi/F6VQj9n9Dzf8ILOgTiKmaxXdia19fQuFAy+LoBxLF OCO9aEvfSPY2+lhkrBkv9+TzcSIFo6vb44jB2W1wH3sInPbxEznQ0KqZKqaD3NEwrHej aV+0fIwg6SiNqqstHNtItYIi8NL2WF/K0rwvZfGg9Xy8e1NAi04zqKhbKk82R/pvjrOe GBXSNdy1himxSJCBE1fGlr6ACQNitZI0NHHqMcX1YzfCBf1Hxb5GgfUfEiPYBdwacWBQ 866g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691512364; x=1692117164; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GFaCPHe174CVGEE8zH9Ahbm1V8fDZn/hHt9ByI29bII=; b=BaeEDJJAT3Wdn0m0jaxMnjjB3oxRN6qf+LqRdF81UicNsu8ckrjye3hJ3s6732U3wk VbRpC5xHi0pwzTOrh5OIZgC1Gj4BnvdDx7QrXlMGTAUt5scqIkAyLu/1GRlLv4GKD5R/ OJ9jz527sB52H/WVwI0AsoxLaLlkRh/uum64/qPWl6zbYRuiwu58icovM1aH92R14YBY cBKomORcxTbYpyuNhSFNgRfJWtCxNCuqLRck39b17k3XuCLtKRpf0e0B02+o1XiaenBT 9abBZv6LqUqaCTdUgiP/8YOea0FgcSE0lSvNPqLpp8IE2oRFIgRojUi/TIi4gRxRP2iC 7Mgg== X-Gm-Message-State: AOJu0YyXbrzFNvL9XRLH2tYIdsg+/XNyDNqUzjG8DduHjGmysEHbgEtL QGH1MAWX/uNs+U8QFWVNVaZ2hzBoPeWVxvL983wNVLOlTFMwBPyq7jR1Kw== X-Received: by 2002:a67:d095:0:b0:444:e9a0:13f7 with SMTP id s21-20020a67d095000000b00444e9a013f7mr5544633vsi.5.1691482400513; Tue, 08 Aug 2023 01:13:20 -0700 (PDT) MIME-Version: 1.0 References: <20230807193102.6374-1-brgl@bgdev.pl> <54421791-75fa-4ed3-8432-e21184556cde@lunn.ch> In-Reply-To: <54421791-75fa-4ed3-8432-e21184556cde@lunn.ch> From: Bartosz Golaszewski Date: Tue, 8 Aug 2023 10:13:09 +0200 Message-ID: Subject: Re: [PATCH 0/2] net: stmmac: allow sharing MDIO lines To: Andrew Lunn 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00,DATE_IN_PAST_06_12, DKIM_SIGNED,DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE 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 On Mon, Aug 7, 2023 at 9:50=E2=80=AFPM Andrew Lunn wrote: > > On Mon, Aug 07, 2023 at 09:31:00PM +0200, Bartosz Golaszewski wrote: > > From: Bartosz Golaszewski > > > > Two MACs may share MDIO lines to the PHYs. Let's allow that in the > > stmmac driver by providing a new device-tree property allowing one MAC > > node to reference the MDIO bus defined on a second MAC node. > > I don't understand why this is needed. phy-handle can point to a phy > on any MDIO bus. So it is no problem for one MAC to point to the other > MACs MDIO bus as is. > > You do sometimes get into ordering problems, especially if MAC0 is > pointing to a PHY on MAC1 MDIO bus. But MAC0 should get a > -EPROBE_DEFER, MAC1 then probes, creating its MDIO bus and the two > PHYs on it, and then later MAC0 is probes again and is successful. > > Andrew 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. When I fixed that, MAC1's probe is correctly deferred until MAC0 has created the MDIO bus. Even so, isn't it useful to actually reference the shared MDIO bus in some = way? If the schematics look something like this: -------- ------- | MAC0 |--MDIO-----| PHY | -------- | | ------- | | -------- | | ------- | MAC1 |-- ----| PHY | -------- ------- Then it would make sense to model it on the device tree? Anyway, this can be discussed later, I will drop this for now and send a fix for stmmac mdio code instead to get this upstream. Bart