netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grant Edwards <grant.b.edwards@gmail.com>
To: netdev@vger.kernel.org
Subject: Re: net: macb: fail when there's no PHY
Date: Thu, 3 Dec 2020 03:03:30 -0000 (UTC)	[thread overview]
Message-ID: <rq9ki2$uqk$1@ciao.gmane.io> (raw)
In-Reply-To: 20201202211134.GM2324545@lunn.ch

On 2020-12-02, Andrew Lunn <andrew@lunn.ch> wrote:

>>> So it will access the MDIO bus of the PHY that is attached to the
>>> MAC.
>>
>> If that's the case, wouldn't the ioctl() calls "just work" even when
>> only the fixed-phy mdio bus and fake PHY are declared in the device
>> tree?
>
> The fixed-link PHY is connected to the MAC. So the IOCTL calls will be
> made to the fixed-link fake MDIO bus.

Ah! When you said "the PHY that is attached to the MAC" above, I
thought you meant electrically attached to the MAC via the mdio bus.

Then how does Forian Fainelli's solution below work? Won't the first
phy found be the fixed one, and then the ioctl() calls will use the
fixed-link bus?

Florian Fainelli wrote:

>>> You should be able to continue having the macb MDIO bus controller be
>>> registered with no PHY/MDIO devices represented in Device Tree such that
>>> user-space can continue to use it for ioctl() *and* you can point the
>>> macb node to a fixed PHY for the purpose of having fixed link parameters.
>>>
>>> There are various drivers that support exactly this mode of operation
>>> where they use a fixed PHY for the Ethernet MAC link parameters, yet
>>> their MDIO bus controller is used to interface with other devices such
>>> as Ethernet switches over MDIO. Example of drivers supporting that are
>>> stmmac, fec, mtk_star_emac and ag71xx. The way it ends up looking like
>>> in Device Tree is the following:
>>>
>>> &eth0 {
>>>         fixed-link {
>>>                 speed = <1000>;
>>>                 full-duplex;
>>>         };
>>>
>>>         mdio {
>>>                 phy0: phy@0 {
>>>                         reg = <0>;
>>>                 };
>>>         };
>>> };


  parent reply	other threads:[~2020-12-03  3:04 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-21 19:59 net: macb: fail when there's no PHY Grant Edwards
2017-09-21 20:05 ` Florian Fainelli
2017-09-21 20:36   ` Grant Edwards
2017-09-21 21:35     ` Brandon Streiff
2017-09-29  7:05       ` Harini Katakam
     [not found]   ` <CAK=1mW6Gti0QpUjirB6PfMCiQvnDjkbb56pVKkQmpCSkRU6wtA@mail.gmail.com>
2020-12-02 18:10     ` Florian Fainelli
2020-12-02 18:24       ` Grant Edwards
2020-12-02 18:35         ` Andrew Lunn
2020-12-02 19:16           ` Grant Edwards
2020-12-02 21:11             ` Andrew Lunn
2020-12-02 21:23               ` Grant Edwards
2020-12-03  2:39                 ` Andrew Lunn
2020-12-03  3:03               ` Grant Edwards [this message]
2020-12-03  3:42                 ` Florian Fainelli
2020-12-03  3:54                   ` Grant Edwards
2020-12-03  4:07                     ` Andrew Lunn
2020-12-03 15:07                       ` Grant Edwards
2020-12-03 21:17                         ` Andrew Lunn
2020-12-03 21:39                           ` Grant Edwards
2020-12-03 21:49                             ` Andrew Lunn
2020-12-03 22:20                               ` Grant Edwards
2020-12-04  8:28                                 ` Alexander Dahl
2020-12-04 17:36                                   ` Andrew Lunn
2020-12-04 16:47                     ` Florian Fainelli
2020-12-05  2:52                       ` Grant Edwards
2020-12-05  3:06                         ` Florian Fainelli
2020-12-03  4:00                 ` Andrew Lunn
2020-12-02 18:10   ` Grant Edwards

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='rq9ki2$uqk$1@ciao.gmane.io' \
    --to=grant.b.edwards@gmail.com \
    --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).