From: Andrew Lunn <andrew@lunn.ch>
To: Sven Van Asbroeck <thesven73@gmail.com>
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 17:55:09 +0100 [thread overview]
Message-ID: <20201104165509.GB1249360@lunn.ch> (raw)
In-Reply-To: <CAGngYiUtMN0nOV+wZC-4ycwOAvU=BqhdP7Z3PUPh2GX8Fvo3jg@mail.gmail.com>
On Wed, Nov 04, 2020 at 11:39:47AM -0500, Sven Van Asbroeck wrote:
> Hi Andrew, many thanks for looking at this patch !
>
> On Wed, Nov 4, 2020 at 11:27 AM Andrew Lunn <andrew@lunn.ch> wrote:
> >
> > > Note that as a side-effect, the devicetree phy mode now no longer
> > > has a default, and always needs to be specified explicitly (via
> > > 'phy-connection-type').
> >
> > That sounds like it could break systems. Why do you do this?
>
> Because the standard mdio library function (of_phy_get_and_connect())
> does not appear to support a default value. The original driver
> code duplicated that library function's code, with a slight
> tweak - the default value.
>
> The default value was introduced quite recently, in the commit which
> this patch fixes:
> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/drivers/net/ethernet/microchip/lan743x_main.c?h=v5.9.3&id=6f197fb63850b26ef8f70f1bfe5900e377910a5a
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.
This is a fix you want backporting to stable. Such fixes should be
minimal, and obviously correct. So i suggest you keep with the open
coded version of of_phy_get_and_connect(), and make sure it keeps with
the default as PHY_INTERFACE_MODE_GMII. That can be committed to net
as a fix.
You can then consider a refactoring patch for net-next, and see about
modifying of_phy_get_and_connect() to do what you need.
Andrew
next prev parent reply other threads:[~2020-11-04 16:55 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 [this message]
2020-11-04 17:10 ` Sven Van Asbroeck
2020-11-04 21:52 ` Sven Van Asbroeck
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=20201104165509.GB1249360@lunn.ch \
--to=andrew@lunn.ch \
--cc=UNGLinuxDriver@microchip.com \
--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 \
--cc=thesven73@gmail.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