1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/ethernet/stmicro/stmmac
Yannick Vignon 80d4609008 net: stmmac: ensure PTP time register reads are consistent
Even if protected from preemption and interrupts, a small time window
remains when the 2 register reads could return inconsistent values,
each time the "seconds" register changes. This could lead to an about
1-second error in the reported time.

Add logic to ensure the "seconds" and "nanoseconds" values are consistent.

Fixes: 92ba688851 ("stmmac: add the support for PTP hw clock driver")
Signed-off-by: Yannick Vignon <yannick.vignon@nxp.com>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://lore.kernel.org/r/20220203160025.750632-1-yannick.vignon@oss.nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-02-03 13:54:19 -08:00
..
altr_tse_pcs.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234 2019-06-19 17:09:07 +02:00
altr_tse_pcs.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234 2019-06-19 17:09:07 +02:00
chain_mode.c net: stmmac: Add support to Ethtool get/set ring parameters 2020-09-16 15:22:52 -07:00
common.h net: stmmac: bump tc when get underflow error from DMA descriptor 2021-12-13 12:20:35 +00:00
descs.h net: stmmac: Initial support for TBS 2020-01-13 18:31:48 -08:00
descs_com.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 291 2019-06-05 17:36:38 +02:00
dwmac-anarion.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-dwc-qos-eth.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-generic.c net: stmmac: add support for dwmac 3.40a 2021-10-08 16:22:39 +01:00
dwmac-imx.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-ingenic.c net: stmmac: Fix error return code in ingenic_mac_probe() 2021-06-16 12:02:38 -07:00
dwmac-intel-plat.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-intel.c stmmac: intel: set PCI_D3hot in suspend 2021-06-29 11:34:48 -07:00
dwmac-intel.h stmmac: intel: move definitions to dwmac-intel header file 2021-06-12 13:10:52 -07:00
dwmac-ipq806x.c net: ethernet: stmmac: Do not use unreachable() in ipq806x_gmac_probe() 2021-08-07 09:45:46 +01:00
dwmac-loongson.c stmmac: dwmac-loongson:Fix missing return value 2021-09-06 12:52:52 +01:00
dwmac-lpc18xx.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-mediatek.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-meson.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-meson8b.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-oxnas.c net: stmmac: dwmac-oxnas: Add support for OX810SE 2022-01-12 09:05:02 -08:00
dwmac-qcom-ethqos.c net: stmmac: Add platform level debug register dump feature 2021-11-30 11:57:58 +00:00
dwmac-rk.c net: stmmac: dwmac-rk: fix oob read in rk_gmac_setup 2021-12-16 10:47:48 +00:00
dwmac-socfpga.c net: stmmac: socfpga: add runtime suspend/resume callback for stratix10 platform 2021-11-15 14:20:42 +00:00
dwmac-sti.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-stm32.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
dwmac-sun8i.c net: stmmac: dwmac-sun8i: use return val of readl_poll_timeout() 2022-01-27 13:51:10 +00:00
dwmac-sunxi.c net: stmicro: handle clk_prepare() failure during init 2021-05-13 17:33:18 +02:00
dwmac-visconti.c net: stmmac: dwmac-visconti: No change to ETHER_CLOCK_SEL for unexpected speed request. 2022-01-28 14:28:30 +00:00
dwmac4.h net: stmmac: Add hardware supported cross-timestamp 2021-03-24 15:12:36 -07:00
dwmac4_core.c ethernet: constify references to netdev->dev_addr in drivers 2021-10-14 09:22:11 -07:00
dwmac4_descs.c net: stmmac: bump tc when get underflow error from DMA descriptor 2021-12-13 12:20:35 +00:00
dwmac4_descs.h net: stmmac: gmac4+: Add TBS support 2020-01-13 18:31:48 -08:00
dwmac4_dma.c net: stmmac: fix get_hw_feature() on old hardware 2021-10-08 16:22:38 +01:00
dwmac4_dma.h net: stmmac: Add HW descriptor prefetch setting for DWMAC Core 5.20 onwards 2021-04-22 15:02:40 -07:00
dwmac4_lib.c ethernet: constify references to netdev->dev_addr in drivers 2021-10-14 09:22:11 -07:00
dwmac5.c net: stmmac: enable platform specific safety features 2021-06-01 16:59:50 -07:00
dwmac5.h net: stmmac: enable platform specific safety features 2021-06-01 16:59:50 -07:00
dwmac100.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 291 2019-06-05 17:36:38 +02:00
dwmac100_core.c ethernet: constify references to netdev->dev_addr in drivers 2021-10-14 09:22:11 -07:00
dwmac100_dma.c net: stmmac: Fix descriptors address being in > 32 bits address space 2019-07-09 12:20:08 -07:00
dwmac1000.h net: stmmac: dwmac1000: Fix extended MAC address registers definition 2021-06-11 13:05:55 -07:00
dwmac1000_core.c ethernet: constify references to netdev->dev_addr in drivers 2021-10-14 09:22:11 -07:00
dwmac1000_dma.c net: stmmac: fix get_hw_feature() on old hardware 2021-10-08 16:22:38 +01:00
dwmac_dma.h net: stmmac: dump gmac4 DMA registers correctly 2022-01-31 21:21:10 -08:00
dwmac_lib.c ethernet: constify references to netdev->dev_addr in drivers 2021-10-14 09:22:11 -07:00
dwxgmac2.h net: stmmac: introduce DMA interrupt status masking per traffic direction 2021-03-25 17:37:30 -07:00
dwxgmac2_core.c ethernet: constify references to netdev->dev_addr in drivers 2021-10-14 09:22:11 -07:00
dwxgmac2_descs.c net: stmmac: fix wrongly set buffer2 valid when sph unsupport 2021-02-26 15:17:11 -08:00
dwxgmac2_dma.c net: stmmac: fix get_hw_feature() on old hardware 2021-10-08 16:22:38 +01:00
dwxlgmac2.h net: stmmac: Add support for Enterprise MAC version 2020-03-17 21:37:25 -07:00
enh_desc.c net: stmmac: fix dma physical address of descriptor when display ring 2021-02-26 15:17:11 -08:00
hwif.c net: stmmac: Add support for Enterprise MAC version 2020-03-17 21:37:25 -07:00
hwif.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-10-14 16:50:14 -07:00
Kconfig ethernet: fix PTP_1588_CLOCK dependencies 2021-08-13 17:49:05 -07:00
Makefile stmmac: pci: Add dwmac support for Loongson 2021-06-18 11:48:34 -07:00
mmc.h net: stmmac: xgmac: Implement MMC counters 2019-08-08 22:20:18 -07:00
mmc_core.c net: stmmac: mmc: Add Frame Preemption counters on GMAC5+ cores 2019-12-18 12:17:11 -08:00
norm_desc.c net: stmmac: fix dma physical address of descriptor when display ring 2021-02-26 15:17:11 -08:00
ring_mode.c net: stmmac: Add support to Ethtool get/set ring parameters 2020-09-16 15:22:52 -07:00
stmmac.h net: stmmac: remove unused members in struct stmmac_priv 2022-01-24 13:31:45 +00:00
stmmac_ethtool.c net: stmmac: dump gmac4 DMA registers correctly 2022-01-31 21:21:10 -08:00
stmmac_hwtstamp.c net: stmmac: ensure PTP time register reads are consistent 2022-02-03 13:54:19 -08:00
stmmac_main.c net: stmmac: properly handle with runtime pm in stmmac_dvr_remove() 2022-01-28 15:13:22 +00:00
stmmac_mdio.c net: stmmac: reverse Christmas tree notation in stmmac_xpcs_setup 2021-06-11 13:43:55 -07:00
stmmac_pci.c net: stmmac: enable platform specific safety features 2021-06-01 16:59:50 -07:00
stmmac_pcs.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
stmmac_platform.c net: stmmac: retain PTP clock time during SIOCSHWTSTAMP ioctls 2021-11-22 14:29:26 +00:00
stmmac_platform.h of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
stmmac_ptp.c net: stmmac: configure PTP clock source prior to PTP initialization 2022-01-27 13:45:56 +00:00
stmmac_ptp.h net: stmmac: Add support for external trigger timestamping 2021-04-14 12:57:45 -07:00
stmmac_selftests.c ethernet: constify references to netdev->dev_addr in drivers 2021-10-14 09:22:11 -07:00
stmmac_tc.c net: stmmac: add tc flower filter for EtherType matching 2021-12-23 11:20:49 +00:00
stmmac_xdp.c net: stmmac: enhance XDP ZC driver level switching performance 2021-11-15 12:56:34 +00:00
stmmac_xdp.h net: stmmac: Enable RX via AF_XDP zero-copy 2021-04-13 15:06:51 -07:00