Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp5197ybk; Fri, 8 May 2020 16:46:35 -0700 (PDT) X-Google-Smtp-Source: APiQypJKXbTCrbO4XdpknOw9ZD904McCElDpcEA8n+IOPcqyNGZ9VGIm6hrY5rfnXx1KVfL65WIB X-Received: by 2002:a17:906:7d1:: with SMTP id m17mr3932515ejc.247.1588981595621; Fri, 08 May 2020 16:46:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588981595; cv=none; d=google.com; s=arc-20160816; b=z1lqkKVV9gWWVyYDmzGMZdPyPVNoiPyKntBM9hMtqvWpXvbPP1mHZ86tqi+FgMgqJP 6gGc/6MXS4m4l0S7J5uO6VY+U+UxdjtIA3J6/qvvIS0Sx/LpFL5mY96VYuvP/pG7dNR/ RIsEB/AFX4Pw5G60vjIYTslF2aUxEeeGtPDU8DpkNS40cZag1TEOa2Ekv0lSEqbVyHKE vLBM021dkn1F+01dtFgZmOwsk7Zxk4tc23z8xyzEuiOZZezj8aXuL3UGmoicgDi3X+24 uOxN38CBlw18rPOSvQ3OmH144sOL1chzd4noaVLJ591Q7TzvlyeGGRLJVhIaxZ8Eya2/ pkdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=VieCsnbAAH7ShY/le63Gu8FMcfhJPUddj2RQTmeSZkc=; b=YfMQ5vrlbdZXaLB2xEvCoAeFbOZWyT9uvNYeTM9VDWP5O3E8yyYfqeQ24BQdCHlh17 xH5WKP/KlstHzkD57auzMK3nBy82Hzq8oEMYYttEioUJAeZKeudq33xaZhBpnDFlBv49 A8F1vdQqdnFycVYc7Et9MeL+bD/766U4jeBfyRx5glSzrrNF02b4D26SIPHeNruHwcVA n927bML0WjV1rWwBgPVkGAx0YWD7sYm0+T15mfggTemPXzpmc7JX0vNBjkR4zP/ZZOxE YX6ynykffZHbvQi0dw/WySgsbSW64WArLKxGVIevQ/sUlh1aovIt2VybF/wv3Ni/nYjm 8Wkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lunn.ch header.s=20171124 header.b="j/zivjws"; 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 o6si1947668edz.574.2020.05.08.16.46.12; Fri, 08 May 2020 16:46:35 -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=fail header.i=@lunn.ch header.s=20171124 header.b="j/zivjws"; 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 S1728385AbgEHXnM (ORCPT + 99 others); Fri, 8 May 2020 19:43:12 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:50160 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727778AbgEHXnL (ORCPT ); Fri, 8 May 2020 19:43:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=VieCsnbAAH7ShY/le63Gu8FMcfhJPUddj2RQTmeSZkc=; b=j/zivjwsfKTO3NJdPZ1Xkc0NMS stqHbu/mibnqlxCUPiEvYElq+cYGn7gXuzGJw8Y9noaxxexZeAkB30T8zy8Z9okui8vzzlQnoI2ED VVZhLcyi4vETgL05SKfKuVbO4i618JeaQGJTGls8WuwreVQWM7bmWTAJ+PcHMuUyctZU=; Received: from andrew by vps0.lunn.ch with local (Exim 4.93) (envelope-from ) id 1jXCdt-001R9J-5t; Sat, 09 May 2020 01:42:57 +0200 Date: Sat, 9 May 2020 01:42:57 +0200 From: Andrew Lunn To: Jeremy Linton Cc: Calvin Johnson , Andy Shevchenko , "Rafael J . Wysocki" , Russell King - ARM Linux admin , linux.cj@gmail.com, Florian Fainelli , Cristi Sovaiala , Florin Laurentiu Chiculita , Ioana Ciornei , Madalin Bucur , Greg Kroah-Hartman , Heikki Krogerus , Varun Sethi , "Rajesh V . Bikkina" , ACPI Devel Maling List , Linux Kernel Mailing List , Diana Madalina Craciun , netdev , Marcin Wojtas , Laurentiu Tudor , Makarand Pawagi , linux-arm Mailing List , Pankaj Bansal , "David S. Miller" , Heiner Kallweit Subject: Re: [net-next PATCH v3 4/5] net: phy: Introduce fwnode_get_phy_id() Message-ID: <20200508234257.GA338317@lunn.ch> References: <20200505132905.10276-1-calvin.johnson@oss.nxp.com> <20200505132905.10276-5-calvin.johnson@oss.nxp.com> <67e263cf-5cd7-98d1-56ff-ebd9ac2265b6@arm.com> <83ab4ca4-9c34-4cdd-4413-3b4cdf96727d@arm.com> <20200508160755.GB10296@lsv03152.swis.in-blr01.nxp.com> <20200508181301.GF298574@lunn.ch> <1e33605e-42fd-baf8-7584-e8fcd5ca6fd3@arm.com> <20200508202722.GI298574@lunn.ch> <97a9e145-bbaa-efb8-6215-dc3109ee7290@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <97a9e145-bbaa-efb8-6215-dc3109ee7290@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 08, 2020 at 05:48:33PM -0500, Jeremy Linton wrote: > Hi, > > On 5/8/20 3:27 PM, Andrew Lunn wrote: > > > > There is a very small number of devices where the vendor messed up, > > > > and did not put valid contents in the ID registers. In such cases, we > > > > can read the IDs from device tree. These are then used in exactly the > > > > same way as if they were read from the device. > > > > > > > > > > Is that the case here? > > > > Sorry, I don't understand the question? > > I was asking in general, does this machine report the ID's correctly. Very likely, it does. > The embedded single mac:mdio per nic case seems like the normal case, and > most of the existing ACPI described devices are setup that way. Somebody in this thread pointed to ACPI patches for the MACCHIATOBin. If i remember the hardware correctly, it has 4 Ethernet interfaces, and two MDIO bus masters. One of the bus masters can only do C22 and the other can only do C45. It is expected that the busses are shared, not a nice one to one mapping. > But at the same time, that shifts the c22/45 question to the nic > driver, where use of a DSD property before instantiating/probing > MDIO isn't really a problem if needed. This in fact does not help you. The MAC driver has no idea what PHY is connected to it. The MAC does not know if it is C22 or C45. It uses the phylib abstraction which hides all this. Even if you assume 1:1, use phy_find_first(), it will not find a C45 PHY because without knowing there is a C45 PHY, we don't scan for it. And we should expect C45 PHYs to become more popular in the next few years. > In fact this embedded nic/mac/mdio/phy 1:1:1 case, is likely a requirement > for passthrough into a generic VM, otherwise someone has to create a virtual > mdio, and pass the phy in for the nic/mac. > > AFAIK, NXP's part avoids this despite having a shared MDIO, because the phy > state never leaves the mgmt side of the picture. It monitors the state and > then feeds that back into their nic mgmt complex rather than using it > directly. That is the other model. Don't use Linux to drive the PHY, use firmware in the MAC. A number of MACs do that, but it has the usual problems of firmware. It limits you on your choice of PHYs, bugs in the firmware cannot be fixed by the community, no sharing of drivers because firmware is generally proprietary, no 'for free features' because somebody else added features to the linux PHY driver etc. But it will make ACPI support simple, this whole discussion goes away, no ACPI needed at all. Andrew