From: Andrew Lunn <andrew@lunn.ch>
To: Paul Burton <paul.burton@mips.com>
Cc: Darren Hart <dvhart@linux.intel.com>,
netdev@vger.kernel.org, linux-mips@linux-mips.org,
"David S . Miller" <davem@davemloft.net>
Subject: Re: [PATCH v6 1/6] net: phy: at803x: Export at803x_debug_reg_mask()
Date: Sat, 12 May 2018 23:37:01 +0200 [thread overview]
Message-ID: <20180512213701.GA30364@lunn.ch> (raw)
In-Reply-To: <20180511222239.aznt4ngtnrbnvshf@pburton-laptop>
On Fri, May 11, 2018 at 03:22:39PM -0700, Paul Burton wrote:
> Hi Andrew,
>
> On Fri, May 11, 2018 at 09:24:46PM +0200, Andrew Lunn wrote:
> > > I could reorder the probe function a little to initialize the PHY before
> > > performing the MAC reset, drop this patch and the AR803X hibernation
> > > stuff from patch 2 if you like. But again, I can't actually test the
> > > result on the affected hardware.
> >
> > Hi Paul
> >
> > I don't like a MAC driver poking around in PHY registers.
> >
> > So if you can rearrange the code, that would be great.
> >
> > Thanks
> > Andrew
>
> Sure, I'll give it a shot.
>
> After digging into it I see 2 ways to go here:
>
> 1) We could just always reset the PHY before we reset the MAC. That
> would give us a window of however long the PHY takes to enter its
> low power state & stop providing the RX clock during which we'd
> need the MAC reset to complete. In the case of the AR8031 that's
> "about 10 seconds" according to its data sheet. In this particular
> case that feels like plenty, but it does also feel a bit icky to
> rely on the timing chosen by the PHY manufacturer to line up with
> that of the MAC reset.
>
> 2) We could introduce a couple of new phy_* functions to disable &
> enable low power states like the AR8031's hibernation feature, by
> calling new function pointers in struct phy_driver. Then pch_gbe &
> other MACs could call those to have the PHY driver disable
> hibernation at times where we know we'll need the RX clock and
> re-enable it afterwards.
Hi Paul
When there is no link, you don't need the MAC running. My assumption
is that the PHY is designed around that idea, you leave the MAC idle
until there is a link. When the phylib calls the link_change handler,
the MAC should then be started/stopped depending on the state of the
link. You are then guaranteed to have the clock when you need it.
I've no idea how easy this is to implement given the current code...
Andrew
next prev parent reply other threads:[~2018-05-12 21:37 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-10 23:16 [PATCH v6 0/6] net: pch_gbe: MIPS support Paul Burton
2018-05-10 23:16 ` [PATCH v6 1/6] net: phy: at803x: Export at803x_debug_reg_mask() Paul Burton
2018-05-11 0:26 ` Andrew Lunn
2018-05-11 18:25 ` Paul Burton
2018-05-11 18:38 ` Paul Burton
2018-05-11 19:24 ` Andrew Lunn
2018-05-11 22:22 ` Paul Burton
2018-05-12 21:37 ` Andrew Lunn [this message]
2018-05-10 23:16 ` [PATCH v6 2/6] net: ethernet: pch_gbe: Convert to mdiobus and phylib Paul Burton
2018-05-10 23:16 ` [PATCH v6 3/6] net: pch_gbe: Support DeviceTree for MDIO/PHY description Paul Burton
2018-05-10 23:16 ` [PATCH v6 4/6] ptp: pch: Allow build on MIPS platforms Paul Burton
2018-05-10 23:16 ` [PATCH v6 5/6] net: pch_gbe: " Paul Burton
2018-05-10 23:16 ` [PATCH v6 6/6] MIPS: Boston: Adjust DT for pch_gbe PHY support Paul Burton
2018-05-11 0:28 ` Andrew Lunn
2018-05-11 0:35 ` Andrew Lunn
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=20180512213701.GA30364@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=dvhart@linux.intel.com \
--cc=linux-mips@linux-mips.org \
--cc=netdev@vger.kernel.org \
--cc=paul.burton@mips.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;
as well as URLs for NNTP newsgroup(s).