Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1670205imw; Tue, 5 Jul 2022 13:26:47 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u+WWyBvwdmyMpyDiUZYQT2f+puGL/Ib5mBMQbAiLTV3sFqISgyXpyuyqKe3iEQKV9F9oSw X-Received: by 2002:a17:90b:1c82:b0:1ee:eb41:b141 with SMTP id oo2-20020a17090b1c8200b001eeeb41b141mr45198992pjb.143.1657052806888; Tue, 05 Jul 2022 13:26:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657052806; cv=none; d=google.com; s=arc-20160816; b=yHAUc8kBKpcjeLf85Om/9d75GcQrrmV/jEgXEF0eOZjFF/TOYTT+0DcQ2H/7x19Mi1 E6+/t38PU/oZ3Zgo+Busz8HaVuWbFVklawVEJdOPuI35fZEHK65KGTp7lv35oYsN75yC JxjTn5o+K7EOU+mSdTKBpjE3aMLQlW+7DQIgizZ3K7/R78qeGXd33OFraa2j/mFHVPwO 5i+Ow88FIAR2l+1J0qGN8t0Yji4QGFyThaSiJStRSXnxOn/WemosgXRYs9tlEHyRSy+j R8jcaR5cdPa+keZYXpsKTiThaY6xz9h80sECsiWibIT3pV7d5+/bekt4kRCiygNo94oo 2gDQ== 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=ONPWuHGAM6kWNFap3DXPBrwE41N3WuQAN/EYPstEIcM=; b=yVuSohVTl6+c/LusPly6fo6tmWFqoZj8mZqB3IWDYW+vUBnYzUxckAINCMJmHACrzk MTogHBVvyvNfOsFpsqSp1w2yMWQkuoB/whyBaQQJvQ0aFYbaaXUEcOXdwG8oM7uheZHy aiwnEBGustOFf/EeHA0HY9FEwLt4vLxh2jfsstP9t4AgrkUP846j6sEw8ktg8k+/47qh E1NbwS+lDGWyLS4WFpxT4jpZ6fc7VDxV6sdlrQwzu2Td5t6kkzI/0pRXA4wu1wzd2z// 5xDZMEtDGwWYn9BqnKDuWi/v7yIlbZw3uGaRsBCXaqnifcjkoqYbUMAu9tNvXA4nFQKM SlGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=LgkaiVQa; 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 y20-20020a170902d65400b00168abe39847si16383549plh.43.2022.07.05.13.26.35; Tue, 05 Jul 2022 13:26:46 -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=LgkaiVQa; 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 S232565AbiGETtN (ORCPT + 99 others); Tue, 5 Jul 2022 15:49:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230079AbiGETtL (ORCPT ); Tue, 5 Jul 2022 15:49:11 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [185.16.172.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B8021D3; Tue, 5 Jul 2022 12:49:09 -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=ONPWuHGAM6kWNFap3DXPBrwE41N3WuQAN/EYPstEIcM=; b=LgkaiVQa6B8YDlpE26jrvbc4Vh FPJfILIydT2k1fCP+6v0qOZXrb6dcK6NzD1fDwr0D25lLfApKwXaHg8uJq6Ob3VdK972eJW3UjUuX DWcpP+xhZYMxT4pkhBeISJKQ9hyrymziBESry2GIuhi4BM9+ini6zgoeUX4HZipSP8E0=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1o8oXa-009PZu-CM; Tue, 05 Jul 2022 21:48:58 +0200 Date: Tue, 5 Jul 2022 21:48:58 +0200 From: Andrew Lunn To: Saravana Kannan Cc: "Pandey, Radhey Shyam" , "nicolas.ferre@microchip.com" , "claudiu.beznea@microchip.com" , "davem@davemloft.net" , "edumazet@google.com" , "kuba@kernel.org" , "pabeni@redhat.com" , "hkallweit1@gmail.com" , "linux@armlinux.org.uk" , "gregkh@linuxfoundation.org" , "rafael@kernel.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "git (AMD-Xilinx)" Subject: Re: [PATCH net-next v2] net: macb: In shared MDIO usecase make MDIO producer ethernet node to probe first Message-ID: References: <1656618906-29881-1-git-send-email-radhey.shyam.pandey@amd.com> 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,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 > > Thanks for the review. I want to get your thoughts on the outline of > > the generic solution. Is the current approach fine and we can extend it > > for all shared MDIO use cases/ or do we see any limitations? > > > > a) Figure out if the MDIO bus is shared. (new binding or reuse existing) > > b) If the MDIO bus is shared based on DT property then figure out if the > > MDIO producer platform device is probed. If not, defer MDIO consumer > > MDIO bus registration. > > Radhey, > > I think Andrew added me because he's pointing you towards fw_devlink. > > Andrew, > > I have intentionally not added phy-handle support to fw_devlink > because it would also prevent the generic driver from binding/cause > issues with DSA. I have some high level ideas on fixing that but > haven't gotten around to it yet. I took a quick look at macb, and i think it is actually broken in other ways. If you where to use NFS root, i suspect it would also fail. This also has nothing to do with shared MDIO busses as such. All it requires is some other MDIO bus, not the MACs own MDIO bus. It is also that we cannot return -EPROBE_DEFER when trying to connect the PHY, because it is not performed in the context of the probe, but the open. fw_dewlink might help solve this, bit it is not going to be easy. We can also split this into two problems; 1) probe time 2) suspend/resume macb does seem to probe, for most use cases. So we can probably ignore that for now. So we can concentrate on suspend/resume. You say suspend/resume is based on probe order. So it must build some sort of tree. Can we make phy_attach_direct add an additional link to this tree when a MAC device is link to a PHY? Is this what device_link_add() is about? Andrew