From: Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org>
To: Richard Leitner
<richard.leitner-WcANXNA0UjBBDgjK7y7TUQ@public.gmane.org>
Cc: Andy Duan <fugang.duan-3arQi8VN3Tc@public.gmane.org>,
"robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org"
<robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
"mark.rutland-5wv7dgnIgG8@public.gmane.org"
<mark.rutland-5wv7dgnIgG8@public.gmane.org>,
"netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"dev-M/VWbR8SM2SsTnJN9+BGXg@public.gmane.org"
<dev-M/VWbR8SM2SsTnJN9+BGXg@public.gmane.org>
Subject: Re: [PATCH 2/2] net: ethernet: fsl: add phy reset after clk enable option
Date: Fri, 7 Jul 2017 16:00:10 +0200 [thread overview]
Message-ID: <20170707140010.GD24237@lunn.ch> (raw)
In-Reply-To: <b68f444e-cea4-acaa-d1e9-7955a577ed35-WcANXNA0UjBBDgjK7y7TUQ@public.gmane.org>
> Ok. I'm fine with moving the phy-reset-gpios binding into the PHY.
> But one question still remains: Who should then trigger the "hard
> reset" of the PHY?
Hi Richard
I think i see a few whys to do this, but first i need to check
something. Is the clock which is causing a problem this one:
/* clk_ref is optional, depends on board */
fep->clk_ref = devm_clk_get(&pdev->dev, "enet_clk_ref");
if (IS_ERR(fep->clk_ref))
fep->clk_ref = NULL;
Possible solutions:
1) clocks are referenced counted. If it is turned on twice, it needs
to be turned off twice before it is actually turned off. So, make
the PHY driver also clk_prepare_enable() this clock. When the FEC
tries to turn it off, it will stay ticking. Problem avoided, at the
expense of some power.
2) More complex, but make the PHY driver also a clock driver. Have the
PHY driver export a clock which the FEC use, as "enet_clk_ref". The
implementation of this clock, would both turn the real clock on,
and the perform the reset.
Both require no changes to the FEC, or any other MAC driver using this
PHY, so long as the MAC driver uses the common clock infrastructure to
control the clock to the PHY.
Andrew
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-07-07 14:00 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-06 13:05 [PATCH 1/2] net: ethernet: freescale: simplify fec_reset_phy Richard Leitner
[not found] ` <1499346330-12166-1-git-send-email-richard.leitner-WcANXNA0UjBBDgjK7y7TUQ@public.gmane.org>
2017-07-06 13:05 ` [PATCH 2/2] net: ethernet: fsl: add phy reset after clk enable option Richard Leitner
[not found] ` <1499346330-12166-2-git-send-email-richard.leitner-WcANXNA0UjBBDgjK7y7TUQ@public.gmane.org>
2017-07-06 13:55 ` Andrew Lunn
[not found] ` <20170706135557.GC8810-g2DYL2Zd6BY@public.gmane.org>
2017-07-06 14:33 ` Richard Leitner
2017-07-07 5:30 ` Andy Duan
[not found] ` <AM4PR0401MB2260ECD4508E26FF16670004FFAA0-4rsfagO7TJxhEPOT2zA1/I3W/0Ik+aLCnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2017-07-07 5:50 ` Richard Leitner
2017-07-07 7:03 ` Andy Duan
2017-07-07 9:52 ` Richard Leitner
2017-07-07 11:08 ` Andy Duan
2017-07-07 11:16 ` Richard Leitner
[not found] ` <b68f444e-cea4-acaa-d1e9-7955a577ed35-WcANXNA0UjBBDgjK7y7TUQ@public.gmane.org>
2017-07-07 14:00 ` Andrew Lunn [this message]
2017-07-12 9:21 ` Richard Leitner
[not found] ` <e6b838e5-af7a-07be-42db-59b901cc04db-WcANXNA0UjBBDgjK7y7TUQ@public.gmane.org>
2017-07-12 13:40 ` Andrew Lunn
2017-07-10 13:26 ` Rob Herring
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=20170707140010.GD24237@lunn.ch \
--to=andrew-g2dyl2zd6by@public.gmane.org \
--cc=dev-M/VWbR8SM2SsTnJN9+BGXg@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=fugang.duan-3arQi8VN3Tc@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=richard.leitner-WcANXNA0UjBBDgjK7y7TUQ@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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).