Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp4754826rwb; Tue, 8 Aug 2023 13:20:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGwgdY65WcgYbeWGKk14Rz4j4zMWo2BEfEJdfMSFPWK7YlWGf+mFxEUh0Hub3P51LGEijuS X-Received: by 2002:a17:902:74c3:b0:1bb:d048:3173 with SMTP id f3-20020a17090274c300b001bbd0483173mr711803plt.61.1691526028468; Tue, 08 Aug 2023 13:20:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691526028; cv=none; d=google.com; s=arc-20160816; b=K44UAX5DysVVpxSABICf7oxq/q1WBhgLcbnNKT/9X44s99QmNmXJcW4R36+atYgpgj Ark1H0eFWyWP2uqP5MWznZB+MUhPPpKtiEpyfyMdK0OcJXoguZBiGPGyrleX3UoS9E2G 8CjPO2UOg+gwpaRKqmAzFhtn/ekBygz9N9/6FliK5B9+pSSkedWiL8xIj8T9dMittaU8 Vjxvh4B2K68shjvEMhbK0zWM4e3Mkf44ycE7ZBckL37sJHAKSOYuFz1MbMYTOI3+JwPd FUmTD5F6fHsFSS4dS/k55xynx+q34wUWWymNV1Nw+hx9/Gi5t0cyPYAE1ufjya9FxdiO AwGQ== 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=ajwdCnT8njC9y5kbONtAi0NxS4A3FaITcmOZgzwf/nk=; fh=K7wEr+7g+B8QFN2uxX9XJHO9w//lTmrQbt7uDT3K2QE=; b=iG6jB25qlcF6c0YQ2iVUJaFoRDW7gnLb237Ooewq0LQZuQ5AFvGGTF4ncDXedNn730 juNs8Jd18EEphu4WaW/O2pFXLaKGljSrAqsvQzrx/rtOM2LZNne7vxvv63clshlLWIQF lfmiCngXTbEJwDHcJR+ClBfFmvVzb8dBdv6NoMHL9/fOvb291QTYNptChaE1+KwqCfrC Q58/JbrxPeMPdkcP51cRSMUbuZUru3pbgao3RHK/XgcTGzrCLCyy5UzBUiBx9ky/NLc2 BmYZhvniWngvX6F2SS1w3mx9XDNmeeIvE6YWadb4W9+2eOL+I/DFA6TbmymYv+g8YmmB rz+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=eQBZkvjx; 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 d14-20020a170903230e00b001b86dfad851si5830136plh.253.2023.08.08.13.20.16; Tue, 08 Aug 2023 13:20:28 -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=eQBZkvjx; 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 S235237AbjHHSHa (ORCPT + 99 others); Tue, 8 Aug 2023 14:07:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235348AbjHHSHG (ORCPT ); Tue, 8 Aug 2023 14:07:06 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59B5761B22; Tue, 8 Aug 2023 10:07:30 -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=ajwdCnT8njC9y5kbONtAi0NxS4A3FaITcmOZgzwf/nk=; b=eQBZkvjxp0IEb/UJPuCjaB0n9U GWy8dZfyNBaMiwnXFECFy1K/3U/ALGlee1P8V+1bWgkDxMsQGq98TB042L7bTiflTtjccVhhGmFww w3W7hwFV8sf4skQ3nFjQPaO6ioKfHOCZ3ew26CuHTwDVOEkxbJ1UUGLDMBVMe1tG+Zo8=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1qTOQz-003Th8-1Y; Tue, 08 Aug 2023 17:15:45 +0200 Date: Tue, 8 Aug 2023 17:15:45 +0200 From: Andrew Lunn To: Andrew Halaney Cc: Bartosz Golaszewski , "Russell King (Oracle)" , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alexandre Torgue , Jose Abreu , Maxime Coquelin , 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: References: <20230807193102.6374-1-brgl@bgdev.pl> <54421791-75fa-4ed3-8432-e21184556cde@lunn.ch> <65b53003-23cf-40fa-b9d7-f0dbb45a4cb2@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED 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 > I'll make the water muddier (hopefully clearer?). I have access to the > board schematic (not SIP/SOM stuff though), but that should help here. > > MAC0 owns its own MDIO bus (we'll call it MDIO0). It is pinmuxed to > gpio8/gpio9 for mdc/mdio. MAC1 owns its own bus (MDIO1) which is > pinmuxed to gpio21/22. > > On MDIO0 there are two SGMII ethernet phys. One is connected to MAC0, > one is connected to MAC1. > > MDIO1 is not connected to anything on the board. So there is only one > MDIO master, MAC0 on MDIO0, and it manages the ethernet phy for both > MAC0/MAC1. > > Does that make sense? I don't think from a hardware design standpoint > this is violating anything, it isn't a multimaster setup on MDIO. Thanks for taking a detailed look at the schematics. This is how i would expect it to be. > > > > Good point, but it's worse than that: when MAC0 is unbound, it will > > > > unregister the MDIO bus and destroy all PHY devices. These are not > > > > refcounted so they will literally go from under MAC1. Not sure how > > > > this can be dealt with? > > > > > > unbinding is not a normal operation. So i would just live with it, and > > > if root decides to shoot herself in the foot, that is her choice. > > > > > > > I disagree. Unbinding is very much a normal operation. What do you use it for? I don't think i've ever manually done it. Maybe as part of a script to unbind the FTDI driver from an FTDI device in order to use user space tools to program the EEPROM? But that is about it. I actually expect many unbind operations are broken because it is very rarely used. Andrew