From: Andrew Lunn <andrew@lunn.ch>
To: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>,
Jose Abreu <joabreu@synopsys.com>,
"David S. Miller" <davem@davemloft.net>,
Heiner Kallweit <hkallweit1@gmail.com>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Woojung Huh <woojung.huh@microchip.com>,
Arun Ramadoss <arun.ramadoss@microchip.com>,
Richard Cochran <richardcochran@gmail.com>,
Russell King <linux@armlinux.org.uk>,
kernel@pengutronix.de, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org, UNGLinuxDriver@microchip.com,
linux-stm32@st-md-mailman.stormreply.com
Subject: Re: [PATCH net-next v1 1/4] net: phy: Add TimeSync delay query support to PHYlib API
Date: Wed, 17 Apr 2024 20:33:38 +0200 [thread overview]
Message-ID: <898f435b-99dd-4636-9a52-558780c1bb06@lunn.ch> (raw)
In-Reply-To: <20240417164316.1755299-2-o.rempel@pengutronix.de>
On Wed, Apr 17, 2024 at 06:43:13PM +0200, Oleksij Rempel wrote:
> Add a new phy_get_timesync_data_path_delays() function, to the PHY
> device API. This function enables querying the ingress and egress
> TimeSync delays for PHY devices, as specified in IEEE 802.3-2022
> sections 30.13.1.3 to 30.13.1.6. The function adds the capability to
> obtain the average delays in nanoseconds, which can be used to
> compensate for time variations added by the PHY to PTP packets.
>
> Since most PHYs do not provide register-based delay information, PHY
> drivers should supply this data, typically dependent on the interface
> type (MII, RGMII, etc.) and link speed. The MAC driver, or consumer of
> this API, is expected to invoke this function upon link establishment to
> accurately compensate for any PHY-induced time discrepancies.
So your intention is that this function is called from within the
adjust_link callback? Hence there is no locking being performed
because the lock is already held?
> +/**
> + * phy_get_timesync_data_path_delays - get the TimeSync data path ingress/egress
> + * delays
> + * @phydev: phy_device struct
> + * @tx_delay_ns: pointer to the transmit delay in nanoseconds
> + * @rx_delay_ns: pointer to the receive delay in nanoseconds
> + *
> + * This function is used to get the TimeSync data path ingress/egress delays
> + * as described in IEEE 802.3-2022 sections:
> + * 30.13.1.3 aTimeSyncDelayTXmax, 30.13.1.4 aTimeSyncDelayTXmin,
> + * 30.13.1.5 aTimeSyncDelayRXmax and 30.13.1.6 aTimeSyncDelayRXmin.
> + *
> + * The delays are returned in nanoseconds and can be used to compensate time
> + * added by the PHY to the PTP packets.
Please document the context this function should be used in. If users
use it outside of the adjust_link callback, the locking will be
wrong....
> + *
> + * Returns 0 on success, negative value on failure.
I think kdocs now requires a : after Returns ?
> + /**
> + * @get_timesync_data_path_delays: Get the PHY time sync delay values
> + * @dev: PHY device
> + * @tsd: PHY time sync delay values
> + *
> + * Returns 0 on success, or an error code.
Same here.
Andrew
next prev parent reply other threads:[~2024-04-17 18:34 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-17 16:43 [PATCH net-next v1 0/4] add support for TimeSync path delays Oleksij Rempel
2024-04-17 16:43 ` [PATCH net-next v1 1/4] net: phy: Add TimeSync delay query support to PHYlib API Oleksij Rempel
2024-04-17 18:33 ` Andrew Lunn [this message]
2024-04-17 18:48 ` Woojung.Huh
2024-04-17 16:43 ` [PATCH net-next v1 2/4] net: phy: micrel: lan8841: set default PTP latency values Oleksij Rempel
2024-04-17 18:39 ` Andrew Lunn
2024-04-17 20:12 ` Oleksij Rempel
2024-04-17 20:23 ` Andrew Lunn
2024-04-19 6:46 ` Richard Cochran
2024-04-23 7:07 ` Oleksij Rempel
2024-04-24 6:10 ` Richard Cochran
2024-04-17 16:43 ` [PATCH net-next v1 3/4] net: phy: realtek: provide TimeSync data path delays for RTL8211E Oleksij Rempel
2024-04-18 5:39 ` kernel test robot
2024-04-17 16:43 ` [PATCH net-next v1 4/4] net: stmmac: use delays reported by the PHY driver to correct MAC propagation delay Oleksij Rempel
2024-04-17 19:13 ` Serge Semin
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=898f435b-99dd-4636-9a52-558780c1bb06@lunn.ch \
--to=andrew@lunn.ch \
--cc=UNGLinuxDriver@microchip.com \
--cc=alexandre.torgue@foss.st.com \
--cc=arun.ramadoss@microchip.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=joabreu@synopsys.com \
--cc=kernel@pengutronix.de \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=linux@armlinux.org.uk \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
--cc=woojung.huh@microchip.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®