Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753908AbdFMXCC convert rfc822-to-8bit (ORCPT ); Tue, 13 Jun 2017 19:02:02 -0400 Received: from szxga03-in.huawei.com ([45.249.212.189]:7415 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752259AbdFMXCA (ORCPT ); Tue, 13 Jun 2017 19:02:00 -0400 From: Salil Mehta To: Andrew Lunn 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 Thread-Topic: [PATCH net-next 6/9] net: hns3: Add MDIO support to HNS3 Ethernet driver for hip08 SoC Thread-Index: AQHS4ZxgU7WX1+yFm0OA+cc1rCELGqIeU/MAgAS6e/CAADj/AIAAJYNg Date: Tue, 13 Jun 2017 23:01:44 +0000 Message-ID: References: <20170610034630.493852-1-salil.mehta@huawei.com> <20170610034630.493852-7-salil.mehta@huawei.com> <20170613224042.GF15847@lunn.ch> In-Reply-To: <20170613224042.GF15847@lunn.ch> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.203.181.160] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020201.59406EE4.00F6,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=169.254.1.104, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 9828f87970c6be6403beb40cf3e60541 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2298 Lines: 66 Hi Andrew, > -----Original Message----- > From: Andrew Lunn [mailto:andrew@lunn.ch] > Sent: Tuesday, June 13, 2017 11:41 PM > 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 > > > > Hum why do you do this? mdiobus_register() will scan through your > bus > > > provided that you set an appropriate phy_mask value (here you tell > it > > > not to) and you already provide the PHY address to scan for > > > > > I know this looks weird but the reason why it appears as it is in > code is: > > > > mdiobus_register() calls mdiobus_scan(). If you see below code leg > function > > get_phy_device() assumes to be having supporting Clause 22 so its > input > > parameter 'is_c45' is always 'false'. > > > > struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr) > > { > > struct phy_device *phydev; > > int err; > > > > phydev = get_phy_device(bus, addr, false); > > if (IS_ERR(phydev)) ^^^^^ > > return phydev; > > [...] > > } > > > > Therefore, to support C45 device we did below: > > > > * disabled the autoscan/mdiobus_scan() Of the PHY devices using the > > phy_mask(= ~0) > > * Now, did almost the same thing what mdiobus_scan does i.e. > > * get_phy_device but with is_c45 (=true/false) > > * register the above phy device with phy_device_register() > > > > There could be some gap in my understanding, please help to correct > this? > > So this is the question i was asking Florian > > Rather than hack around limitations of the core, you should fix the > core. I think we should make the core first try probing using c45. If > that comes back with an error, or does not find a device, try the > probe using c22. I can take this activity but please allow me to do this as a separate activity and not part of this driver Up-streaming activity. Since I would be touching the core, lots of drivers will get impacted and will have to wait till everyone gives clean signal. This will impact our internal deadlines. But as I said I am eager to cooperate & contribute :) Thanks Salil > > Andrew