From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3263D2771B; Fri, 29 May 2026 20:00:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780084840; cv=none; b=Y4vl4bpXBRbZ/0BVtwbjtyj+0VfIfa0LkMnjmMlqWewFLPRHkc9cbRGHdbfItXx+96acYfSYNj/IreBn15Tk6HyxAz4N+dm885FC+vnxqVb66IyTfFDDKfpOlpVz4zqgQ613RBCm+hOgPKeTBOrl6Bd+HwPcWKQI/24dzRcxTCc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780084840; c=relaxed/simple; bh=2aXWzPzNzd2NCIogDsWygVizy8ue3Nyysy1+INo+kow=; h=Date:Message-ID:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=nEKbJhDthu7ps0ARkRj1Pl/TgpbTlmAPIceXYLK82E+rbjW9+ms8hmzWypbwWPNAQpd2QHlMviOuHeZUnqdAnLBe21P2z5KVcqnVnkXxa4ZiBdrroUPwQzEOf7NEnqLNDxGNr9LGjJPscO7ocdbLtRAxz9eIeXU2HiSBK9WwF7Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YsH5kdL5; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YsH5kdL5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71A221F00893; Fri, 29 May 2026 20:00:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1780084839; bh=F1/ehgTNHxWvIPIuJRlhZs5X/XHWu+J4Hrpk2VF31vs=; h=Date:From:To:Cc:Subject:References; b=YsH5kdL5X64aHcR0awQT0o5oVy/aVFd0GPvzZYs/EgvcGWq864jE0TplPfxutQY3l hxSWPjvvaxsEBT126oCgCH/0TqTGhiWrlfhsLY/ocm1AcdKBLu6EjE79SvbG8K2tPO Rynq/bmX35Ny3cD66hfL089tsVhqnUmJrAoJpmfg3fAIYSYjJ0pJZh5zMpSSX/Im9K Duk7xFUnYyuWkeV7mnvaGXURd+DJFTW9ob94kkjQ8YBjBvyTWXyNXfn5utaATEYYip T96eHcjd/ZAAyhkyaRYI5J4WZpuCUh+5DclvQ/clO3txImzGNQSOr4lZDZqXWxB356 doxw65VjX5EUw== Date: Fri, 29 May 2026 22:00:36 +0200 Message-ID: <20260529195557.535447186@kernel.org> User-Agent: quilt/0.69 From: Thomas Gleixner To: LKML Cc: David Woodhouse , Miroslav Lichvar , John Stultz , Stephen Boyd , Anna-Maria Behnsen , Frederic Weisbecker , thomas.weissschuh@linutronix.de, Arthur Kiyanovski , Rodolfo Giometti , Vincent Donnefort , Marc Zyngier , Oliver Upton , kvmarm@lists.linux.dev, Oliver Upton , Richard Cochran , netdev@vger.kernel.org, Takashi Iwai , Miri Korenblit , Johannes Berg , Jacob Keller , Tony Nguyen , Saeed Mahameed , Peter Hilber , "Michael S. Tsirkin" , virtualization@lists.linux.dev, linux-wireless@vger.kernel.org, linux-sound@vger.kernel.org, David Woodhouse , Vadim Fedorenko Subject: [patch V2 12/25] wifi: iwlwifi: Adopt PTP cross timestamps to core changes References: <20260529193435.921555544@kernel.org> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 From: Thomas Gleixner 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 Tested-by: Arthur Kiyanovski Reviewed-by: David Woodhouse Reviewed-by: Jacob Keller --- drivers/net/wireless/intel/iwlwifi/mld/ptp.c | 3 ++- drivers/net/wireless/intel/iwlwifi/mvm/ptp.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) --- a/drivers/net/wireless/intel/iwlwifi/mld/ptp.c +++ b/drivers/net/wireless/intel/iwlwifi/mld/ptp.c @@ -250,7 +250,8 @@ iwl_mld_phc_get_crosstimestamp(struct pt /* 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) { --- a/drivers/net/wireless/intel/iwlwifi/mvm/ptp.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ptp.c @@ -160,13 +160,14 @@ iwl_mvm_phc_get_crosstimestamp(struct pt /* 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);