Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2136538pxb; Mon, 23 Aug 2021 12:52:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6wNcw2+7D7vsZT/vhAON0Zw6gYWGPFUqv4aXP9C2s9u4KW0q4NlidYSin3Jv1XYitU/U1 X-Received: by 2002:a17:906:2817:: with SMTP id r23mr36446722ejc.285.1629748356214; Mon, 23 Aug 2021 12:52:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629748356; cv=none; d=google.com; s=arc-20160816; b=luCx82H5Nn5tllfb81Me666i2yakynVkAe87PqIKdzWIM6VsjGtIs18fFZqaE9Df8n mAFSQJJv28o+ekUCNQoI00Ularv1FDwmWMIBnvC3Iu2wH18VSzHnxAa8gogqeqr/PgqS LYnczqt16YjqWkx+QAkUNTacBKmklsZA3KE+NQ2OQU3QsNKP77cnRtJRrSRCHSu4gS8n WGZDkQ6a8AUS7kP6qkQAIDjBFjhck4AKwE5N47mbqDfSVkyYf3Zay1JhTIwXgAFtS/TP ubqC2WY/2zHnyMROkVLzigcLMbwWv8m5V7yCCyzbSccEi/q8zMBxuE8y188q1hlGyqfP fDbg== 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=GSSeMlmpA7UhSuMUJ8NnHuiSMaN0kV8nPnwYdVCRwdE=; b=Uz1588jdsiqvVEEYX8BEp2X+ar1AGzDs2nr+HcQ4bJUUWeqhuvCzS1rOXMNnoVmv5C A6N92aknJ1lGGDmTR+19DfIdBeGo3syHSxh9uaplNVfrE2AfNe7RTOGeM1JBbaVDbKHv LqoKPBoW3eK2frk4Y0TtqJJBYqpP867AEbK6FRKu9bwdjY7j7Gzc4hEjKtGpfnNDjRJC 2ESfNEKSviR/RhvN3wyoJh0vL6U6SDWByfmOzHYYbKOG27jPep7MThsjAFh3T5U67kc9 o5FUpGTAuuw1W3caSt1uYPw7wdKwJ9RZh8AMhaopNOQepj5tJ2WswjCWBFZE9CivWVd2 ogAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=YYDn0FJE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mp42si17976851ejc.604.2021.08.23.12.52.12; Mon, 23 Aug 2021 12:52:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=YYDn0FJE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232081AbhHWTvf (ORCPT + 99 others); Mon, 23 Aug 2021 15:51:35 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:37326 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230187AbhHWTve (ORCPT ); Mon, 23 Aug 2021 15:51:34 -0400 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=GSSeMlmpA7UhSuMUJ8NnHuiSMaN0kV8nPnwYdVCRwdE=; b=YYDn0FJEfq94F9mZd7VN+ZUdl3 IrEwkHBWOyFNkLJDIdAxbjerzlwH+5rNlBMJo2LepZnMdYttK1qIBnwYNXrtst3hwXbFqjTBfufQg Hml08cBIHIpXfjgwqMY5+lRomFmHiuE5DrP9Vtq8NIqKH4d35BO3kDcYmNwTfD4XH4ro=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1mIFxv-003Vfs-8K; Mon, 23 Aug 2021 21:50:39 +0200 Date: Mon, 23 Aug 2021 21:50:39 +0200 From: Andrew Lunn To: Saravana Kannan Cc: Marek Szyprowski , Rob Herring , Frank Rowand , netdev@vger.kernel.org, kernel-team@android.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Neil Armstrong , linux-amlogic@lists.infradead.org Subject: Re: [PATCH v2] of: property: fw_devlink: Add support for "phy-handle" property Message-ID: References: <20210818021717.3268255-1-saravanak@google.com> <0a2c4106-7f48-2bb5-048e-8c001a7c3fda@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 23, 2021 at 11:13:08AM -0700, Saravana Kannan wrote: > On Mon, Aug 23, 2021 at 6:16 AM Andrew Lunn wrote: > > > > On Mon, Aug 23, 2021 at 02:08:48PM +0200, Marek Szyprowski wrote: > > > Hi, > > > > > > On 18.08.2021 04:17, Saravana Kannan wrote: > > > > Allows tracking dependencies between Ethernet PHYs and their consumers. > > > > > > > > Cc: Andrew Lunn > > > > Cc: netdev@vger.kernel.org > > > > Signed-off-by: Saravana Kannan > > > > > > This patch landed recently in linux-next as commit cf4b94c8530d ("of: > > > property: fw_devlink: Add support for "phy-handle" property"). It breaks > > > ethernet operation on my Amlogic-based ARM64 boards: Odroid C4 > > > (arm64/boot/dts/amlogic/meson-sm1-odroid-c4.dts) and N2 > > > (meson-g12b-odroid-n2.dts) as well as Khadas VIM3/VIM3l > > > (meson-g12b-a311d-khadas-vim3.dts and meson-sm1-khadas-vim3l.dts). > > > > > > In case of OdroidC4 I see the following entries in the > > > /sys/kernel/debug/devices_deferred: > > > > > > ff64c000.mdio-multiplexer > > > ff3f0000.ethernet > > > > > > Let me know if there is anything I can check to help debugging this issue. > > > > Hi Marek > > > > Please try this. Completetly untested, not even compile teseted: > > > > diff --git a/drivers/of/property.c b/drivers/of/property.c > > index 0c0dc2e369c0..7c4e257c0a81 100644 > > --- a/drivers/of/property.c > > +++ b/drivers/of/property.c > > @@ -1292,6 +1292,7 @@ DEFINE_SIMPLE_PROP(resets, "resets", "#reset-cells") > > DEFINE_SIMPLE_PROP(leds, "leds", NULL) > > DEFINE_SIMPLE_PROP(backlight, "backlight", NULL) > > DEFINE_SIMPLE_PROP(phy_handle, "phy-handle", NULL) > > +DEFINE_SIMPLE_PROP(mdio_parent_bus, "mdio-parent-bus", NULL); > > DEFINE_SUFFIX_PROP(regulators, "-supply", NULL) > > DEFINE_SUFFIX_PROP(gpio, "-gpio", "#gpio-cells") > > > > @@ -1381,6 +1382,7 @@ static const struct supplier_bindings of_supplier_bindings[] = { > > { .parse_prop = parse_leds, }, > > { .parse_prop = parse_backlight, }, > > { .parse_prop = parse_phy_handle, }, > > + { .parse_prop = parse_mdio_parent_bus, }, > > { .parse_prop = parse_gpio_compat, }, > > { .parse_prop = parse_interrupts, }, > > { .parse_prop = parse_regulators, }, > > Looking at the code, I'm fairly certain that the device that > corresponds to a DT node pointed to by mdio-parent-bus will be a "bus" > device that's registered with the mdio_bus_class. > > If my understanding is right, then Nak for this patch. It'll break a > lot of probes. > > TL;DR is that stateful/managed device links don't make sense for > devices that are never probed/bound to a driver. So some more background, which might help you get an idea what is going on here, and what you will need to implement. There are a number of different ways an mdio bus driver can come into existence. They can be classical devices, which are described in device tree and probed in the normal way. Most of the mdio bus drivers in driver/net/mdio are like this, and they have documented bindings, and compatible strings, e.g. Documentation/devicetree/bindings/net/marvell-orion-mdio.txt Multiplexers, which are probably a subclass of the above classical devices. They have documented binds and compatible strings. They link to another MDIO bus, and some other resource to switch the multiplexor, e.g, GPIOs, a MMIO register, a Linux multiplexer. They can be embedded inside some other device, typically an Ethernet controller, but also a Ethernet switch. In this case, the parent device should have an MDIO node in its device tree. An example would be the freescale FEC Documentation/devicetree/bindings/net/fsl,fec.yaml So if you are trying to fulfil dependencies for this sort of mdio bus, you need to probe the FEC driver, and as a side effect, the MDIO bus driver will pop into existence. Andrew