diff mbox series

[net-next] stmmac: intel: Enable correction of MAC propagation delay

Message ID 20230818111401.77962-1-kurt@linutronix.de (mailing list archive)
State Accepted
Commit 58f2ffdedf7b05b318f2cdafaca69e4435c8478e
Delegated to: Netdev Maintainers
Headers show
Series [net-next] stmmac: intel: Enable correction of MAC propagation delay | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1330 this patch: 1330
netdev/cc_maintainers warning 2 maintainers not CCed: linux-stm32@st-md-mailman.stormreply.com linux-arm-kernel@lists.infradead.org
netdev/build_clang success Errors and warnings before: 1353 this patch: 1353
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1353 this patch: 1353
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Kurt Kanzenbach Aug. 18, 2023, 11:14 a.m. UTC
All captured timestamps should be corrected by PHY, MAC and CDC introduced
latency/errors. The CDC correction is already used. Enable MAC propagation delay
correction as well which is available since commit 26cfb838aa00 ("net: stmmac:
correct MAC propagation delay").

Before:
|ptp4l[390.458]: rms    7 max   21 freq   +177 +/-  14 delay   357 +/-   1

After:
|ptp4l[620.012]: rms    7 max   20 freq   +195 +/-  14 delay   345 +/-   1

Tested on Intel Elkhart Lake.

Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Johannes Zink Aug. 18, 2023, 12:16 p.m. UTC | #1
On 8/18/23 13:14, Kurt Kanzenbach wrote:
> All captured timestamps should be corrected by PHY, MAC and CDC introduced
> latency/errors. The CDC correction is already used. Enable MAC propagation delay
> correction as well which is available since commit 26cfb838aa00 ("net: stmmac:
> correct MAC propagation delay").
> 
> Before:
> |ptp4l[390.458]: rms    7 max   21 freq   +177 +/-  14 delay   357 +/-   1
> 
> After:
> |ptp4l[620.012]: rms    7 max   20 freq   +195 +/-  14 delay   345 +/-   1
> 
> Tested on Intel Elkhart Lake.
> 
> Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>

LGTM

feel free to add my

Reviewed-by: Johannes Zink <j.zink@pengutronix.de>

> ---
>   drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
> index 979c755964b1..a3a249c63598 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
> @@ -627,6 +627,7 @@ static int ehl_common_data(struct pci_dev *pdev,
>   	plat->rx_queues_to_use = 8;
>   	plat->tx_queues_to_use = 8;
>   	plat->flags |= STMMAC_FLAG_USE_PHY_WOL;
> +	plat->flags |= STMMAC_FLAG_HWTSTAMP_CORRECT_LATENCY;
>   
>   	plat->safety_feat_cfg->tsoee = 1;
>   	plat->safety_feat_cfg->mrxpee = 1;
patchwork-bot+netdevbpf@kernel.org Aug. 19, 2023, 6:34 p.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Fri, 18 Aug 2023 13:14:01 +0200 you wrote:
> All captured timestamps should be corrected by PHY, MAC and CDC introduced
> latency/errors. The CDC correction is already used. Enable MAC propagation delay
> correction as well which is available since commit 26cfb838aa00 ("net: stmmac:
> correct MAC propagation delay").
> 
> Before:
> |ptp4l[390.458]: rms    7 max   21 freq   +177 +/-  14 delay   357 +/-   1
> 
> [...]

Here is the summary with links:
  - [net-next] stmmac: intel: Enable correction of MAC propagation delay
    https://git.kernel.org/netdev/net-next/c/58f2ffdedf7b

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
index 979c755964b1..a3a249c63598 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
@@ -627,6 +627,7 @@  static int ehl_common_data(struct pci_dev *pdev,
 	plat->rx_queues_to_use = 8;
 	plat->tx_queues_to_use = 8;
 	plat->flags |= STMMAC_FLAG_USE_PHY_WOL;
+	plat->flags |= STMMAC_FLAG_HWTSTAMP_CORRECT_LATENCY;
 
 	plat->safety_feat_cfg->tsoee = 1;
 	plat->safety_feat_cfg->mrxpee = 1;