]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: iwlwifi: Adopt PTP cross timestamps to core changes
authorThomas Gleixner <tglx@kernel.org>
Fri, 29 May 2026 20:00:36 +0000 (22:00 +0200)
committerThomas Gleixner <tglx@kernel.org>
Thu, 4 Jun 2026 09:04:16 +0000 (11:04 +0200)
iwlwifi only supports CLOCK_REALTIME timestamps and provides an incomplete
result without system counter values etc.

It also zeros struct system_device_crosststamp, which is already zeroed in
the core and initialized with the clock ID.

Remove the zeroing and reject any request for a clock ID other than REALTIME.

Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Tested-by: Arthur Kiyanovski <akiyano@amazon.com>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/20260529195557.535447186@kernel.org
drivers/net/wireless/intel/iwlwifi/mld/ptp.c
drivers/net/wireless/intel/iwlwifi/mvm/ptp.c

index c65f4b56a3270f61533210a867da17d08a609440..921b93c9e8369515bc602167696b36c014586f22 100644 (file)
@@ -250,7 +250,8 @@ iwl_mld_phc_get_crosstimestamp(struct ptp_clock_info *ptp,
        /* System (wall) time */
        ktime_t sys_time;
 
-       memset(xtstamp, 0, sizeof(struct system_device_crosststamp));
+       if (xtstamp->clock_id != CLOCK_REALTIME)
+               return -ENOTSUPP;
 
        ret = iwl_mld_get_crosstimestamp_fw(mld, &gp2, &sys_time);
        if (ret) {
index f7b620136c8576a21ed4b7b7f8797e65afe27623..4c40a5218436fa2e5fdf290aa9a68c987cc661c4 100644 (file)
@@ -160,13 +160,14 @@ iwl_mvm_phc_get_crosstimestamp(struct ptp_clock_info *ptp,
        /* System (wall) time */
        ktime_t sys_time;
 
-       memset(xtstamp, 0, sizeof(struct system_device_crosststamp));
-
        if (!mvm->ptp_data.ptp_clock) {
                IWL_ERR(mvm, "No PHC clock registered\n");
                return -ENODEV;
        }
 
+       if (xtstamp->clock_id != CLOCK_REALTIME)
+               return -ENOTSUPP;
+
        mutex_lock(&mvm->mutex);
        if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_SYNCED_TIME)) {
                ret = iwl_mvm_get_crosstimestamp_fw(mvm, &gp2, &sys_time);