Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp41209ybk; Fri, 8 May 2020 13:29:56 -0700 (PDT) X-Google-Smtp-Source: APiQypKKxmra4cSXlaITAhCZhYV2tv/bbVo0mW/kUFnLroLWfveNv4rp9mvpkHlpVw1pCSah0p/h X-Received: by 2002:a05:6402:3121:: with SMTP id dd1mr3888582edb.168.1588969796248; Fri, 08 May 2020 13:29:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588969796; cv=none; d=google.com; s=arc-20160816; b=JyNpvKe5V1kVl5gGlTpl+P19+KVWxwd4XFX/aovXEUELKYhW0jC7yCAaJ8CXrtM4Vt xJl7yabN3+/pAOoI5Zhg9axdxXQ35KSYG1I+YQItjSzVKoMRfVSi9s9tmR7KlwiwNhOj htxCc+G7+QxJdb7Rs3YcT5YSCTQsOpI1lrXoxbEEhPtJlUyeSFNYmCP49zpwWoNoR9Jz bMgcSw1YZ5u50Ez/Lk0DpSr90aloZfEO18lNLH6RE8hQOgk+1WUB5nM+EOnFpO+Kvwv4 IKNuo0lJmw5Qg0q9270mllH2QvqHl1BCKDDMbjrPFggehOOeOatNLNUNlD40e5HHfZnm VYfw== 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=99PO3vaZTM46qvS0LR8bXv5m1BEVlIFvFmNNPuHSrcU=; b=rJ7QAW1Ce9Lh1SNs/GoJ2AxPOQ7hAukc4WXM3kmalU8Pr7uxb8wF+pBL+9kh52XM3J PUmBnY31cs+e4SEge78wKfZFx/d4DqTDji4uxQT5oQvVFDURkmHGyK1401TqKzlP0XLn X4y907AjdQtDcp4VlNAQZcy11xnFaHHGqJqEuyW79usTBIziY/UHKQ+8ey6wBMYk/8YF H27APXPzZInczS2vBRKAX3P/vE5D4bYsM9O9MxIHTGwJT5x7OmoB04yrS+/O24lhzLJY 0N7FNCPyGbP7kWIb1f2izRTEJyTitAy7Cua5/ZvAj13O+k8C9vQI75UQ9tcBL10eJpEp gn6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lunn.ch header.s=20171124 header.b=W5D2scAP; 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 dx23si1638078ejb.181.2020.05.08.13.29.06; Fri, 08 May 2020 13:29:56 -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=W5D2scAP; 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 S1727778AbgEHU1h (ORCPT + 99 others); Fri, 8 May 2020 16:27:37 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:49908 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726811AbgEHU1g (ORCPT ); Fri, 8 May 2020 16:27:36 -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=99PO3vaZTM46qvS0LR8bXv5m1BEVlIFvFmNNPuHSrcU=; b=W5D2scAPXtxzyvIYaVnSFKVXeL ZqkHeN4Ll77OUV9rI72SL8SPBFaWhVarfaXMhS/ggsB1zhom6zD9coCA0B5vJ6qy2LhJH2ZHGvFAV h0NldpoKACJnE+1za8zyt18VTFJZO3SPLta76FPexc3DJhgMMy2idyfNfkFugBkt8QKE=; Received: from andrew by vps0.lunn.ch with local (Exim 4.93) (envelope-from ) id 1jX9ac-001Pvw-Kd; Fri, 08 May 2020 22:27:22 +0200 Date: Fri, 8 May 2020 22:27:22 +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: <20200508202722.GI298574@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1e33605e-42fd-baf8-7584-e8fcd5ca6fd3@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > 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? > Also, how much of this was caused by uboot being deficient None. It is a silicon issue. The PHY chip simply has the wrong or no ID value in the registers. > > Not exactly true. It is the combination of can the bus master do C45 > > and can the device do C45. Unfortunately, we have no knowledge of the > > bus masters capabilities, if it can do C45. And many MDIO drivers will > > do a C22 transaction when asked to perform a C45 transaction. All new > > submissions for MDIO drivers i ask for EOPNOTSUPP to be returned if > > C45 is not supported. But we cannot rely on that. Too much history > > > > > > > I tend to agree with you on this. Even for DT, ideal case, IMO should be: > > > > > > 1) mdiobus_scan scans the mdiobus for c22 devices by reading phy id from > > > registers 2 and 3 > > > 2) if not found scan for c45 devices <= looks like this is missing in Linux > > > 3) look for phy_id from compatible string. > > > > It is somewhat more complex, in that there are a small number of > > devices which will respond to both C22 and C45. Generally, you want to > > use C45 if supported. So you would want to do the C45 scan first. But > > then the earlier problem comes to play, you have no idea if the bus > > master actually correctly supports C45. > > But this shouldn't this be implied by the mdio vendor/model? Nope. Many MDIO bus masters don't even appear in DT, because they are embedded into the MAC driver. The MAC driver just instantiates an MDIO device, maybe passing a pointer where to find the PHY properties in DT. If the MDIO bus master is in its own address range, then it probably does exist in device tree, and has a compatible string. But that just gets the driver loaded, it says nothing about what it is capable of, C22 and or C45. And there are cases where the MDIO bus is embedded inside an Ethernet switch, which is hanging off another MDIO bus, etc. > How much of this can be simplified for ACPI buy ignoring the legacy and > putting some guides around the ACPI/platform requirements? You can probably ignore the phy-idXXXX.YYYY compatible, since that is working around silicon issues, and put in place some guidelines that the PHY silicon needs to conform to the basics of C22 and C45 in terms of ID registers. C45 you are going to need. ACPI tends to be more high end devices, which in general have higher speed network interfaces. Multi-Gige PHYs tend to be C45. But there is also interest in using ACPI on 1G PHYs where the majority is C22. Andrew