* Re: [PATCH 20/24] wifi: iwlwifi: Use system_device_crosststamp::sys_systime
From: David Woodhouse @ 2026-05-26 23:55 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171224.198945692@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 322 bytes --]
On Tue, 26 May 2026 19:15:07 +0200, Thomas Gleixner wrote:
> sys_systime is an alias for sys_realtime. The latter will be removed so
> switch the code over to the new naming scheme.
>
> No functional change.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH 19/24] ptp: Use system_device_crosststamp::sys_systime
From: David Woodhouse @ 2026-05-26 23:54 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171224.124442963@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 308 bytes --]
On Tue, 26 May 2026 19:15:02 +0200, Thomas Gleixner wrote:
> .. to prepare for cross timestamps with variable clock IDs.
>
> No functional change.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Tested-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH 18/24] timekeeping: Prepare for cross timestamps on arbitrary clock IDs
From: David Woodhouse @ 2026-05-26 23:54 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171224.050496338@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 945 bytes --]
On Tue, 26 May 2026 19:14:57 +0200, Thomas Gleixner wrote:
> PTP device system crosstime stamps support only CLOCK_REALTIME, which is
> meaningless for AUX clocks. The PTP core hands in the clock ID already, so
> prepare the core code to honor it.
>
> - Add a new sys_systime field to struct system_device_crosststamp which
> aliases the sys_realtime field. Once all users are converted
> sys_realtime can be removed.
>
> - Prepare get_device_system_crosststamp() and the related code for it by
> switching to sys_systime and providing the initial changes to utilize
> different time keepers.
>
> No functional change intended.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
I suspect I'll be back to frown at adjust_historical_crosststamp() at
some point, but that's a separate issue. For this change:
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Tested-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH 17/24] timekeeping: Remove ktime_get_snapshot()
From: David Woodhouse @ 2026-05-26 23:52 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171223.974925389@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 278 bytes --]
On Tue, 26 May 2026 19:14:52 +0200, Thomas Gleixner wrote:
> All users have been converted to ktime_get_snapshot_id().
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Tested-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH 16/24] virtio_rtc: Use provided clock ID for history snapshot
From: David Woodhouse @ 2026-05-26 23:51 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171223.901103717@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 464 bytes --]
On Tue, 26 May 2026 19:14:47 +0200, Thomas Gleixner wrote:
> The PTP core indicates in system_device_crosststamp::clock_id the clock ID
> for which the system time stamp should be taken. That allows to utilize
> hardware timestamps with e.g. AUX clocks.
>
> Use ktime_get_snapshot_id() and hand the provided clock ID in.
>
> No functional change.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH 15/24] net/mlx5: Use provided clock ID for history snapshot
From: David Woodhouse @ 2026-05-26 23:51 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171223.826096151@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 464 bytes --]
On Tue, 26 May 2026 19:14:42 +0200, Thomas Gleixner wrote:
> The PTP core indicates in system_device_crosststamp::clock_id the clock ID
> for which the system time stamp should be taken. That allows to utilize
> hardware timestamps with e.g. AUX clocks.
>
> Use ktime_get_snapshot_id() and hand the provided clock ID in.
>
> No functional change.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH 14/24] igc: Use provided clock ID for history snapshot
From: David Woodhouse @ 2026-05-26 23:50 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171223.745281238@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 507 bytes --]
On Tue, 26 May 2026 19:14:37 +0200, Thomas Gleixner wrote:
> The PTP core indicates in system_device_crosststamp::clock_id the clock ID
> for which the system time stamp should be taken. That allows to utilize
> hardware timestamps with e.g. AUX clocks.
>
> Save the provided clock ID and use it in igc_phc_get_syncdevicetime() for
> taking the history snapshot.
>
> No functional change.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH 13/24] ice/ptp: Use provided clock ID for history snapshot
From: David Woodhouse @ 2026-05-26 23:49 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171223.670955218@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 505 bytes --]
On Tue, 26 May 2026 19:14:33 +0200, Thomas Gleixner wrote:
> The PTP core indicates in system_device_crosststamp::clock_id the clock ID
> for which then system time stamp should be taken. That allows to utilize
> hardware timestamps with e.g. AUX clocks.
>
> Save the provided clock ID and use it in ice_capture_crosststamp() for
> taking the history snapshot.
>
> No functional change.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH 12/24] wifi: iwlwifi: Adopt PTP cross timestamps to core changes
From: David Woodhouse @ 2026-05-26 23:47 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171223.596169122@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 504 bytes --]
On Tue, 26 May 2026 19:14:28 +0200, Thomas Gleixner wrote:
> 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>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH 11/24] timekeeping: Add CLOCK ID to system_device_crosststamp
From: David Woodhouse @ 2026-05-26 23:46 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171223.522578743@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 691 bytes --]
On Tue, 26 May 2026 19:14:23 +0200, Thomas Gleixner wrote:
> The normal capture for system/device cross timestamps is CLOCK_REALTIME,
> but that's meaningless for AUX clocks.
>
> Add a clock_id field to struct system_device_crosststamp and initialize it
> with CLOCK_REALTIME at the two places which prepare for cross
> timestamps.
>
> After the related code has been cleaned up, the core code will honor the
> clock_id field when calculating the system time from the system counter
> snapshot.
>
> No functional change.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Tested-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH 10/24] timekeeping: Add system_counterval_t to struct system_device_crosststamp
From: David Woodhouse @ 2026-05-26 23:45 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171223.448889379@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 514 bytes --]
On Tue, 26 May 2026 19:14:18 +0200, Thomas Gleixner wrote:
> An upcoming extension to the PTP IOCTL requires to return the system counter
> value and the clocksource ID to user space. get_device_system_crosststamp() has
> this information already.
>
> Extend struct system_device_crosststamp with a system_counterval_t member
> and fill in the data.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Tested-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH 9/24] timekeeping: Add CLOCK_AUX support for ktime_get_snapshot_id()
From: David Woodhouse @ 2026-05-26 23:44 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171223.374814973@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 339 bytes --]
On Tue, 26 May 2026 19:14:13 +0200, Thomas Gleixner wrote:
> Now that all users are converted it's possible to enable snapshotting of
> CLOCK_AUX time. The underlying clocksource is the same as for all other
> CLOCK variants.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH 8/24] timekeeping: Remove system_time_snapshot::real/boot
From: David Woodhouse @ 2026-05-26 23:44 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171223.300914258@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 338 bytes --]
On Tue, 26 May 2026 19:14:08 +0200, Thomas Gleixner wrote:
> All users are converted over to ktime_get_snapshot_id() and
> system_time_snapshot::sys.
>
> Remove the leftovers.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Tested-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH 7/24] ptp: ptp_vmclock: Convert to ktime_get_snapshot_id()
From: David Woodhouse @ 2026-05-26 23:43 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171223.223860692@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 567 bytes --]
On Tue, 26 May 2026 19:14:03 +0200, Thomas Gleixner wrote:
> ktime_get_snapshot() is replaced by ktime_get_snapshot_id() which allows to
> request a particular CLOCK ID to be captured along with the clocksource
> counter.
>
> Convert vmclock over and use the new system_time_snapshot::sys field, which
> holds the system timestamp selected by the CLOCK ID argument.
>
> No functional change intended.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Tested-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH 6/24] KVM: arm64: Use ktime_get_snapshot_id() to snapshot CLOCK_REALTIME
From: David Woodhouse @ 2026-05-26 23:43 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171223.144327185@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 546 bytes --]
On Tue, 26 May 2026 19:13:58 +0200, Thomas Gleixner wrote:
> ktime_get_snapshot() is replaced by ktime_get_snapshot_id() which allows to
> request a particular CLOCK ID to be captured along with the clocksource
> counter.
>
> Convert the usage in kvm_get_ptp_time() over and use the new
> system_time_snapshot::sys field, which holds the system timestamp selected
> by the CLOCK ID argument.
>
> No functional change intended.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH 5/24] KVM: arm64: Use ktime_get_snapshot_id() to retrieve CLOCK_BOOTTIME
From: David Woodhouse @ 2026-05-26 23:42 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171223.070087856@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 536 bytes --]
On Tue, 26 May 2026 19:13:53 +0200, Thomas Gleixner wrote:
> ktime_get_snapshot() is replaced by ktime_get_snapshot_id() which allows to
> request a particular CLOCK ID to be captured along with the clocksource
> counter.
>
> Convert the tracing mechanism over and use the new
> system_time_snapshot::sys field, which holds the system timestamp selected
> by the CLOCK ID argument.
>
> No functional change intended.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH 4/24] pps: Convert to ktime_get_snapshot_id()
From: David Woodhouse @ 2026-05-26 23:42 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171222.995833811@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 528 bytes --]
On Tue, 26 May 2026 19:13:48 +0200, Thomas Gleixner wrote:
> ktime_get_snapshot() resolves to ktime_get_snapshot_id(CLOCK_REALTIME).
>
> Make it obvious in the code and convert the readout to use the
> snapshot::sys field instead of snapshot::real, which is going away.
>
> Similar to the PPS generators, avoid the more expensive snapshot when
> CONFIG_NTP_PPS is disabled.
>
> No functional change intended.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH 3/24] pps: generators: Use ktime_get_real_ts64() instead of ktime_get_snapshot()
From: David Woodhouse @ 2026-05-26 23:42 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171222.920736414@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 405 bytes --]
On Tue, 26 May 2026 19:13:43 +0200, Thomas Gleixner wrote:
> There is no reason to use the more complex ktime_get_snapshot() for
> retrieving CLOCK_REALTIME.
>
> Just use ktime_get_real_ts64(), which avoids the extra timespec64
> conversion as a bonus.
>
> No functional change intended.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH 2/24] timekeeping: Use system_time_snapshot::sys instead of ::real
From: David Woodhouse @ 2026-05-26 23:40 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171222.846848261@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 634 bytes --]
On Tue, 26 May 2026 19:13:38 +0200, Thomas Gleixner wrote:
> system_time_snapshot::sys provides the same information as
> system_time_snapshot::real when the snapshot was taken with
> ktime_get_snapshot_id(CLOCK_REALTIME).
>
> Convert the history interpolation over to use 'sys' as 'real' is going away
> once all users are converted.
>
> As a side effect this is the first step to support CLOCK_AUX with
> get_device_crosstime_stamp() and the history interpolation.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Tested-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [patch 01/24] timekeeping: Provide ktime_get_snapshot_id()
From: David Woodhouse @ 2026-05-26 23:39 UTC (permalink / raw)
To: tglx
Cc: akiyano, anna-maria, anthony.l.nguyen, dwmw2, frederic, giometti,
jacob.e.keller, johannes.berg, jstultz, kvmarm, linux-kernel,
linux-sound, linux-wireless, maz, miriam.rachel.korenblit,
mlichvar, mst, netdev, oliver.upton, oupton, peter.hilber,
richardcochran, saeedm, sboyd, thomas.weissschuh, tiwai,
vdonnefort, virtualization
In-Reply-To: <20260526171222.769770418@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 1419 bytes --]
On Tue, 26 May 2026 19:13:33 +0200, Thomas Gleixner wrote:
> ktime_get_snapshot() provides a snapshot of the underlying clocksource
> counter value and the corresponding CLOCK_MONOTONIC_RAW, CLOCK_REALTIME and
> CLOCK_BOOTTIME timestamps.
>
> There is no usage of CLOCK_REALTIME and CLOCK_BOOTTIME at the same time and
> CLOCK_BOOTTIME support was just added for the ARM64 KVM tracing mechanism,
> which needs CLOCK_BOOTTIME and the underlying clocksource counter value.
>
> ktime_get_snapshot() is also not suitable for usage with CLOCK_AUX, but
> that's a prerequisite to support PTP hardware timestamping for CLOCK_AUX
> steering.
>
> As a first step, rename ktime_get_snapshot() to ktime_get_snapshot_id(),
> which now takes a clockid argument to select the clock which needs to be
> captured. The result is stored in system_time_snapshot::sys, which will
> replace the system_time_snapshot::real/boot members once all usage sites
> have been converted.
>
> ktime_get_snapshot() is a simple wrapper which hands in CLOCK_REALTIME as
> clockid argument for the conversion period. That means CLOCK_REALTIME is
> now captured twice, but that redunancy is only temporary.
>
> No functional change vs. current users of ktime_get_snapshot()
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: David Woodhouse <dwmw@amazon.co.uk>
Tested-by: David Woodhouse <dwmw@amazon.co.uk>
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5069 bytes --]
^ permalink raw reply
* Re: [PATCH v2] wifi: mt76: track rx napi ownership for cleanup
From: Sean Wang @ 2026-05-26 22:51 UTC (permalink / raw)
To: Ruslan Isaev
Cc: linux-wireless, sean.wang, nbd, lorenzo, ryder.lee,
linux-mediatek, linux-kernel
In-Reply-To: <ahTdpNQp2va_xTVR@wico-dev.wnam.ru>
Hi,
On Mon, May 25, 2026 at 6:39 PM Ruslan Isaev <legale.legale@gmail.com> wrote:
>
>
> mt76_dma_cleanup() deletes rx napi instances for every allocated rx
> queue. This is not symmetric with mt76_dma_init(), which skips WED_RRO
> queues when adding rx napi.
>
> Adding an unconditional napi_disable() in the cleanup path fixes the
> mt7915 remove warning, but it is not safe for all other mt76 paths. mt7921 and
> mt7925 can already disable rx napi in their unregister
> paths before calling mt76_dma_cleanup(). On mt7996/mt7992 WED_RRO
> queues may have ndesc set even though mt76 never added or enabled napi for them.
>
> Track rx napi ownership and enabled state in struct mt76_queue so
> cleanup only disables and deletes napi instances that were actually
> added by mt76.
>
> This keeps the existing reset/suspend/remove ordering intact while
> avoiding double napi_disable() and avoiding napi cleanup on WED_RRO
> queues without napi.
>
> Signed-off-by: Ruslan Isaev <legale.legale@gmail.com>
> ---
> v2:
> - track mt76 rx napi state added/enabled
> - avoid double napi_disable() on mt7921/mt7925 cleanup paths
> - avoid napi cleanup on WED_RRO queues without napi
I do not think v2 is the right shape yet, mainly for a few reasons:
1. The patch scope changed too much
v1 looked like a focused fix for the mt7915/mt7981 remove warning.
But v2 changes the title to RX NAPI ownership tracking and touches
many reset and unregister paths across mt76 and drivers
Could you clarify why the title and scope changed from a targeted
cleanup fix to a generic RX NAPI state refactor?
2. If the issue is limited to mt7915/mt7981 remove, we should consider
fixing it in that functional driver path first
Adding generic NAPI state tracking to struct mt76_queue feels too
broad if the original warning is only from a specific driver removal
path.
3. mt7921/mt7925 do not have the same original issue in practice
The problem I saw with v1 on mt7925 was caused by adding an
unconditional napi_disable() in mt76_dma_cleanup(), while mt7921 and
mt7925 already disable RX NAPI in their unregister paths that cause the
driver to hang.
If mt76_dma_cleanup() is going to own the final RX NAPI
disable/delete path, those duplicated RX NAPI disables in
mt7921/mt7925 unregister should be removed first.
4. If mt76 core does more, functional driver paths should become simpler
A common mt76-layer cleanup should reduce duplicated chip-specific
cleanup logic. v2 instead adds a new NAPI state machine and updates
many functional driver paths, which makes the overall flow harder to
reason about.
5. The WED RRO issue can probably be handled with a smaller symmetric
init/cleanup condition
mt76_dma_init() already skips WED RRO queues when adding RX NAPI.
mt76_dma_cleanup() should use the same condition and only
disable/delete RX NAPI for queues where init actually added RX NAPI.
That would keep init and cleanup symmetric without introducing RX
NAPI ownership state unless we really need it.
So my concern is not about fixing the warning itself, but about the
scope and complexity of v2.
I think we can handle this in two stages:
1. First, fix the current mt7915/mt7981 issue in the affected functional
driver remove path with a minimal and targeted patch. The patch should
also include the appropriate Fixes tag.
2. Then, as a follow-up, we can consider whether mt76 core should own
more of the RX NAPI cleanup path. If we do that, the goal should be
to make the functional driver paths simpler, keep the init/cleanup
conditions symmetric and not cause regression.
Also, I think the patch title should not change too much between v1 and
v2 If this series is still intended to fix the mt7915/mt7981 remove warning,
I would keep the title and scope focused on that first.
Sean
>
> drivers/net/wireless/mediatek/mt76/dma.c | 9 +++--
> drivers/net/wireless/mediatek/mt76/mt76.h | 40 +++++++++++++++++++
> .../net/wireless/mediatek/mt76/mt7603/mac.c | 8 ++--
> .../net/wireless/mediatek/mt76/mt7615/pci.c | 6 +--
> .../wireless/mediatek/mt76/mt7615/pci_mac.c | 4 +-
> .../net/wireless/mediatek/mt76/mt76x0/pci.c | 4 +-
> .../net/wireless/mediatek/mt76/mt76x02_mmio.c | 4 +-
> .../net/wireless/mediatek/mt76/mt76x2/pci.c | 6 +--
> .../net/wireless/mediatek/mt76/mt7915/mac.c | 8 ++--
> .../net/wireless/mediatek/mt76/mt7921/pci.c | 8 ++--
> .../wireless/mediatek/mt76/mt7921/pci_mac.c | 4 +-
> .../net/wireless/mediatek/mt76/mt7925/pci.c | 8 ++--
> .../wireless/mediatek/mt76/mt7925/pci_mac.c | 8 ++--
> .../net/wireless/mediatek/mt76/mt7996/mac.c | 8 ++--
> drivers/net/wireless/mediatek/mt76/npu.c | 3 +-
> 15 files changed, 86 insertions(+), 42 deletions(-)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/dma.c b/drivers/net/wireless/mediatek/mt76/dma.c
> index f8c2fe5f2f58..5c531131a25f 100644
> --- a/drivers/net/wireless/mediatek/mt76/dma.c
> +++ b/drivers/net/wireless/mediatek/mt76/dma.c
> @@ -1099,9 +1099,12 @@ static void
> mt76_dma_rx_queue_init(struct mt76_dev *dev, enum mt76_rxq_id qid,
> int (*poll)(struct napi_struct *napi, int budget))
> {
> + struct mt76_queue *q = &dev->q_rx[qid];
> +
> netif_napi_add(dev->napi_dev, &dev->napi[qid], poll);
> - mt76_dma_rx_fill_buf(dev, &dev->q_rx[qid], false);
> - napi_enable(&dev->napi[qid]);
> + q->napi_state = MT76_NAPI_ADDED;
> + mt76_dma_rx_fill_buf(dev, q, false);
> + mt76_rx_napi_enable(dev, qid);
> }
>
> static int
> @@ -1189,7 +1192,7 @@ void mt76_dma_cleanup(struct mt76_dev *dev)
> mt76_for_each_q_rx(dev, i) {
> struct mt76_queue *q = &dev->q_rx[i];
>
> - netif_napi_del(&dev->napi[i]);
> + mt76_rx_napi_del(dev, i);
> mt76_dma_rx_cleanup(dev, q);
>
> page_pool_destroy(q->page_pool);
> diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h
> index 527bef97e122..3ce936bdcf88 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt76.h
> +++ b/drivers/net/wireless/mediatek/mt76/mt76.h
> @@ -251,6 +251,7 @@ struct mt76_queue {
> int buf_size;
> bool stopped;
> bool blocked;
> + u8 napi_state;
>
> u8 buf_offset;
> u16 flags;
> @@ -1283,6 +1284,45 @@ static inline int mt76_wed_dma_setup(struct mt76_dev *dev, struct mt76_queue *q,
> for (i = 0; i < ARRAY_SIZE((dev)->q_rx); i++) \
> if ((dev)->q_rx[i].ndesc)
>
> +#define MT76_NAPI_ADDED BIT(0)
> +#define MT76_NAPI_ENABLED BIT(1)
> +
> +static inline void mt76_rx_napi_enable(struct mt76_dev *dev, int qid)
> +{
> + struct mt76_queue *q = &dev->q_rx[qid];
> +
> + if (!(q->napi_state & MT76_NAPI_ADDED) ||
> + (q->napi_state & MT76_NAPI_ENABLED))
> + return;
> +
> + napi_enable(&dev->napi[qid]);
> + q->napi_state |= MT76_NAPI_ENABLED;
> +}
> +
> +static inline void mt76_rx_napi_disable(struct mt76_dev *dev, int qid)
> +{
> + struct mt76_queue *q = &dev->q_rx[qid];
> +
> + if (!(q->napi_state & MT76_NAPI_ADDED) ||
> + !(q->napi_state & MT76_NAPI_ENABLED))
> + return;
> +
> + napi_disable(&dev->napi[qid]);
> + q->napi_state &= ~MT76_NAPI_ENABLED;
> +}
> +
> +static inline void mt76_rx_napi_del(struct mt76_dev *dev, int qid)
> +{
> + struct mt76_queue *q = &dev->q_rx[qid];
> +
> + if (!(q->napi_state & MT76_NAPI_ADDED))
> + return;
> +
> + mt76_rx_napi_disable(dev, qid);
> + netif_napi_del(&dev->napi[qid]);
> + q->napi_state = 0;
> +}
> +
>
> #define mt76_dereference(p, dev) \
> rcu_dereference_protected(p, lockdep_is_held(&(dev)->mutex))
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/mac.c b/drivers/net/wireless/mediatek/mt76/mt7603/mac.c
> index d3110eeb45d7..be35ec0d31d4 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7603/mac.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7603/mac.c
> @@ -1423,8 +1423,8 @@ static void mt7603_mac_watchdog_reset(struct mt7603_dev *dev)
>
> mt76_worker_disable(&dev->mt76.tx_worker);
> tasklet_disable(&dev->mt76.pre_tbtt_tasklet);
> - napi_disable(&dev->mt76.napi[0]);
> - napi_disable(&dev->mt76.napi[1]);
> + mt76_rx_napi_disable(&dev->mt76, 0);
> + mt76_rx_napi_disable(&dev->mt76, 1);
> napi_disable(&dev->mt76.tx_napi);
>
> mutex_lock(&dev->mt76.mutex);
> @@ -1474,8 +1474,8 @@ static void mt7603_mac_watchdog_reset(struct mt7603_dev *dev)
> mt7603_beacon_set_timer(dev, -1, beacon_int);
>
> napi_enable(&dev->mt76.tx_napi);
> - napi_enable(&dev->mt76.napi[0]);
> - napi_enable(&dev->mt76.napi[1]);
> + mt76_rx_napi_enable(&dev->mt76, 0);
> + mt76_rx_napi_enable(&dev->mt76, 1);
>
> local_bh_disable();
> napi_schedule(&dev->mt76.tx_napi);
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/pci.c b/drivers/net/wireless/mediatek/mt76/mt7615/pci.c
> index f5018bfa317a..600b4f2bf1a1 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7615/pci.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7615/pci.c
> @@ -92,7 +92,7 @@ static int mt7615_pci_suspend(struct pci_dev *pdev, pm_message_t state)
> mt76_worker_disable(&mdev->tx_worker);
>
> mt76_for_each_q_rx(mdev, i) {
> - napi_disable(&mdev->napi[i]);
> + mt76_rx_napi_disable(mdev, i);
> }
> tasklet_kill(&mdev->irq_tasklet);
>
> @@ -127,7 +127,7 @@ static int mt7615_pci_suspend(struct pci_dev *pdev, pm_message_t state)
>
> restore:
> mt76_for_each_q_rx(mdev, i) {
> - napi_enable(&mdev->napi[i]);
> + mt76_rx_napi_enable(mdev, i);
> }
> napi_enable(&mdev->tx_napi);
> if (hif_suspend)
> @@ -166,7 +166,7 @@ static int mt7615_pci_resume(struct pci_dev *pdev)
> mt76_worker_enable(&mdev->tx_worker);
>
> mt76_for_each_q_rx(mdev, i) {
> - napi_enable(&mdev->napi[i]);
> + mt76_rx_napi_enable(mdev, i);
> }
> napi_enable(&mdev->tx_napi);
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/pci_mac.c b/drivers/net/wireless/mediatek/mt76/mt7615/pci_mac.c
> index 53cb1eed1e4f..a83589c628f9 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7615/pci_mac.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7615/pci_mac.c
> @@ -236,7 +236,7 @@ void mt7615_mac_reset_work(struct work_struct *work)
>
> mt76_worker_disable(&dev->mt76.tx_worker);
> mt76_for_each_q_rx(&dev->mt76, i)
> - napi_disable(&dev->mt76.napi[i]);
> + mt76_rx_napi_disable(&dev->mt76, i);
> napi_disable(&dev->mt76.tx_napi);
>
> mt7615_mutex_acquire(dev);
> @@ -264,7 +264,7 @@ void mt7615_mac_reset_work(struct work_struct *work)
>
> napi_enable(&dev->mt76.tx_napi);
> mt76_for_each_q_rx(&dev->mt76, i) {
> - napi_enable(&dev->mt76.napi[i]);
> + mt76_rx_napi_enable(&dev->mt76, i);
> }
>
> local_bh_disable();
> diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/pci.c b/drivers/net/wireless/mediatek/mt76/mt76x0/pci.c
> index f8d206a07f99..96380d016351 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt76x0/pci.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt76x0/pci.c
> @@ -257,7 +257,7 @@ static int mt76x0e_suspend(struct pci_dev *pdev, pm_message_t state)
> napi_disable(&mdev->tx_napi);
>
> mt76_for_each_q_rx(mdev, i)
> - napi_disable(&mdev->napi[i]);
> + mt76_rx_napi_disable(mdev, i);
>
> mt76x02_dma_disable(dev);
> mt76x02_mcu_cleanup(dev);
> @@ -285,7 +285,7 @@ static int mt76x0e_resume(struct pci_dev *pdev)
>
> mt76_for_each_q_rx(mdev, i) {
> mt76_queue_rx_reset(dev, i);
> - napi_enable(&mdev->napi[i]);
> + mt76_rx_napi_enable(mdev, i);
> }
> napi_enable(&mdev->tx_napi);
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c b/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c
> index dc7c03d23123..0da4bbad5ba3 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c
> @@ -444,7 +444,7 @@ static void mt76x02_watchdog_reset(struct mt76x02_dev *dev)
> napi_disable(&dev->mt76.tx_napi);
>
> mt76_for_each_q_rx(&dev->mt76, i) {
> - napi_disable(&dev->mt76.napi[i]);
> + mt76_rx_napi_disable(&dev->mt76, i);
> }
>
> mutex_lock(&dev->mt76.mutex);
> @@ -505,7 +505,7 @@ static void mt76x02_watchdog_reset(struct mt76x02_dev *dev)
>
> napi_enable(&dev->mt76.tx_napi);
> mt76_for_each_q_rx(&dev->mt76, i) {
> - napi_enable(&dev->mt76.napi[i]);
> + mt76_rx_napi_enable(&dev->mt76, i);
> }
>
> local_bh_disable();
> diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/pci.c b/drivers/net/wireless/mediatek/mt76/mt76x2/pci.c
> index 491a32921a06..a23c2560e90f 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt76x2/pci.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/pci.c
> @@ -119,7 +119,7 @@ mt76x2e_suspend(struct pci_dev *pdev, pm_message_t state)
> mt76_worker_disable(&mdev->tx_worker);
>
> mt76_for_each_q_rx(mdev, i)
> - napi_disable(&mdev->napi[i]);
> + mt76_rx_napi_disable(mdev, i);
>
> pci_enable_wake(pdev, pci_choose_state(pdev, state), true);
> pci_save_state(pdev);
> @@ -131,7 +131,7 @@ mt76x2e_suspend(struct pci_dev *pdev, pm_message_t state)
>
> restore:
> mt76_for_each_q_rx(mdev, i)
> - napi_enable(&mdev->napi[i]);
> + mt76_rx_napi_enable(mdev, i);
> napi_enable(&mdev->tx_napi);
>
> return err;
> @@ -153,7 +153,7 @@ mt76x2e_resume(struct pci_dev *pdev)
> mt76_worker_enable(&mdev->tx_worker);
>
> mt76_for_each_q_rx(mdev, i) {
> - napi_enable(&mdev->napi[i]);
> + mt76_rx_napi_enable(mdev, i);
> }
> napi_enable(&mdev->tx_napi);
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
> index cec2c4208255..354ed0b69013 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
> @@ -1327,7 +1327,7 @@ mt7915_mac_restart(struct mt7915_dev *dev)
> mt76_worker_disable(&dev->mt76.tx_worker);
> mt76_for_each_q_rx(mdev, i) {
> if (mdev->q_rx[i].ndesc)
> - napi_disable(&dev->mt76.napi[i]);
> + mt76_rx_napi_disable(&dev->mt76, i);
> }
> napi_disable(&dev->mt76.tx_napi);
>
> @@ -1339,7 +1339,7 @@ mt7915_mac_restart(struct mt7915_dev *dev)
>
> mt76_for_each_q_rx(mdev, i) {
> if (mdev->q_rx[i].ndesc) {
> - napi_enable(&dev->mt76.napi[i]);
> + mt76_rx_napi_enable(&dev->mt76, i);
> }
> }
>
> @@ -1527,7 +1527,7 @@ void mt7915_mac_reset_work(struct work_struct *work)
>
> mt76_worker_disable(&dev->mt76.tx_worker);
> mt76_for_each_q_rx(&dev->mt76, i)
> - napi_disable(&dev->mt76.napi[i]);
> + mt76_rx_napi_disable(&dev->mt76, i);
> napi_disable(&dev->mt76.tx_napi);
>
>
> @@ -1558,7 +1558,7 @@ void mt7915_mac_reset_work(struct work_struct *work)
> clear_bit(MT76_RESET, &phy2->mt76->state);
>
> mt76_for_each_q_rx(&dev->mt76, i) {
> - napi_enable(&dev->mt76.napi[i]);
> + mt76_rx_napi_enable(&dev->mt76, i);
> }
>
> local_bh_disable();
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/pci.c b/drivers/net/wireless/mediatek/mt76/mt7921/pci.c
> index 7a790ddf43bb..c3188b344e50 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7921/pci.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7921/pci.c
> @@ -52,7 +52,7 @@ static void mt7921e_unregister_device(struct mt792x_dev *dev)
> cancel_work_sync(&dev->init_work);
> mt76_unregister_device(&dev->mt76);
> mt76_for_each_q_rx(&dev->mt76, i)
> - napi_disable(&dev->mt76.napi[i]);
> + mt76_rx_napi_disable(&dev->mt76, i);
> cancel_delayed_work_sync(&pm->ps_work);
> cancel_work_sync(&pm->wake_work);
> cancel_work_sync(&dev->reset_work);
> @@ -492,7 +492,7 @@ static int mt7921_pci_suspend(struct device *device)
> mt76_worker_disable(&mdev->tx_worker);
>
> mt76_for_each_q_rx(mdev, i) {
> - napi_disable(&mdev->napi[i]);
> + mt76_rx_napi_disable(mdev, i);
> }
>
> /* wait until dma is idle */
> @@ -518,7 +518,7 @@ static int mt7921_pci_suspend(struct device *device)
>
> restore_napi:
> mt76_for_each_q_rx(mdev, i) {
> - napi_enable(&mdev->napi[i]);
> + mt76_rx_napi_enable(mdev, i);
> }
> napi_enable(&mdev->tx_napi);
>
> @@ -564,7 +564,7 @@ static int mt7921_pci_resume(struct device *device)
> mt76_worker_enable(&mdev->tx_worker);
>
> mt76_for_each_q_rx(mdev, i) {
> - napi_enable(&mdev->napi[i]);
> + mt76_rx_napi_enable(mdev, i);
> }
> napi_enable(&mdev->tx_napi);
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/pci_mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/pci_mac.c
> index 0db7acb3a637..5d7871b8f77c 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7921/pci_mac.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7921/pci_mac.c
> @@ -72,7 +72,7 @@ int mt7921e_mac_reset(struct mt792x_dev *dev)
>
> mt76_worker_disable(&dev->mt76.tx_worker);
> mt76_for_each_q_rx(&dev->mt76, i) {
> - napi_disable(&dev->mt76.napi[i]);
> + mt76_rx_napi_disable(&dev->mt76, i);
> }
> napi_disable(&dev->mt76.tx_napi);
>
> @@ -82,7 +82,7 @@ int mt7921e_mac_reset(struct mt792x_dev *dev)
> mt792x_wpdma_reset(dev, true);
>
> mt76_for_each_q_rx(&dev->mt76, i) {
> - napi_enable(&dev->mt76.napi[i]);
> + mt76_rx_napi_enable(&dev->mt76, i);
> }
>
> local_bh_disable();
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/pci.c b/drivers/net/wireless/mediatek/mt76/mt7925/pci.c
> index c4161754c01d..1da650ac7f4d 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7925/pci.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7925/pci.c
> @@ -40,7 +40,7 @@ static void mt7925e_unregister_device(struct mt792x_dev *dev)
> cancel_work_sync(&dev->init_work);
> mt76_unregister_device(&dev->mt76);
> mt76_for_each_q_rx(&dev->mt76, i)
> - napi_disable(&dev->mt76.napi[i]);
> + mt76_rx_napi_disable(&dev->mt76, i);
> cancel_delayed_work_sync(&pm->ps_work);
> cancel_work_sync(&pm->wake_work);
> cancel_work_sync(&dev->reset_work);
> @@ -481,7 +481,7 @@ static int mt7925_pci_suspend(struct device *device)
> mt76_worker_disable(&mdev->tx_worker);
>
> mt76_for_each_q_rx(mdev, i) {
> - napi_disable(&mdev->napi[i]);
> + mt76_rx_napi_disable(mdev, i);
> }
>
> /* wait until dma is idle */
> @@ -509,7 +509,7 @@ static int mt7925_pci_suspend(struct device *device)
>
> restore_napi:
> mt76_for_each_q_rx(mdev, i) {
> - napi_enable(&mdev->napi[i]);
> + mt76_rx_napi_enable(mdev, i);
> }
> napi_enable(&mdev->tx_napi);
>
> @@ -559,7 +559,7 @@ static int _mt7925_pci_resume(struct device *device, bool restore)
> mt76_worker_enable(&mdev->tx_worker);
>
> mt76_for_each_q_rx(mdev, i) {
> - napi_enable(&mdev->napi[i]);
> + mt76_rx_napi_enable(mdev, i);
> }
> napi_enable(&mdev->tx_napi);
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/pci_mac.c b/drivers/net/wireless/mediatek/mt76/mt7925/pci_mac.c
> index 3072850c2752..6bb47db8d16a 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7925/pci_mac.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7925/pci_mac.c
> @@ -88,11 +88,11 @@ int mt7925e_mac_reset(struct mt792x_dev *dev)
>
> mt76_worker_disable(&dev->mt76.tx_worker);
> if (irq_map->rx.data_complete_mask)
> - napi_disable(&dev->mt76.napi[MT_RXQ_MAIN]);
> + mt76_rx_napi_disable(&dev->mt76, MT_RXQ_MAIN);
> if (irq_map->rx.wm_complete_mask)
> - napi_disable(&dev->mt76.napi[MT_RXQ_MCU]);
> + mt76_rx_napi_disable(&dev->mt76, MT_RXQ_MCU);
> if (irq_map->rx.wm2_complete_mask)
> - napi_disable(&dev->mt76.napi[MT_RXQ_MCU_WA]);
> + mt76_rx_napi_disable(&dev->mt76, MT_RXQ_MCU_WA);
> if (irq_map->tx.all_complete_mask)
> napi_disable(&dev->mt76.tx_napi);
>
> @@ -102,7 +102,7 @@ int mt7925e_mac_reset(struct mt792x_dev *dev)
> mt792x_wpdma_reset(dev, true);
>
> mt76_for_each_q_rx(&dev->mt76, i) {
> - napi_enable(&dev->mt76.napi[i]);
> + mt76_rx_napi_enable(&dev->mt76, i);
> }
> napi_enable(&dev->mt76.tx_napi);
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mac.c b/drivers/net/wireless/mediatek/mt76/mt7996/mac.c
> index e2a83da3a09c..a75238ce8807 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7996/mac.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7996/mac.c
> @@ -2262,7 +2262,7 @@ mt7996_mac_restart(struct mt7996_dev *dev)
> continue;
>
> if (mdev->q_rx[i].ndesc)
> - napi_disable(&dev->mt76.napi[i]);
> + mt76_rx_napi_disable(&dev->mt76, i);
> }
> napi_disable(&dev->mt76.tx_napi);
>
> @@ -2278,7 +2278,7 @@ mt7996_mac_restart(struct mt7996_dev *dev)
> continue;
>
> if (mdev->q_rx[i].ndesc) {
> - napi_enable(&dev->mt76.napi[i]);
> + mt76_rx_napi_enable(&dev->mt76, i);
> local_bh_disable();
> napi_schedule(&dev->mt76.napi[i]);
> local_bh_enable();
> @@ -2534,7 +2534,7 @@ void mt7996_mac_reset_work(struct work_struct *work)
> if (mt76_queue_is_npu_txfree(&dev->mt76.q_rx[i]))
> continue;
>
> - napi_disable(&dev->mt76.napi[i]);
> + mt76_rx_napi_disable(&dev->mt76, i);
> }
> napi_disable(&dev->mt76.tx_napi);
>
> @@ -2596,7 +2596,7 @@ void mt7996_mac_reset_work(struct work_struct *work)
> if (mt76_queue_is_npu_txfree(&dev->mt76.q_rx[i]))
> continue;
>
> - napi_enable(&dev->mt76.napi[i]);
> + mt76_rx_napi_enable(&dev->mt76, i);
> local_bh_disable();
> napi_schedule(&dev->mt76.napi[i]);
> local_bh_enable();
> diff --git a/drivers/net/wireless/mediatek/mt76/npu.c b/drivers/net/wireless/mediatek/mt76/npu.c
> index c4c7c0af6321..fb4ba5bdbf48 100644
> --- a/drivers/net/wireless/mediatek/mt76/npu.c
> +++ b/drivers/net/wireless/mediatek/mt76/npu.c
> @@ -291,8 +291,9 @@ int mt76_npu_rx_queue_init(struct mt76_dev *dev, struct mt76_queue *q)
> goto out;
>
> netif_napi_add(dev->napi_dev, &dev->napi[qid], mt76_npu_rx_poll);
> + q->napi_state = MT76_NAPI_ADDED;
> mt76_npu_fill_rx_queue(dev, q);
> - napi_enable(&dev->napi[qid]);
> + mt76_rx_napi_enable(dev, qid);
> out:
> mutex_unlock(&dev->mutex);
>
> --
> 2.39.5
>
>
^ permalink raw reply
* Re: [patch 00/24] timekeeping/ptp: Expand snapshot functionality
From: Jacob Keller @ 2026-05-26 21:56 UTC (permalink / raw)
To: Thomas Gleixner, LKML
Cc: David Woodhouse, Miroslav Lichvar, John Stultz, Stephen Boyd,
Anna-Maria Behnsen, Frederic Weisbecker, thomas.weissschuh,
Arthur Kiyanovski, Rodolfo Giometti, Vincent Donnefort,
Marc Zyngier, Oliver Upton, kvmarm, Oliver Upton, Richard Cochran,
netdev, Takashi Iwai, Miri Korenblit, Johannes Berg, Tony Nguyen,
Saeed Mahameed, Peter Hilber, Michael S. Tsirkin, virtualization,
linux-wireless, linux-sound
In-Reply-To: <20260526165826.392227559@kernel.org>
On 5/26/2026 10:13 AM, Thomas Gleixner wrote:
> Sorry for the large CC list, but changing the inner workings touches
> unfortunately a lot of places in one go.
>
> PTP wants to grow new snapshot functionality, which provides not only the
> captured CLOCK* values, but also the underlying clocksource counter value.
>
> https://lore.kernel.org/20260515164033.6403-1-akiyano@amazon.com
>
> There was quite some discussion in seemingly related threads how to capture
> these values and how to provide core infrastructure so that driver writers
> have something to work with
>
> https://lore.kernel.org/20260514225842.110706-1-hramamurthy@google.com
> https://lore.kernel.org/20260520135207.37826-1-dwmw2@infradead.org
>
> This series implements the timekeeping related mechanisms to:
>
> 1) Capture CLOCK values along with the clocksource counter value for
> non-hardware based sampling
>
> 2) Expanding the hardware cross time stamp mechanism to hand back the
> clocksource counter value, which was captured by the device, along
> with the related CLOCK values
>
> 3) Adding AUX clock support to the hardware cross timestamping core
>
Overall the series looks good to me. I made some comments while
reviewing but nothing major and I think mostly it was on interim code
that is removed by the end of the series.
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
> It's based on v7.1-rc2 and also available from git:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git timekeeping-ptp-extend-v1
>
> Thanks to David for rebasing his PTP/timekeeping work on top and providing
> feedback, fixes and testing.
>
> Thanks,
>
> tglx
> ---
> arch/arm64/kvm/hyp_trace.c | 8
> arch/arm64/kvm/hypercalls.c | 6
> drivers/net/dsa/sja1105/sja1105_main.c | 8
> drivers/net/ethernet/intel/ice/ice_ptp.c | 5
> drivers/net/ethernet/intel/igc/igc.h | 1
> drivers/net/ethernet/intel/igc/igc_ptp.c | 4
> drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c | 4
> drivers/net/wireless/intel/iwlwifi/mld/ptp.c | 5
> drivers/net/wireless/intel/iwlwifi/mvm/ptp.c | 7
> drivers/pps/generators/pps_gen-dummy.c | 6
> drivers/pps/generators/pps_gen_tio.c | 6
> drivers/ptp/ptp_chardev.c | 18 +
> drivers/ptp/ptp_ocp.c | 11 -
> drivers/ptp/ptp_vmclock.c | 25 --
> drivers/virtio/virtio_rtc_ptp.c | 2
> include/linux/pps_kernel.h | 8
> include/linux/ptp_clock_kernel.h | 15 -
> include/linux/timekeeping.h | 54 ++---
> kernel/time/timekeeping.c | 211 ++++++++++++--------
> sound/hda/common/controller.c | 4
> 20 files changed, 236 insertions(+), 172 deletions(-)
^ permalink raw reply
* Re: [patch 14/24] igc: Use provided clock ID for history snapshot
From: Jacob Keller @ 2026-05-26 21:51 UTC (permalink / raw)
To: Thomas Gleixner, LKML
Cc: David Woodhouse, Miroslav Lichvar, John Stultz, Stephen Boyd,
Anna-Maria Behnsen, Frederic Weisbecker, thomas.weissschuh,
Arthur Kiyanovski, Tony Nguyen, Rodolfo Giometti,
Vincent Donnefort, Marc Zyngier, Oliver Upton, kvmarm,
Oliver Upton, Richard Cochran, netdev, Takashi Iwai,
Miri Korenblit, Johannes Berg, Saeed Mahameed, Peter Hilber,
Michael S. Tsirkin, virtualization, linux-wireless, linux-sound
In-Reply-To: <20260526171223.745281238@kernel.org>
On 5/26/2026 10:14 AM, Thomas Gleixner wrote:
> The PTP core indicates in system_device_crosststamp::clock_id the clock ID
> for which the system time stamp should be taken. That allows to utilize
> hardware timestamps with e.g. AUX clocks.
>
> Save the provided clock ID and use it in igc_phc_get_syncdevicetime() for
> taking the history snapshot.
>
> No functional change.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
> Cc: Tony Nguyen <anthony.l.nguyen@intel.com>
> ---
Acked-by: Jacob Keller <jacob.e.keller@intel.com>
^ permalink raw reply
* Re: [patch 13/24] ice/ptp: Use provided clock ID for history snapshot
From: Jacob Keller @ 2026-05-26 21:51 UTC (permalink / raw)
To: Thomas Gleixner, LKML
Cc: David Woodhouse, Miroslav Lichvar, John Stultz, Stephen Boyd,
Anna-Maria Behnsen, Frederic Weisbecker, thomas.weissschuh,
Arthur Kiyanovski, Rodolfo Giometti, Vincent Donnefort,
Marc Zyngier, Oliver Upton, kvmarm, Oliver Upton, Richard Cochran,
netdev, Takashi Iwai, Miri Korenblit, Johannes Berg, Tony Nguyen,
Saeed Mahameed, Peter Hilber, Michael S. Tsirkin, virtualization,
linux-wireless, linux-sound
In-Reply-To: <20260526171223.670955218@kernel.org>
On 5/26/2026 10:14 AM, Thomas Gleixner wrote:
> The PTP core indicates in system_device_crosststamp::clock_id the clock ID
> for which then system time stamp should be taken. That allows to utilize
> hardware timestamps with e.g. AUX clocks.
>
> Save the provided clock ID and use it in ice_capture_crosststamp() for
> taking the history snapshot.
>
> No functional change.
>
> Signed-off-by: Thomas Gleixner <tglx@kernel.org>
> Cc: Jacob Keller <jacob.e.keller@intel.com>
Acked-by: Jacob Keller <jacob.e.keller@intel.com>
^ permalink raw reply
* Re: [patch 08/24] timekeeping: Remove system_time_snapshot::real/boot
From: Jacob Keller @ 2026-05-26 21:52 UTC (permalink / raw)
To: Thomas Gleixner, LKML
Cc: David Woodhouse, Miroslav Lichvar, John Stultz, Stephen Boyd,
Anna-Maria Behnsen, Frederic Weisbecker, thomas.weissschuh,
Arthur Kiyanovski, Rodolfo Giometti, Vincent Donnefort,
Marc Zyngier, Oliver Upton, kvmarm, Oliver Upton, Richard Cochran,
netdev, Takashi Iwai, Miri Korenblit, Johannes Berg, Tony Nguyen,
Saeed Mahameed, Peter Hilber, Michael S. Tsirkin, virtualization,
linux-wireless, linux-sound
In-Reply-To: <9819b5ee-1f03-4687-9a36-9284741e19a4@intel.com>
On 5/26/2026 2:49 PM, Jacob Keller wrote:
> On 5/26/2026 10:14 AM, Thomas Gleixner wrote:
>> All users are converted over to ktime_get_snapshot_id() and
>> system_time_snapshot::sys.
>>
>
> I would have expected this to also remove ktime_get_snapshot() since the
> description claims all users are converted to ktime_get_snapshot_id().
>
Ah. All the users of the real/boot paramaters have been updated, but
drivers still use ktime_get_snapshot() until later in the series. Ok,
that makes sense.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox