Skip to content

Commit e6176ab

Browse files
Markus Blöchlkuba-moo
authored andcommitted
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: f5e1d0d ("stmmac: intel: Remove convert_art_to_tsc()") Cc: [email protected] Signed-off-by: Markus Blöchl <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ae2256f commit e6176ab

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,12 @@ static int intel_crosststamp(ktime_t *device,
433433
return -ETIMEDOUT;
434434
}
435435

436+
*system = (struct system_counterval_t) {
437+
.cycles = 0,
438+
.cs_id = CSID_X86_ART,
439+
.use_nsecs = false,
440+
};
441+
436442
num_snapshot = (readl(ioaddr + GMAC_TIMESTAMP_STATUS) &
437443
GMAC_TIMESTAMP_ATSNS_MASK) >>
438444
GMAC_TIMESTAMP_ATSNS_SHIFT;
@@ -448,7 +454,7 @@ static int intel_crosststamp(ktime_t *device,
448454
}
449455

450456
system->cycles *= intel_priv->crossts_adj;
451-
system->cs_id = CSID_X86_ART;
457+
452458
priv->plat->flags &= ~STMMAC_FLAG_INT_SNAPSHOT_EN;
453459

454460
return 0;

0 commit comments

Comments
 (0)