From: Florian Fainelli <f.fainelli@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>,
Dinh Nguyen <dinguyen@opensource.altera.com>
Cc: David Daney <ddaney@caviumnetworks.com>,
"David S. Miller" <davem@davemloft.net>,
david.daney@cavium.com, netdev@vger.kernel.org,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: SoCFPGA ethernet broken
Date: Fri, 16 Oct 2015 11:17:55 -0700 [thread overview]
Message-ID: <56213F53.4030205@gmail.com> (raw)
In-Reply-To: <20151016155644.GJ10146@lunn.ch>
On 16/10/15 08:56, Andrew Lunn wrote:
>> So I think I'll move to inspect what Florian had suggested, and that was to look
>> at: drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c::stmmac_mdio_register
>
> I have a suspicion. If you look at the phy driver it does:
>
> static int ksz9021_config_init(struct phy_device *phydev)
> {
> const struct device *dev = &phydev->dev;
> const struct device_node *of_node = dev->of_node;
>
> if (!of_node && dev->parent->of_node)
> of_node = dev->parent->of_node;
>
>
> In your case, you don't have a phy node in your device tree, so of_node
> is NULL. So it looks in the parent device.
>
> phylib: Make PHYs children of their MDIO bus, not the bus' parent.
>
> changed what the parent is. It is now the mdio device. Before, i
> suspect it was the MAC. Hence it found your properties in the MAC
> node.
>
> What i think you might want to do is change this code. Rather than
> look a dev->parent->of_node; you might want
> phydev->attached_dev->dev->of_node.
Yes, that would work, by the time config_init() executes, you are
guaranteed to have a valid attached_dev pointer.
>
> This assumes the phy has been attached to the MAC. I've no idea of the
> ordering, so maybe it has not been attached yet?
>
> dp83867.c has similar code. However quick grep did not find any
> mainline users with properties in the MAC node. If that is true, i
> would suggest removing the code looking in the parent for that phy
> driver.
I think we should fix these drivers to look for these properties where
they were used to, as a short term plan, and then make sure that their
binding document is very specific about the fact that these properties,
are by definition, properties of the Ethernet PHY, not the Ethernet MAC.
--
Florian
next prev parent reply other threads:[~2015-10-16 18:17 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-15 19:09 SoCFPGA ethernet broken Dinh Nguyen
2015-10-15 20:03 ` Florian Fainelli
2015-10-15 19:59 ` Dinh Nguyen
2015-10-15 20:25 ` Florian Fainelli
2015-10-15 20:35 ` David Daney
2015-10-15 20:49 ` Dinh Nguyen
2015-10-15 21:30 ` Florian Fainelli
2015-10-16 2:32 ` Dinh Nguyen
2015-10-16 3:31 ` Andrew Lunn
2015-10-16 14:38 ` Dinh Nguyen
2015-10-16 15:03 ` Andrew Lunn
2015-10-16 15:31 ` Dinh Nguyen
2015-10-16 15:56 ` Andrew Lunn
2015-10-16 16:47 ` David Daney
2015-10-16 19:10 ` Dinh Nguyen
2015-10-16 19:38 ` Andrew Lunn
2015-10-16 20:24 ` David Daney
2015-10-16 20:29 ` Andrew Lunn
2015-10-19 15:14 ` Dinh Nguyen
2015-10-16 18:17 ` Florian Fainelli [this message]
2015-10-16 3:04 ` Dinh Nguyen
2015-12-03 20:48 ` Pavel Machek
2015-12-03 21:23 ` David Daney
2015-12-03 23:17 ` Dinh Nguyen
2015-12-04 1:10 ` Andrew Lunn
2015-12-04 1:50 ` Andrew Lunn
2015-12-04 11:27 ` Dinh Nguyen
2015-12-04 14:31 ` Andrew Lunn
2015-12-04 9:38 ` Pavel Machek
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=56213F53.4030205@gmail.com \
--to=f.fainelli@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=david.daney@cavium.com \
--cc=ddaney@caviumnetworks.com \
--cc=dinguyen@opensource.altera.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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).