Commit e6176ab1 authored by Markus Blöchl's avatar Markus Blöchl Committed by Jakub Kicinski
Browse files

net: stmmac: intel: populate entire system_counterval_t in get_time_fn() callback



get_time_fn() callback implementations are expected to fill out the
entire system_counterval_t struct as it may be initially uninitialized.

This broke with the removal of convert_art_to_tsc() helper functions
which left use_nsecs uninitialized.

Initially assign the entire struct with default values.

Fixes: f5e1d0db ("stmmac: intel: Remove convert_art_to_tsc()")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarMarkus Blöchl <markus@blochl.de>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250713-stmmac_crossts-v1-1-31bfe051b5cb@blochl.de


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent ae2256f9
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -433,6 +433,12 @@ static int intel_crosststamp(ktime_t *device,
		return -ETIMEDOUT;
	}

	*system = (struct system_counterval_t) {
		.cycles = 0,
		.cs_id = CSID_X86_ART,
		.use_nsecs = false,
	};

	num_snapshot = (readl(ioaddr + GMAC_TIMESTAMP_STATUS) &
			GMAC_TIMESTAMP_ATSNS_MASK) >>
			GMAC_TIMESTAMP_ATSNS_SHIFT;
@@ -448,7 +454,7 @@ static int intel_crosststamp(ktime_t *device,
	}

	system->cycles *= intel_priv->crossts_adj;
	system->cs_id = CSID_X86_ART;

	priv->plat->flags &= ~STMMAC_FLAG_INT_SNAPSHOT_EN;

	return 0;