netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Salil Mehta <salil.mehta@huawei.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"Zhuangyuzeng (Yisen)" <yisen.zhuang@huawei.com>,
	huangdaode <huangdaode@hisilicon.com>,
	"lipeng (Y)" <lipeng321@huawei.com>,
	"mehta.salil.lnk@gmail.com" <mehta.salil.lnk@gmail.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Linuxarm <linuxarm@huawei.com>
Subject: Re: [PATCH net-next 6/9] net: hns3: Add MDIO support to HNS3 Ethernet driver for hip08 SoC
Date: Wed, 14 Jun 2017 00:40:42 +0200	[thread overview]
Message-ID: <20170613224042.GF15847@lunn.ch> (raw)
In-Reply-To: <F4CC6FACFEB3C54C9141D49AD221F7F93B7A2554@FRAEML521-MBX.china.huawei.com>

> > 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.

      Andrew

  reply	other threads:[~2017-06-13 22:40 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-10  3:46 [PATCH net-next 0/9] Hisilicon Network Subsystem 3 Ethernet Driver Salil Mehta
2017-06-10  3:46 ` [PATCH net-next 1/9] net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC Salil Mehta
2017-06-10 12:43   ` Mintz, Yuval
2017-06-13 17:08     ` Salil Mehta
2017-06-14  8:04       ` Mintz, Yuval
2017-06-17 12:00         ` Salil Mehta
2017-06-10  3:46 ` [PATCH net-next 2/9] net: hns3: Add support of the HNAE3 framework Salil Mehta
2017-06-10  3:46 ` [PATCH net-next 3/9] net: hns3: Add HNS3 IMP(Integrated Mgmt Proc) Cmd Interface Support Salil Mehta
2017-06-10  3:46 ` [PATCH net-next 4/9] net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support Salil Mehta
2017-06-10  3:46 ` [PATCH net-next 5/9] net: hns3: Add support of TX Scheduler & Shaper to HNS3 driver Salil Mehta
2017-06-10  3:46 ` [PATCH net-next 6/9] net: hns3: Add MDIO support to HNS3 Ethernet driver for hip08 SoC Salil Mehta
2017-06-10 19:04   ` Florian Fainelli
2017-06-11  2:43     ` Andrew Lunn
2017-06-13 20:47       ` Salil Mehta
2017-06-13 21:15         ` Andrew Lunn
2017-06-13 21:37     ` Salil Mehta
2017-06-13 22:40       ` Andrew Lunn [this message]
2017-06-13 23:01         ` Salil Mehta
2017-06-14  1:10           ` Andrew Lunn
2017-06-17 11:10             ` Salil Mehta
2017-06-10  3:46 ` [PATCH net-next 7/9] net: hns3: Add Ethtool support to HNS3 driver Salil Mehta
2017-06-10  3:46 ` [PATCH net-next 8/9] net: hns3: Add support of debugfs interface " Salil Mehta
2017-06-10 12:51   ` Mintz, Yuval
2017-06-10 16:35     ` Andrew Lunn
2017-06-13 17:16       ` Salil Mehta
2017-06-13 17:14     ` Salil Mehta
2017-06-10  3:46 ` [PATCH net-next 9/9] net: hns3: Add HNS3 driver to kernel build framework & MAINTAINERS Salil Mehta
2017-06-11 13:41   ` kbuild test robot
2017-06-11 13:41   ` kbuild test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170613224042.GF15847@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=huangdaode@hisilicon.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=lipeng321@huawei.com \
    --cc=mehta.salil.lnk@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=salil.mehta@huawei.com \
    --cc=yisen.zhuang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).