summaryrefslogtreecommitdiff
path: root/include/linux/stmmac.h
diff options
context:
space:
mode:
authorKurt Kanzenbach <kurt@linutronix.de>2021-11-22 12:19:31 +0100
committerJakub Kicinski <kuba@kernel.org>2021-11-23 20:11:05 -0800
commitc6d5f1933085f9a92ed5c256a859ab31c7a35f88 (patch)
tree652bed7110baf5cc643b18ddd9194180453423bd /include/linux/stmmac.h
parent2106efda785b55a8957efed9a52dfa28ee0d7280 (diff)
net: stmmac: Calculate CDC error only once
The clock domain crossing error (CDC) is calculated at every fetch of Tx or Rx timestamps. It includes a division. Especially on arm32 based systems it is expensive. It also requires two conditionals in the hotpath. Add a compensation value cache to struct plat_stmmacenet_data and subtract it unconditionally in the RX/TX functions which spares the conditionals. The value is initialized to 0 and if supported calculated in the PTP initialization code. Suggested-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de> Link: https://lore.kernel.org/r/20211122111931.135135-1-kurt@linutronix.de Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux/stmmac.h')
-rw-r--r--include/linux/stmmac.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index a6f03b36fc4f..89b8e208cd7b 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -241,6 +241,7 @@ struct plat_stmmacenet_data {
unsigned int clk_ref_rate;
unsigned int mult_fact_100ns;
s32 ptp_max_adj;
+ u32 cdc_error_adj;
struct reset_control *stmmac_rst;
struct reset_control *stmmac_ahb_rst;
struct stmmac_axi *axi;