From: Richard Cochran <richardcochran@gmail.com> Date: 2018-10-07 17:38:22
When parsing a PHY node, register its time stamper, if any, and attach
the instance to the PHY device.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
drivers/net/phy/phy_device.c | 3 +++
drivers/of/of_mdio.c | 26 ++++++++++++++++++++++++++
2 files changed, 29 insertions(+)
@@ -833,6 +833,9 @@ EXPORT_SYMBOL(phy_device_register);*/voidphy_device_remove(structphy_device*phydev){+if(phydev->mii_ts)+unregister_mii_timestamper(phydev->mii_ts);+device_del(&phydev->mdio.dev);/* Assert the reset signal */
When parsing a PHY node, register its time stamper, if any, and attach
the instance to the PHY device.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
drivers/net/phy/phy_device.c | 3 +++
drivers/of/of_mdio.c | 26 ++++++++++++++++++++++++++
2 files changed, 29 insertions(+)
@@ -833,6 +833,9 @@ EXPORT_SYMBOL(phy_device_register);*/voidphy_device_remove(structphy_device*phydev){+if(phydev->mii_ts)+unregister_mii_timestamper(phydev->mii_ts);+device_del(&phydev->mdio.dev);/* Assert the reset signal */
There appears to be a binding document missing to describe what a
timerstamper provider is. Using a more specific name than
"#phandle-cells" is preferred when dealing with specific devices, e.g:
interrupt-controller/#interrupt-cells
clocks/#clock-cells
etc.
So I would go with #timestamp-cells here, and define what the cell sie
and format should be in a separate "dt-bindings" prefixed patch that the
Device Tree folks can also comment on.
+ if (err == -ENOENT)
+ return NULL;
+ else if (err)
+ return ERR_PTR(err);
+
+ if (args.args_count >= 1)
+ port = args.args[0];
If it's greater than one, than it is an error, and it should be flagged
as such.
The idea looks good though, should of_find_mii_timestamper() somehow be
made conditional to CONFIG_PTP and we should have a stub for when it is
disabled?
From: Andrew Lunn <andrew@lunn.ch> Date: 2018-10-07 18:17:54
quoted
+ if (err == -ENOENT)
+ return NULL;
+ else if (err)
+ return ERR_PTR(err);
+
+ if (args.args_count >= 1)
+ port = args.args[0];
If it's greater than one, than it is an error, and it should be flagged
as such.
The idea looks good though, should of_find_mii_timestamper() somehow be
made conditional to CONFIG_PTP and we should have a stub for when it is
disabled?
Hi Florian
There already is a stub. But register return -EOPNOTSUPP.
From: Richard Cochran <richardcochran@gmail.com> Date: 2018-10-07 19:23:41
On Sun, Oct 07, 2018 at 11:14:38AM -0700, Florian Fainelli wrote:
There appears to be a binding document missing to describe what a
timerstamper provider is. Using a more specific name than
"#phandle-cells" is preferred when dealing with specific devices, e.g:
interrupt-controller/#interrupt-cells
clocks/#clock-cells
Sure.
So I would go with #timestamp-cells here, and define what the cell sie
and format should be in a separate "dt-bindings" prefixed patch that the
Device Tree folks can also comment on.
I documented this in the last patch. I didn't see any example in our
device tree that explains a "reference" like this that is not
connected to a specific node type.
quoted
+ if (err == -ENOENT)
+ return NULL;
+ else if (err)
+ return ERR_PTR(err);
+
+ if (args.args_count >= 1)
+ port = args.args[0];
If it's greater than one, than it is an error, and it should be flagged
as such.
I wanted to allow specific MII time stamping drivers to use one than
one value in the future, should the need arise.
The idea looks good though, should of_find_mii_timestamper() somehow be
made conditional to CONFIG_PTP and we should have a stub for when it is
disabled?
Do you mean CONFIG_NETWORK_PHY_TIMESTAMPING ?
There is a stub for that.
Thanks,
Richard
From: Richard Cochran <richardcochran@gmail.com> Date: 2018-10-07 19:26:27
On Sun, Oct 07, 2018 at 08:17:54PM +0200, Andrew Lunn wrote:
quoted
quoted
+ if (err == -ENOENT)
+ return NULL;
+ else if (err)
+ return ERR_PTR(err);
+
+ if (args.args_count >= 1)
+ port = args.args[0];
If it's greater than one, than it is an error, and it should be flagged
as such.
The idea looks good though, should of_find_mii_timestamper() somehow be
made conditional to CONFIG_PTP and we should have a stub for when it is
disabled?
Hi Florian
There already is a stub. But register return -EOPNOTSUPP.
From: Andrew Lunn <andrew@lunn.ch> Date: 2018-10-07 19:57:44
On Sun, Oct 07, 2018 at 12:26:27PM -0700, Richard Cochran wrote:
On Sun, Oct 07, 2018 at 08:17:54PM +0200, Andrew Lunn wrote:
quoted
quoted
quoted
+ if (err == -ENOENT)
+ return NULL;
+ else if (err)
+ return ERR_PTR(err);
+
+ if (args.args_count >= 1)
+ port = args.args[0];
If it's greater than one, than it is an error, and it should be flagged
as such.
The idea looks good though, should of_find_mii_timestamper() somehow be
made conditional to CONFIG_PTP and we should have a stub for when it is
disabled?
Hi Florian
There already is a stub. But register return -EOPNOTSUPP.
The stub returns NULL...
Ah, sorry, it is register_mii_tstamp_controller() which return
-EOPNOTSUP.
Andrew