netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sven Van Asbroeck <thesven73@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Bryan Whitehead <bryan.whitehead@microchip.com>,
	David S Miller <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>,
	Roelof Berg <rberg@berg-solutions.de>,
	netdev <netdev@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v1] lan743x: correctly handle chips with internal PHY
Date: Wed, 4 Nov 2020 16:52:28 -0500	[thread overview]
Message-ID: <CAGngYiWfHhyPLKi9Znf_aXNvU_HEEdKBAxbc8wfCGTdrbEhvHw@mail.gmail.com> (raw)
In-Reply-To: <20201104165509.GB1249360@lunn.ch>

Andrew,

On Wed, Nov 4, 2020 at 11:55 AM Andrew Lunn <andrew@lunn.ch> wrote:
> If you look at that patch, you see:
>
> -       ret = phy_connect_direct(netdev, phydev,
> -                                lan743x_phy_link_status_change,
> -                                PHY_INTERFACE_MODE_GMII);
> -       if (ret)
> -               goto return_error;
>
>
> That was added as part of the first commit for the lan743x
> driver. Changing that now seems dangerous.

I think there's a misunderstanding on my part, and it flows from the
following bit of the commit message in 6f197fb63850
("lan743x: Added fixed link and RGMII support"):

>   . The device tree entry phy-connection-type is supported now with
>     the modes RGMII or (G)MII (default).

I interpreted that to mean "if phy-connection-type is omitted, it will default
to G(MII)". However I now notice that the code in that patch does no such
thing: if that prop is omitted, the mode is actually silently set to
PHY_INTERFACE_MODE_NA, which is probably not great.

In summary, 6f197fb63850 behaves as follows:
1. if a devnode is present, attempts to configure the phy from devicetree,
   but silently breaks if phy-connection-type is omitted
2. if no devicetree node present, tries to connect to an internal phy using
  (G)MII (which silently breaks if an internal phy chip has a devicenode)

This proposed patch replaces this with:
1. attempts to configure the phy from devicetree, fails if no correct devicetree
   description present (phy-connection-type is required)
2. if (1) fails, tries to connect to an internal phy using (G)MII

As far as I can see, this doesn't appear to introduce any breaking changes?
It's of course quite possible that I've overlooked something, I am definitely
not a netdev/phy expert.

Sven

  parent reply	other threads:[~2020-11-04 21:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-04 16:08 [PATCH v1] lan743x: correctly handle chips with internal PHY Sven Van Asbroeck
2020-11-04 16:27 ` Andrew Lunn
2020-11-04 16:39   ` Sven Van Asbroeck
2020-11-04 16:55     ` Andrew Lunn
2020-11-04 17:10       ` Sven Van Asbroeck
2020-11-04 21:52       ` Sven Van Asbroeck [this message]
2020-11-04 21:58 ` Jakub Kicinski
2020-11-04 22:35   ` Sven Van Asbroeck

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=CAGngYiWfHhyPLKi9Znf_aXNvU_HEEdKBAxbc8wfCGTdrbEhvHw@mail.gmail.com \
    --to=thesven73@gmail.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=bryan.whitehead@microchip.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rberg@berg-solutions.de \
    /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).