[PATCH v3 0/2] wifi: iwlwifi: Fix GP2 to nanoseconds overflow on 32-bit
From: Zhan Xusheng
Date: Mon Oct 12 2026 - 01:05:28 EST
From: Zhan Xusheng <zhanxusheng@xxxxxxxxxx>
Both drivers multiply a u32 GP2 microsecond timestamp by NSEC_PER_USEC
without widening first. On 32-bit the product truncates for any GP2
value above 4.295 s, and the truncated value is fed back into the
wraparound detector, which records a false GP2 wraparound and adds
about 71.6 minutes to every later PHC timestamp, cumulatively.
Six sites, three per driver:
mvm/ptp.c scale_update_gp2 in iwl_mvm_ptp_get_adj_time()
mvm/ptp.c gp2 in iwl_mvm_ptp_adjfine()
mvm/rxmq.c gp2_on_air_rise in iwl_mvm_rx_he()
mld/ptp.c scale_update_gp2 in iwl_mld_ptp_get_adj_time()
mld/ptp.c gp2 in iwl_mld_ptp_adjfine()
mld/rx.c gp2_on_air_rise in iwl_mld_rx_fill_status()
iwl_mvm_ptp_gettime() holds its GP2 read in a u64 and
iwl_mld_phc_get_crosstimestamp() casts, so those two are already right.
Changes since v2:
- mvm: added scale_update_gp2 and the adjfine() site. v2 only
covered mvm/rxmq.c.
- mld: added the iwl_mld_rx_fill_status() site. v2 only covered
mld/ptp.c while claiming parity with the mvm fix. Reported by the
netdev Sashiko review bot.
- mld: iwl_mld_ptp_get_crosstimestamp() in the v2 changelog does not
exist; the function is iwl_mld_phc_get_crosstimestamp().
- both: state the wraparound consequence with the numbers.
No Cc: stable. The affected intersection is 32-bit plus iwlwifi plus
PTP, so that call belongs to the maintainers.
v2: https://patch.msgid.link/20261001050103.860584-1-zhanxusheng@xxxxxxxxxx
Zhan Xusheng (2):
wifi: iwlwifi: mvm: Fix GP2 to nanoseconds overflow on 32-bit
wifi: iwlwifi: mld: Fix GP2 to nanoseconds overflow on 32-bit
drivers/net/wireless/intel/iwlwifi/mld/ptp.c | 5 +++--
drivers/net/wireless/intel/iwlwifi/mld/rx.c | 2 +-
drivers/net/wireless/intel/iwlwifi/mvm/ptp.c | 5 +++--
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 4 +++-
4 files changed, 10 insertions(+), 6 deletions(-)
base-commit: d6d3455d8751854e0d1820f14184682e23ac4475
--
2.43.0