From: Antoine Tenart <antoine.tenart@bootlin.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: davem@davemloft.net, f.fainelli@gmail.com, hkallweit1@gmail.com,
richardcochran@gmail.com, alexandre.belloni@bootlin.com,
UNGLinuxDriver@microchip.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com,
allan.nielsen@microchip.com, foss@0leil.net
Subject: Re: [PATCH net-next v3 6/8] net: phy: mscc: timestamping and PHC support
Date: Mon, 22 Jun 2020 15:26:07 +0200 [thread overview]
Message-ID: <159283236709.1456598.3715966711472439674@kwain> (raw)
In-Reply-To: <20200620154008.GO304147@lunn.ch>
Hi Andrew,
Quoting Andrew Lunn (2020-06-20 17:40:08)
> On Fri, Jun 19, 2020 at 02:22:58PM +0200, Antoine Tenart wrote:
> > To get and set the PHC time, a GPIO has to be used and changes are only
> > retrieved or committed when on a rising edge. The same GPIO is shared by
> > all PHYs, so the granularity of the lock protecting it has to be
> > different from the ones protecting the 1588 registers (the VSC8584 PHY
> > has 2 1588 blocks, and a single load/save pin).
>
> I guess you thought about this GPIO quite a bit.
>
> It appears you have the mutex in the shared structure, but each PHY
> has its own gpio_desc, even though it should be for the same GPIO?
Yes, that's right. I had an early solution were I was sharing the GPIO
in the shared structure, allowing to have a single gpio_desc. (dt would
still needs to have one GPIO per PHY). That turned out to be a lot more
complex that the current solution, having to unregister and free the
GPIO desc manually when the driver of the last PHY was unregistered. I
had to add lots of logic (and not the nicely looking one) to the shared
PHY helpers in the core.
> The binding requires each PHY has the GPIO, even though it is the same
> GPIO. And there does not appear to be any checking that each PHY
> really does have the same GPIO.
Right. I don't see a clean and nice way to do this. Do you have an idea?
On another hand, this would only lead to not being able to set/get (a
correct) time from the PHC.
> Ideally there would be a section in DT for the package, and this GPIO
> would be there. But i don't see an good way to do this.
Yes, I agree. That wasn't the design chosen when PHY packages were
added. This PHY already has a shared description, duplicated for each
PHY of the same package (for the interrupt line). If we were to change
this one day, we probably would have to break dt compatibility anyway as
there's already a property that is shared.
> This does not feel right to me, but i've no good idea how it can be
> made better :-(
I think this kind of rework is out of this series scope; but I would be
happy to discuss a better solution for someday.
Thanks!
Antoine
--
Antoine Ténart, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2020-06-22 13:26 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-19 12:22 [PATCH net-next v3 0/8] net: phy: mscc: PHC and timestamping support Antoine Tenart
2020-06-19 12:22 ` [PATCH net-next v3 1/8] net: phy: add support for a common probe between shared PHYs Antoine Tenart
2020-06-20 14:49 ` Andrew Lunn
2020-06-19 12:22 ` [PATCH net-next v3 2/8] net: phy: mscc: fix copyright and author information in MACsec Antoine Tenart
2020-06-20 14:50 ` Andrew Lunn
2020-06-19 12:22 ` [PATCH net-next v3 3/8] net: phy: mscc: remove the TR CLK disable magic value Antoine Tenart
2020-06-20 14:52 ` Andrew Lunn
2020-06-22 12:49 ` Antoine Tenart
2020-06-19 12:22 ` [PATCH net-next v3 4/8] net: phy: mscc: take into account the 1588 block in MACsec init Antoine Tenart
2020-06-21 15:38 ` Quentin Schulz
2020-06-22 14:25 ` Antoine Tenart
2020-06-19 12:22 ` [PATCH net-next v3 5/8] net: phy: mscc: 1588 block initialization Antoine Tenart
2020-06-20 15:10 ` Andrew Lunn
2020-06-22 13:07 ` Antoine Tenart
2020-06-21 16:57 ` Quentin Schulz
2020-06-22 15:26 ` Antoine Tenart
2020-06-19 12:22 ` [PATCH net-next v3 6/8] net: phy: mscc: timestamping and PHC support Antoine Tenart
2020-06-20 15:00 ` Richard Cochran
2020-06-22 13:09 ` Antoine Tenart
2020-06-20 15:16 ` Andrew Lunn
2020-06-20 15:21 ` Andrew Lunn
2020-06-22 13:31 ` Antoine Tenart
2020-06-20 15:40 ` Andrew Lunn
2020-06-22 13:26 ` Antoine Tenart [this message]
2020-06-21 17:35 ` Quentin Schulz
2020-06-22 15:35 ` Antoine Tenart
2020-06-19 12:22 ` [PATCH net-next v3 7/8] dt-bindings: net: phy: vsc8531: document the load/save GPIO Antoine Tenart
2020-06-19 12:23 ` [PATCH net-next v3 8/8] MIPS: dts: ocelot: describe " Antoine Tenart
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=159283236709.1456598.3715966711472439674@kwain \
--to=antoine.tenart@bootlin.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=alexandre.belloni@bootlin.com \
--cc=allan.nielsen@microchip.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=foss@0leil.net \
--cc=hkallweit1@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=richardcochran@gmail.com \
--cc=thomas.petazzoni@bootlin.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
all inboxes | Powered by JetHome®