From: Marco Felsch <m.felsch@pengutronix.de>
To: Marek Vasut <marex@denx.de>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
Oleksij Rempel <o.rempel@pengutronix.de>,
Andrew Lunn <andrew@lunn.ch>,
netdev@vger.kernel.org, Russell King <linux@armlinux.org.uk>,
linux-kernel@vger.kernel.org, mkl@pengutronix.de,
kernel@pengutronix.de, David Jander <david@protonic.nl>
Subject: Re: PHY reset question
Date: Wed, 7 Oct 2020 12:47:57 +0200 [thread overview]
Message-ID: <20201007104757.fntgjiwt4tst3w3f@pengutronix.de> (raw)
In-Reply-To: <2b6a1616-beb8-fd12-9932-1e7d1ef04769@denx.de>
On 20-10-07 11:20, Marek Vasut wrote:
> On 10/7/20 11:06 AM, Marco Felsch wrote:
...
> > You're right, just wanted to provide you a link :)
>
> Can you CC me on the next version of those patches ? I seems the LAN8710
> is causing grief to many.
No need to since this serie was already applied.
> >> but isn't the
> >> last patch 5/5 breaking existing setups ?
> >
> > IMHO the solution proposed using the PHY_RST_AFTER_CLK_EN was wrong so
> > we needed to fix that. Yes we need to take care of DT backward
> > compatibility but we still must be able to fix wrong behaviours within
> > the driver. I could also argue that PHY_RST_AFTER_CLK_EN solution was
> > breaking exisitng setups too.
> >
> >> The LAN8710 surely does need
> >> clock enabled before the reset line is toggled.
> >
> > Yep and therefore you can specify it yet within the DT.
>
> So the idea is that the PHY enables the clock for itself . And if the
> MAC doesn't export these clock as clk to which you can refer to in DT,
> then you still need the PHY_RST_AFTER_CLK_EN flag, so the MAC can deal
> with enabling the clock ? Or is the idea to fix the MAC drivers too ?
First we need to consider that the PHY_RST_AFTER_CLK_EN flag gets only
handled by the imx-fec driver currently. This particular MAC driver
don't provide clks instead it is just a clock consumer. The clock is
coming from the clock driver and the clk-id is IMX6QDL_CLK_ENET_REF. If
the imx host is the clock provider for smsc-phy you need to specify that
clock-id. There are other phy-drivers using the same mechanism currently.
But yes, you need at least one clock provider. My solution is not
complete as Florian proposal [1] since it rely on the fact that the MAC
enables all clocks before probing the mdio bus. Luckily the imx-fec
driver has this behaviour and my patches are valid till Florian's
patches are merged. Resetting the phy should only be done within the phy
state machine and not from outside without respecting the phy state
since this can cause undefined behaviours.
Florian did you send a new version of those patches?
[1] https://www.spinics.net/lists/netdev/msg680412.html
next prev parent reply other threads:[~2020-10-07 10:48 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-06 8:04 PHY reset question Oleksij Rempel
2020-10-06 19:36 ` Florian Fainelli
2020-10-06 20:24 ` Marek Vasut
2020-10-06 21:11 ` Florian Fainelli
2020-10-06 22:24 ` Marek Vasut
2020-10-07 8:14 ` Marco Felsch
2020-10-07 8:23 ` Marek Vasut
2020-10-07 9:06 ` Marco Felsch
2020-10-07 9:20 ` Marek Vasut
2020-10-07 10:47 ` Marco Felsch [this message]
2020-10-07 15:44 ` Florian Fainelli
2020-10-07 9:50 ` Fabio Estevam
2020-10-09 14:25 ` Bruno Thomsen
2020-10-12 5:48 ` Oleksij Rempel
2020-10-12 8:25 ` Marek Vasut
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=20201007104757.fntgjiwt4tst3w3f@pengutronix.de \
--to=m.felsch@pengutronix.de \
--cc=andrew@lunn.ch \
--cc=david@protonic.nl \
--cc=f.fainelli@gmail.com \
--cc=kernel@pengutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=marex@denx.de \
--cc=mkl@pengutronix.de \
--cc=netdev@vger.kernel.org \
--cc=o.rempel@pengutronix.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).