Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754005AbdFMVQD (ORCPT ); Tue, 13 Jun 2017 17:16:03 -0400 Received: from vps0.lunn.ch ([178.209.37.122]:48429 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752168AbdFMVQC (ORCPT ); Tue, 13 Jun 2017 17:16:02 -0400 Date: Tue, 13 Jun 2017 23:15:54 +0200 From: Andrew Lunn To: Salil Mehta Cc: Florian Fainelli , "davem@davemloft.net" , "Zhuangyuzeng (Yisen)" , huangdaode , "lipeng (Y)" , "mehta.salil.lnk@gmail.com" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Linuxarm Subject: Re: [PATCH net-next 6/9] net: hns3: Add MDIO support to HNS3 Ethernet driver for hip08 SoC Message-ID: <20170613211554.GD15847@lunn.ch> References: <20170610034630.493852-1-salil.mehta@huawei.com> <20170610034630.493852-7-salil.mehta@huawei.com> <20170611024314.GD26740@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 701 Lines: 17 > You are correct is_c45 should not be derived from the type of PHY like > it is being done here. I have changed this code and now we are getting this > information from the IMP(Integrated Management Processor) which handles > the NIC commands and also maintains Ethernet specific configuration. Florian With c22, registering the MDIO bus is enough to cause all c22 addresses to be probed and the PHYs found. If you are not using device tree, you can then use phy_find_first() to get the first phy on the bus. As far as i remember, this does not work for c45. mdiobus_scan() is only looking for c22 PHYs. Maybe we should be making mdiobus_scan() look first for a c45 and then try c22? Andrew