Received: by 2002:a05:6a10:c7d3:0:0:0:0 with SMTP id h19csp341128pxy; Sat, 14 Aug 2021 08:27:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5o0+NHFDO3pghKtNSTW4telEYKLYriWY9ZFfMy99sN5L+GlX78udAK3AGwRU9b4jB7wUR X-Received: by 2002:a5d:96da:: with SMTP id r26mr6070344iol.47.1628954854328; Sat, 14 Aug 2021 08:27:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628954854; cv=none; d=google.com; s=arc-20160816; b=tc74M/DbuqzETBesjxgNwswn/rDpJOzszeLRoJeBS19+bes03AsLhZHZNeHL3xfPQU zt7VIswaQ00tUunoFiEi9HDRdHm2X17ebf9lp73Lv3srI/9MqVBVtQl0tCpQ5NPkZQhA x5lnWWLFuGxpQSQkL6dyIsNtuD1xquGjdj0otVsNzvprQpbOvyZp5FkxmA0OMtau9z+D pPQyIfEMgzelZZ0uwmgh8o9W3dutsVOQOjJL4N/YHSEDD5hNhyzYyVt0GHlZ8rQVXMUU o+Gw9PWPeS0fWEk4dKTkgWxMwEFBrkbk35AlPmzsTzSdoHIj/Oy2uZML8k6Bpb7SzjA/ txHw== 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=+xcyqJGzVSzEHEA1fuUegCx0faWqscCzNFFs988EPSQ=; b=ugucf2rS2HExGAXp1qbrFgOXPP17gM19iroiAw/A+lEjkOU251vJmAftXMeueFJbtX 3B4dnw+vX7fEspMXMfRWRrq6E65EG40K5spM6dZSZmQJdh9V1+V8hvNRJgsLyxw1hL0W wxT4Bq7S5+JOlDmpyOgFNWu/4p02hkrAEM4NGSEONkTsVzf3Ko1t+nC+O3iyg0F/zMXg w26xYTHbdX1+lrnFyOdCd9G5FY2GYusr6hUozDa3jVS3KV1DXRWnl9B9uQC1QCNzm/Kb JvpJkbR3b22eoPFC9MWAlyPx3/0bwanxHCuwaiPAiYxhjjbs45qjlmlPhl2F+jSrD8z3 DLlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=JeEF3Gbl; 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 i12si5024100ilu.162.2021.08.14.08.27.17; Sat, 14 Aug 2021 08:27:34 -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=JeEF3Gbl; 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 S238683AbhHNPXe (ORCPT + 99 others); Sat, 14 Aug 2021 11:23:34 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:50010 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238633AbhHNPXc (ORCPT ); Sat, 14 Aug 2021 11:23:32 -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=+xcyqJGzVSzEHEA1fuUegCx0faWqscCzNFFs988EPSQ=; b=JeEF3Gbl/zVxAi7G0NZONVh8rX x+bAcdPs1O2cIuLTVlZD3zJEyxsVB6/P0rf/9SMH9fEEfxzVa03u8DCRhoICnb5iIRNx88j/mqXVl oOJj531k7PO9kEIwpOqG53+8OJIxHuzPlXTBgIsxBmH/RGvk4uw0x6pO1sIkTFhuGQKU=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1mEvUr-0004vU-Fz; Sat, 14 Aug 2021 17:22:53 +0200 Date: Sat, 14 Aug 2021 17:22:53 +0200 From: Andrew Lunn To: Saravana Kannan Cc: Rob Herring , Frank Rowand , kernel-team@android.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH v1 2/2] of: property: fw_devlink: Add support for "phy-handle" property Message-ID: References: <20210814023132.2729731-1-saravanak@google.com> <20210814023132.2729731-3-saravanak@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210814023132.2729731-3-saravanak@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Saravana > Hi Andrew, > > Also there > are so many phy related properties that my head is spinning. Is there a > "phy" property (which is different from "phys") that treated exactly as > "phy-handle"? Sorry, i don't understand your question. > + /* > + * Device tree nodes pointed to by phy-handle never have struct devices > + * created for them even if they have a "compatible" property. So > + * return the parent node pointer. > + */ We have a classic bus with devices on it. The bus master is registers with linux using one of the mdiobus_register() calls. That then enumerates the bus, looking at the 32 possible address on the bus, using mdiobus_scan. It then gets a little complex, due to history. Originally, the only thing you could have on an MDIO bus was a PHY. But devices on MDIO busses are more generic, and Linux gained support for Ethernet switches on an MDIO bus, and there are a few other sort device. So to keep the PHY API untouched, but to add these extra devices, we added the generic struct mdio_device which represents any sort of device on an MDIO bus. This has a struct device embedded in it. When we scan the bus and find a PHY, a struct phy_device is created, which has an embedded struct mdio_device. The struct device in that is then registered with the driver core. So a phy-handle does point to a device, but you need to do an object orientated style look at the base class to find it. Andrew