* 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 21/24] ALSA: hda/common: 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.274187786@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 322 bytes --]
On Tue, 26 May 2026 19:15:12 +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 22/24] timekeeping: Remove system_device_crosststamp::sys_realtime
From: David Woodhouse @ 2026-05-26 23:56 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.347997043@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 260 bytes --]
On Tue, 26 May 2026 19:15:17 +0200, Thomas Gleixner wrote:
> All users are converted to sys_systime.
>
> 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 23/24] timekeeping: Add support for AUX clock cross timestamping
From: David Woodhouse @ 2026-05-26 23:56 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.423155175@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 374 bytes --]
On Tue, 26 May 2026 19:15:22 +0200, Thomas Gleixner wrote:
> Now that all prerequisites are in place add the final support for AUX
> clocks in get_device_system_crosststamp(), which enables the PTP layer to
> support hardware cross timestamps with a new IOTCL.
>
> 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 24/24] ptp: Switch to ktime_get_snapshot_id() for pre/post timestamps
From: David Woodhouse @ 2026-05-26 23:57 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.499777655@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 550 bytes --]
On Tue, 26 May 2026 19:15:27 +0200, Thomas Gleixner wrote:
> To prepare for a new PTP IOCTL, which exposes the raw counter value along
> with the requested system time snapshot, switch the pre/post time stamp
> sampling over to use ktime_get_snapshot_id() and fix up all usage sites.
>
> No functional change intended.
>
> The ptp_vmclock conversion was simplified by David Woodhouse.
>
> 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
* [PATCH wireless-next 0/2] wifi: S1G hwsim fixups
From: Lachlan Hodges @ 2026-05-27 3:38 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, arien.judge, Lachlan Hodges
Some fixups to get hwsim ready for the new S1G tests hopefully
coming to hostapd.
lachlan
Lachlan Hodges (2):
wifi: mac80211_hwsim: don't run RC update on new STA on S1G vif
wifi: mac80211_hwsim: modernise S1G channel list
.../wireless/virtual/mac80211_hwsim_main.c | 61 +++++++++++++------
1 file changed, 44 insertions(+), 17 deletions(-)
--
2.43.0
^ permalink raw reply
* [PATCH wireless-next 1/2] wifi: mac80211_hwsim: don't run RC update on new STA on S1G vif
From: Lachlan Hodges @ 2026-05-27 3:38 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, arien.judge, Lachlan Hodges
In-Reply-To: <20260527033828.183821-1-lachlan.hodges@morsemicro.com>
mac80211_hwsim_sta_rc_update() is unable to handle S1G widths so
when a new STA is added under a S1G vif the WARN is hit preventing
hwsim use for S1G. For now, skip calling rc_update() for S1G
interfaces. This is required such that the soon-to-be S1G hwsim tests
can successfully run.
Signed-off-by: Lachlan Hodges <lachlan.hodges@morsemicro.com>
---
Ran hwsim tests just to confirm nothing broke on tip of hostapd
and everything looks good. Hopefully this is the last if (s1g/!s1g)
for a while.. I am to post the hostap patchset in a couple of days
so hopefully soon there will be s1g tests will will actually
execute the S1G paths.
---
drivers/net/wireless/virtual/mac80211_hwsim_main.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/virtual/mac80211_hwsim_main.c b/drivers/net/wireless/virtual/mac80211_hwsim_main.c
index 67a33e5e7d54..0241b38beddc 100644
--- a/drivers/net/wireless/virtual/mac80211_hwsim_main.c
+++ b/drivers/net/wireless/virtual/mac80211_hwsim_main.c
@@ -2816,7 +2816,10 @@ static int mac80211_hwsim_sta_add(struct ieee80211_hw *hw,
hwsim_check_magic(vif);
hwsim_set_sta_magic(sta);
- mac80211_hwsim_sta_rc_update(hw, vif, &sta->deflink, 0);
+
+ /* For now, don't run RC update on STAs on an S1G interface */
+ if (!vif->cfg.s1g)
+ mac80211_hwsim_sta_rc_update(hw, vif, &sta->deflink, 0);
if (sta->valid_links) {
WARN(hweight16(sta->valid_links) > 1,
--
2.43.0
^ permalink raw reply related
* [PATCH wireless-next 2/2] wifi: mac80211_hwsim: modernise S1G channel list
From: Lachlan Hodges @ 2026-05-27 3:38 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, arien.judge, Lachlan Hodges
In-Reply-To: <20260527033828.183821-1-lachlan.hodges@morsemicro.com>
The current S1G channel list in mac80211_hwsim does not represent
what S1G drivers would advertise that being 1MHz primaries. Also,
include the NO_PRIMARY flag on the edgeband 1MHz primaries to emulate
US operation such that it can also be tested.
Signed-off-by: Lachlan Hodges <lachlan.hodges@morsemicro.com>
---
.../wireless/virtual/mac80211_hwsim_main.c | 56 +++++++++++++------
1 file changed, 40 insertions(+), 16 deletions(-)
diff --git a/drivers/net/wireless/virtual/mac80211_hwsim_main.c b/drivers/net/wireless/virtual/mac80211_hwsim_main.c
index 0241b38beddc..1512e160e41a 100644
--- a/drivers/net/wireless/virtual/mac80211_hwsim_main.c
+++ b/drivers/net/wireless/virtual/mac80211_hwsim_main.c
@@ -356,6 +356,14 @@ static struct net_device *hwsim_mon; /* global monitor netdev */
.hw_value = (_freq), \
}
+#define CHANS1G(_freq, _offset, _flags) { \
+ .band = NL80211_BAND_S1GHZ, \
+ .center_freq = (_freq), \
+ .freq_offset = (_offset), \
+ .hw_value = (_freq), \
+ .flags = (_flags), \
+}
+
static const struct ieee80211_channel hwsim_channels_2ghz[] = {
CHAN2G(2412), /* Channel 1 */
CHAN2G(2417), /* Channel 2 */
@@ -490,7 +498,38 @@ static const struct ieee80211_channel hwsim_channels_6ghz[] = {
static_assert(HWSIM_NUM_CHANNELS_6GHZ == ARRAY_SIZE(hwsim_channels_6ghz),
"Inconsistent 6 GHz channel count");
-static struct ieee80211_channel hwsim_channels_s1g[HWSIM_NUM_S1G_CHANNELS_US];
+/*
+ * US 2024 channels (op class 1). Additionally to emulate real world
+ * US operation, the edgeband 1MHz channels (1, 51) are marked as NO_PRIMARY.
+ */
+static const struct ieee80211_channel hwsim_channels_s1g[] = {
+ CHANS1G(902, 500, IEEE80211_CHAN_S1G_NO_PRIMARY), /* Channel 1 */
+ CHANS1G(903, 500, 0), /* Channel 3 */
+ CHANS1G(904, 500, 0), /* Channel 5 */
+ CHANS1G(905, 500, 0), /* Channel 7 */
+ CHANS1G(906, 500, 0), /* Channel 9 */
+ CHANS1G(907, 500, 0), /* Channel 11 */
+ CHANS1G(908, 500, 0), /* Channel 13 */
+ CHANS1G(909, 500, 0), /* Channel 15 */
+ CHANS1G(910, 500, 0), /* Channel 17 */
+ CHANS1G(911, 500, 0), /* Channel 19 */
+ CHANS1G(912, 500, 0), /* Channel 21 */
+ CHANS1G(913, 500, 0), /* Channel 23 */
+ CHANS1G(914, 500, 0), /* Channel 25 */
+ CHANS1G(915, 500, 0), /* Channel 27 */
+ CHANS1G(916, 500, 0), /* Channel 29 */
+ CHANS1G(917, 500, 0), /* Channel 31 */
+ CHANS1G(918, 500, 0), /* Channel 33 */
+ CHANS1G(919, 500, 0), /* Channel 35 */
+ CHANS1G(920, 500, 0), /* Channel 37 */
+ CHANS1G(921, 500, 0), /* Channel 39 */
+ CHANS1G(922, 500, 0), /* Channel 41 */
+ CHANS1G(923, 500, 0), /* Channel 43 */
+ CHANS1G(924, 500, 0), /* Channel 45 */
+ CHANS1G(925, 500, 0), /* Channel 47 */
+ CHANS1G(926, 500, 0), /* Channel 49 */
+ CHANS1G(927, 500, IEEE80211_CHAN_S1G_NO_PRIMARY), /* Channel 51 */
+};
static const struct ieee80211_sta_s1g_cap hwsim_s1g_cap = {
.s1g = true,
@@ -519,19 +558,6 @@ static const struct ieee80211_sta_s1g_cap hwsim_s1g_cap = {
0 },
};
-static void hwsim_init_s1g_channels(struct ieee80211_channel *chans)
-{
- int ch, freq;
-
- for (ch = 0; ch < ARRAY_SIZE(hwsim_channels_s1g); ch++) {
- freq = 902000 + (ch + 1) * 500;
- chans[ch].band = NL80211_BAND_S1GHZ;
- chans[ch].center_freq = KHZ_TO_MHZ(freq);
- chans[ch].freq_offset = freq % 1000;
- chans[ch].hw_value = ch + 1;
- }
-}
-
static const struct ieee80211_rate hwsim_rates[] = {
{ .bitrate = 10 },
{ .bitrate = 20, .flags = IEEE80211_RATE_SHORT_PREAMBLE },
@@ -7443,8 +7469,6 @@ static int __init init_mac80211_hwsim(void)
if (err)
goto out_exit_virtio;
- hwsim_init_s1g_channels(hwsim_channels_s1g);
-
for (i = 0; i < radios; i++) {
struct hwsim_new_radio_params param = { 0 };
--
2.43.0
^ permalink raw reply related
* [PATCH v2] wifi: mt76: mt7921: fix resource leak in probe error path
From: Hongling Zeng @ 2026-05-27 3:43 UTC (permalink / raw)
To: nbd, lorenzo, ryder.lee, shayne.chen, sean.wang, matthias.bgg,
angelogioacchino.delregno, xiong.huang, madhurkumar004
Cc: linux-wireless, linux-kernel, linux-arm-kernel, linux-mediatek,
zhongling0719, Hongling Zeng
When pcim_iomap_region() or devm_kmemdup() fail, the code returns
directly without cleaning up previously allocated resources:
- mt76_device allocated by mt76_alloc_device()
- pci irq vectors allocated by pci_alloc_irq_vectors()
Fix this by jumping to the existing error cleanup path instead of
returning directly.
To avoid using an uninitialized variable in the error path, move the
dev initialization before the error checks.
Fixes: 234738ea3390 ("phy: ti-pipe3: move clk initialization to a separate function")
Signed-off-by: Hongling Zeng <zenghongling@kylinos.cn>
---
Change in v1
--fix uninitialized variable warning
---
drivers/net/wireless/mediatek/mt76/mt7921/pci.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/pci.c b/drivers/net/wireless/mediatek/mt76/mt7921/pci.c
index 7a790ddf43bb..49a37185f056 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/pci.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/pci.c
@@ -343,11 +343,14 @@ static int mt7921_pci_probe(struct pci_dev *pdev,
pci_set_drvdata(pdev, mdev);
+ dev = container_of(mdev, struct mt792x_dev, mt76);
+
regs = pcim_iomap_region(pdev, 0, pci_name(pdev));
- if (IS_ERR(regs))
- return PTR_ERR(regs);
+ if (IS_ERR(regs)) {
+ ret = PTR_ERR(regs);
+ goto err_free_dev;
+ }
- dev = container_of(mdev, struct mt792x_dev, mt76);
dev->fw_features = features;
dev->hif_ops = &mt7921_pcie_ops;
dev->irq_map = &irq_map;
@@ -359,8 +362,10 @@ static int mt7921_pci_probe(struct pci_dev *pdev,
/* MT7902 needs a mutable copy because wm2_complete_mask differs */
map = devm_kmemdup(&pdev->dev, &irq_map,
sizeof(irq_map), GFP_KERNEL);
- if (!map)
- return -ENOMEM;
+ if (!map) {
+ ret = -ENOMEM;
+ goto err_free_dev;
+ }
map->rx.wm2_complete_mask = 0;
dev->irq_map = map;
--
2.25.1
^ permalink raw reply related
* Re: [PATCH 0/24] timekeeping/ptp: Expand snapshot functionality
From: Arthur Kiyanovski @ 2026-05-27 3: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: <20260526165826.392227559@kernel.org>
Tested with a locally rebased version of my PTP clock attributes series [1]
on top — verified ENA PHC and ptp_vmclock attrs ioctls on x86_64.
[1] https://lore.kernel.org/netdev/20260515164033.6403-1-akiyano@amazon.com/
Tested-by: Arthur Kiyanovski <akiyano@amazon.com>
^ permalink raw reply
* [PATCH rtw-next 1/5] wifi: rtw89: 8831bu: Add support for ELECOM WD{B,C}-X600DU2M-B
From: Zenm Chen @ 2026-05-27 4:40 UTC (permalink / raw)
To: linux-wireless, pkshih, rtl8821cerfe2; +Cc: zenmchen
Add the ids 056e:4027 and 056e:4028 into the device table to support
ELECOM WD{B,C}-X600DU2M-B, two new 8831bu-based adapters.
Compile tested only.
https://github.com/morrownr/rtw89/commit/9e2db2834b37c6adfc4b872a9ef56c927df22bea
Signed-off-by: Zenm Chen <zenmchen@gmail.com>
---
drivers/net/wireless/realtek/rtw89/rtw8851bu.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtw89/rtw8851bu.c b/drivers/net/wireless/realtek/rtw89/rtw8851bu.c
index 6a8d31544..343941ccb 100644
--- a/drivers/net/wireless/realtek/rtw89/rtw8851bu.c
+++ b/drivers/net/wireless/realtek/rtw89/rtw8851bu.c
@@ -37,6 +37,12 @@ static const struct rtw89_driver_info rtw89_8851bu_info = {
};
static const struct usb_device_id rtw_8851bu_id_table[] = {
+ /* ELECOM WDC-X600DU2M-B */
+ { USB_DEVICE_AND_INTERFACE_INFO(0x056e, 0x4027, 0xff, 0xff, 0xff),
+ .driver_info = (kernel_ulong_t)&rtw89_8851bu_info },
+ /* ELECOM WDB-X600DU2M-B */
+ { USB_DEVICE_AND_INTERFACE_INFO(0x056e, 0x4028, 0xff, 0xff, 0xff),
+ .driver_info = (kernel_ulong_t)&rtw89_8851bu_info },
{ USB_DEVICE_AND_INTERFACE_INFO(0x0bda, 0xb831, 0xff, 0xff, 0xff),
.driver_info = (kernel_ulong_t)&rtw89_8851bu_info },
{ USB_DEVICE_AND_INTERFACE_INFO(0x0bda, 0xb851, 0xff, 0xff, 0xff),
--
2.53.0
^ permalink raw reply related
* [PATCH rtw-next 2/5] wifi: rtw89: 8832au: Support two additional devices
From: Zenm Chen @ 2026-05-27 4:40 UTC (permalink / raw)
To: linux-wireless, pkshih, rtl8821cerfe2; +Cc: zenmchen
In-Reply-To: <20260527044019.9192-1-zenmchen@gmail.com>
Add two new ids into the device table to support the following 8832au-based
adapters:
- Mercusys MA72XH (2c4e:0124)
- TP-Link Archer TX23U (37ad:0102)
Compile tested only.
Link: https://github.com/morrownr/rtw89/commit/82b789a0f1f41e3148ecf302b4dd8f11d2d68713
Link: https://github.com/morrownr/rtw89/commit/f2e2a70eef253b4d3fc8906c99311dbc4d9f6aab
Signed-off-by: Zenm Chen <zenmchen@gmail.com>
---
drivers/net/wireless/realtek/rtw89/rtw8852au.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtw89/rtw8852au.c b/drivers/net/wireless/realtek/rtw89/rtw8852au.c
index 4cced4619..b3f2690cd 100644
--- a/drivers/net/wireless/realtek/rtw89/rtw8852au.c
+++ b/drivers/net/wireless/realtek/rtw89/rtw8852au.c
@@ -63,10 +63,14 @@ static const struct usb_device_id rtw_8852au_id_table[] = {
.driver_info = (kernel_ulong_t)&rtw89_8852au_info },
{ USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x0141, 0xff, 0xff, 0xff),
.driver_info = (kernel_ulong_t)&rtw89_8852au_info },
+ { USB_DEVICE_AND_INTERFACE_INFO(0x2c4e, 0x0124, 0xff, 0xff, 0xff),
+ .driver_info = (kernel_ulong_t)&rtw89_8852au_info },
{ USB_DEVICE_AND_INTERFACE_INFO(0x3625, 0x010d, 0xff, 0xff, 0xff),
.driver_info = (kernel_ulong_t)&rtw89_8852au_info },
{ USB_DEVICE_AND_INTERFACE_INFO(0x3625, 0x010f, 0xff, 0xff, 0xff),
.driver_info = (kernel_ulong_t)&rtw89_8852au_info },
+ { USB_DEVICE_AND_INTERFACE_INFO(0x37ad, 0x0102, 0xff, 0xff, 0xff),
+ .driver_info = (kernel_ulong_t)&rtw89_8852au_info },
{},
};
MODULE_DEVICE_TABLE(usb, rtw_8852au_id_table);
--
2.53.0
^ permalink raw reply related
* [PATCH rtw-next 3/5] wifi: rtw89: 8832bu: Add support for I-O DATA WN-DAX1200U
From: Zenm Chen @ 2026-05-27 4:40 UTC (permalink / raw)
To: linux-wireless, pkshih, rtl8821cerfe2; +Cc: zenmchen
In-Reply-To: <20260527044019.9192-1-zenmchen@gmail.com>
Add the id 04bb:095b into the device table to support I-O DATA WN-DAX1200U,
an 8832bu-based adapter.
Compile tested only.
https://github.com/morrownr/rtw89/commit/b22949056cfccf85a96540b2c0bd4d32e76cab0f
Signed-off-by: Zenm Chen <zenmchen@gmail.com>
---
drivers/net/wireless/realtek/rtw89/rtw8852bu.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtw89/rtw8852bu.c b/drivers/net/wireless/realtek/rtw89/rtw8852bu.c
index 37111fed2..35fdde1cf 100644
--- a/drivers/net/wireless/realtek/rtw89/rtw8852bu.c
+++ b/drivers/net/wireless/realtek/rtw89/rtw8852bu.c
@@ -37,6 +37,8 @@ static const struct rtw89_driver_info rtw89_8852bu_info = {
};
static const struct usb_device_id rtw_8852bu_id_table[] = {
+ { USB_DEVICE_AND_INTERFACE_INFO(0x04bb, 0x095b, 0xff, 0xff, 0xff),
+ .driver_info = (kernel_ulong_t)&rtw89_8852bu_info },
{ USB_DEVICE_AND_INTERFACE_INFO(0x0bda, 0xb832, 0xff, 0xff, 0xff),
.driver_info = (kernel_ulong_t)&rtw89_8852bu_info },
{ USB_DEVICE_AND_INTERFACE_INFO(0x0bda, 0xb83a, 0xff, 0xff, 0xff),
--
2.53.0
^ permalink raw reply related
* [PATCH rtw-next 4/5] wifi: rtw89: 8832cu: Add support for Mercusys MA86XH
From: Zenm Chen @ 2026-05-27 4:40 UTC (permalink / raw)
To: linux-wireless, pkshih, rtl8821cerfe2; +Cc: zenmchen
In-Reply-To: <20260527044019.9192-1-zenmchen@gmail.com>
Add the id 2c4e:0127 into the device table to support Mercusys MA86XH,
a new 8832cu-based adapter.
This also deletes the id 35b2:0502 which doesn't actaully exist and was
wrongly added into the driver.
Compile tested only.
https://github.com/morrownr/rtw89/commit/40149484a9db41a4146d2fb4980c92017c5f552c
https://github.com/morrownr/rtw89/commit/c82b4b42a93c2d189a11306701552d4732dc9fb0
Signed-off-by: Zenm Chen <zenmchen@gmail.com>
---
drivers/net/wireless/realtek/rtw89/rtw8852cu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw89/rtw8852cu.c b/drivers/net/wireless/realtek/rtw89/rtw8852cu.c
index 790fd1dec..2162dabbb 100644
--- a/drivers/net/wireless/realtek/rtw89/rtw8852cu.c
+++ b/drivers/net/wireless/realtek/rtw89/rtw8852cu.c
@@ -53,9 +53,9 @@ static const struct usb_device_id rtw_8852cu_id_table[] = {
.driver_info = (kernel_ulong_t)&rtw89_8852cu_info },
{ USB_DEVICE_AND_INTERFACE_INFO(0x28de, 0x2432, 0xff, 0xff, 0xff),
.driver_info = (kernel_ulong_t)&rtw89_8852cu_info },
- { USB_DEVICE_AND_INTERFACE_INFO(0x2c7c, 0x8206, 0xff, 0xff, 0xff),
+ { USB_DEVICE_AND_INTERFACE_INFO(0x2c4e, 0x0127, 0xff, 0xff, 0xff),
.driver_info = (kernel_ulong_t)&rtw89_8852cu_info },
- { USB_DEVICE_AND_INTERFACE_INFO(0x35b2, 0x0502, 0xff, 0xff, 0xff),
+ { USB_DEVICE_AND_INTERFACE_INFO(0x2c7c, 0x8206, 0xff, 0xff, 0xff),
.driver_info = (kernel_ulong_t)&rtw89_8852cu_info },
{ USB_DEVICE_AND_INTERFACE_INFO(0x35bc, 0x0101, 0xff, 0xff, 0xff),
.driver_info = (kernel_ulong_t)&rtw89_8852cu_info },
--
2.53.0
^ permalink raw reply related
* [PATCH rtw-next 5/5] wifi: rtw89: 8912au: Add support for Mercusys MA37BEH
From: Zenm Chen @ 2026-05-27 4:40 UTC (permalink / raw)
To: linux-wireless, pkshih, rtl8821cerfe2; +Cc: zenmchen
In-Reply-To: <20260527044019.9192-1-zenmchen@gmail.com>
Add the id 2c4e:0125 into the device table to support Mercusys MA37BEH,
a new 8912au-based adapter.
Compile tested only.
https://github.com/morrownr/rtw89/commit/73cd715afee2dda3f670cdae5e40fbeba7d9be36
Signed-off-by: Zenm Chen <zenmchen@gmail.com>
---
drivers/net/wireless/realtek/rtw89/rtw8922au.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtw89/rtw8922au.c b/drivers/net/wireless/realtek/rtw89/rtw8922au.c
index 347bde171..8d22bb387 100644
--- a/drivers/net/wireless/realtek/rtw89/rtw8922au.c
+++ b/drivers/net/wireless/realtek/rtw89/rtw8922au.c
@@ -56,6 +56,8 @@ static const struct usb_device_id rtw_8922au_id_table[] = {
.driver_info = (kernel_ulong_t)&rtw89_8922au_info },
{ USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x332b, 0xff, 0xff, 0xff),
.driver_info = (kernel_ulong_t)&rtw89_8922au_info },
+ { USB_DEVICE_AND_INTERFACE_INFO(0x2c4e, 0x0125, 0xff, 0xff, 0xff),
+ .driver_info = (kernel_ulong_t)&rtw89_8922au_info },
{ USB_DEVICE_AND_INTERFACE_INFO(0x3625, 0x010a, 0xff, 0xff, 0xff),
.driver_info = (kernel_ulong_t)&rtw89_8922au_info },
{ USB_DEVICE_AND_INTERFACE_INFO(0x37ad, 0x0100, 0xff, 0xff, 0xff),
--
2.53.0
^ permalink raw reply related
* Re: [PATCH v2] wifi: mt76: mt7921: fix resource leak in probe error path
From: Sean Wang @ 2026-05-27 4:48 UTC (permalink / raw)
To: Hongling Zeng
Cc: nbd, lorenzo, ryder.lee, shayne.chen, sean.wang, matthias.bgg,
angelogioacchino.delregno, xiong.huang, madhurkumar004,
linux-wireless, linux-kernel, linux-arm-kernel, linux-mediatek,
zhongling0719
In-Reply-To: <20260527034350.527482-1-zenghongling@kylinos.cn>
Hi,
On Tue, May 26, 2026 at 10:44 PM Hongling Zeng <zenghongling@kylinos.cn> wrote:
>
> When pcim_iomap_region() or devm_kmemdup() fail, the code returns
> directly without cleaning up previously allocated resources:
> - mt76_device allocated by mt76_alloc_device()
> - pci irq vectors allocated by pci_alloc_irq_vectors()
> Fix this by jumping to the existing error cleanup path instead of
> returning directly.
>
> To avoid using an uninitialized variable in the error path, move the
> dev initialization before the error checks.
>
> Fixes: 234738ea3390 ("phy: ti-pipe3: move clk initialization to a separate function")
> Signed-off-by: Hongling Zeng <zenghongling@kylinos.cn>
>
The code change itself looks correct, but commit message Fixes: tag is wrong.
It points to 234738ea3390 ("phy: ti-pipe3: move clk initialization to
a separate function"), which is unrelated to mt76/mt7921.
The two direct-return leaks appear to come from:
- ee5bb35d2b83 ("wifi: mt76: mt7921: Replace deprecated PCI
function") for the pcim_iomap_region() path.
- 222606f43b58 ("wifi: mt76: mt7921: handle MT7902 irq_map quirk
with mutable copy") for the MT7902 devm_kmemdup() path.
> ---
> Change in v1
> --fix uninitialized variable warning
> ---
> drivers/net/wireless/mediatek/mt76/mt7921/pci.c | 15 ++++++++++-----
> 1 file changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/pci.c b/drivers/net/wireless/mediatek/mt76/mt7921/pci.c
> index 7a790ddf43bb..49a37185f056 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7921/pci.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7921/pci.c
> @@ -343,11 +343,14 @@ static int mt7921_pci_probe(struct pci_dev *pdev,
>
> pci_set_drvdata(pdev, mdev);
>
> + dev = container_of(mdev, struct mt792x_dev, mt76);
> +
> regs = pcim_iomap_region(pdev, 0, pci_name(pdev));
> - if (IS_ERR(regs))
> - return PTR_ERR(regs);
> + if (IS_ERR(regs)) {
> + ret = PTR_ERR(regs);
> + goto err_free_dev;
> + }
>
> - dev = container_of(mdev, struct mt792x_dev, mt76);
> dev->fw_features = features;
> dev->hif_ops = &mt7921_pcie_ops;
> dev->irq_map = &irq_map;
> @@ -359,8 +362,10 @@ static int mt7921_pci_probe(struct pci_dev *pdev,
> /* MT7902 needs a mutable copy because wm2_complete_mask differs */
> map = devm_kmemdup(&pdev->dev, &irq_map,
> sizeof(irq_map), GFP_KERNEL);
> - if (!map)
> - return -ENOMEM;
> + if (!map) {
> + ret = -ENOMEM;
> + goto err_free_dev;
> + }
>
> map->rx.wm2_complete_mask = 0;
> dev->irq_map = map;
> --
> 2.25.1
>
>
^ permalink raw reply
* Re: [PATCH v2] wifi: mt76: mt7921: fix resource leak in probe error path
From: Hongling Zeng @ 2026-05-27 5:35 UTC (permalink / raw)
To: Sean Wang, Hongling Zeng
Cc: nbd, lorenzo, ryder.lee, shayne.chen, sean.wang, matthias.bgg,
angelogioacchino.delregno, xiong.huang, madhurkumar004,
linux-wireless, linux-kernel, linux-arm-kernel, linux-mediatek
In-Reply-To: <CAGp9LzruaD57tE5XHHAM8mKoPc-JQSAcaTdgvdSfESJjz-9XnA@mail.gmail.com>
Hi Sean,
Thanks for the review! You're absolutely right about the incorrect
Fixes: tag.
Here's v3 with the correct Fixes tags pointing to the actual commits that
introduced the resource leaks:
- ee5bb35d2b83 introduced the pcim_iomap_region() direct return
- 222606f43b58 introduced the devm_kmemdup() direct return
Thanks again for catching that.
Regards,
Hongling
在 2026年05月27日 12:48, Sean Wang 写道:
> Hi,
>
> On Tue, May 26, 2026 at 10:44 PM Hongling Zeng <zenghongling@kylinos.cn> wrote:
>> When pcim_iomap_region() or devm_kmemdup() fail, the code returns
>> directly without cleaning up previously allocated resources:
>> - mt76_device allocated by mt76_alloc_device()
>> - pci irq vectors allocated by pci_alloc_irq_vectors()
>> Fix this by jumping to the existing error cleanup path instead of
>> returning directly.
>>
>> To avoid using an uninitialized variable in the error path, move the
>> dev initialization before the error checks.
>>
>> Fixes: 234738ea3390 ("phy: ti-pipe3: move clk initialization to a separate function")
>> Signed-off-by: Hongling Zeng <zenghongling@kylinos.cn>
>>
> The code change itself looks correct, but commit message Fixes: tag is wrong.
>
> It points to 234738ea3390 ("phy: ti-pipe3: move clk initialization to
> a separate function"), which is unrelated to mt76/mt7921.
>
> The two direct-return leaks appear to come from:
> - ee5bb35d2b83 ("wifi: mt76: mt7921: Replace deprecated PCI
> function") for the pcim_iomap_region() path.
> - 222606f43b58 ("wifi: mt76: mt7921: handle MT7902 irq_map quirk
> with mutable copy") for the MT7902 devm_kmemdup() path.
>
>> ---
>> Change in v1
>> --fix uninitialized variable warning
>> ---
>> drivers/net/wireless/mediatek/mt76/mt7921/pci.c | 15 ++++++++++-----
>> 1 file changed, 10 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/pci.c b/drivers/net/wireless/mediatek/mt76/mt7921/pci.c
>> index 7a790ddf43bb..49a37185f056 100644
>> --- a/drivers/net/wireless/mediatek/mt76/mt7921/pci.c
>> +++ b/drivers/net/wireless/mediatek/mt76/mt7921/pci.c
>> @@ -343,11 +343,14 @@ static int mt7921_pci_probe(struct pci_dev *pdev,
>>
>> pci_set_drvdata(pdev, mdev);
>>
>> + dev = container_of(mdev, struct mt792x_dev, mt76);
>> +
>> regs = pcim_iomap_region(pdev, 0, pci_name(pdev));
>> - if (IS_ERR(regs))
>> - return PTR_ERR(regs);
>> + if (IS_ERR(regs)) {
>> + ret = PTR_ERR(regs);
>> + goto err_free_dev;
>> + }
>>
>> - dev = container_of(mdev, struct mt792x_dev, mt76);
>> dev->fw_features = features;
>> dev->hif_ops = &mt7921_pcie_ops;
>> dev->irq_map = &irq_map;
>> @@ -359,8 +362,10 @@ static int mt7921_pci_probe(struct pci_dev *pdev,
>> /* MT7902 needs a mutable copy because wm2_complete_mask differs */
>> map = devm_kmemdup(&pdev->dev, &irq_map,
>> sizeof(irq_map), GFP_KERNEL);
>> - if (!map)
>> - return -ENOMEM;
>> + if (!map) {
>> + ret = -ENOMEM;
>> + goto err_free_dev;
>> + }
>>
>> map->rx.wm2_complete_mask = 0;
>> dev->irq_map = map;
>> --
>> 2.25.1
>>
>>
^ permalink raw reply
* [PATCH v3] wifi: mt76: mt7921: fix resource leak in probe error path
From: Hongling Zeng @ 2026-05-27 5:35 UTC (permalink / raw)
To: nbd, lorenzo, ryder.lee, shayne.chen, sean.wang, matthias.bgg,
angelogioacchino.delregno, xiong.huang, madhurkumar004
Cc: linux-wireless, linux-kernel, linux-arm-kernel, linux-mediatek,
zhongling0719, Hongling Zeng
When pcim_iomap_region() or devm_kmemdup() fail, the code returns
directly without cleaning up previously allocated resources:
- mt76_device allocated by mt76_alloc_device()
- pci irq vectors allocated by pci_alloc_irq_vectors()
Fix this by jumping to the existing error cleanup path instead of
returning directly.
To avoid using an uninitialized variable in the error path, move the
dev initialization before the error checks.
Fixes: ee5bb35d2b83 ("wifi: mt76: mt7921: Replace deprecated PCI function")
Fixes: 222606f43b58 ("wifi: mt76: mt7921: handle MT7902 irq_map quirk with mutable copy")
Signed-off-by: Hongling Zeng <zenghongling@kylinos.cn>
---
Change in v3
- Fix incorrect Fixes: tag as pointed out by Sean
- Correct tag from unrelated phy/ti-pipe3 commit to the actual mt76 commit
that introduced the resource leak
---
drivers/net/wireless/mediatek/mt76/mt7921/pci.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/pci.c b/drivers/net/wireless/mediatek/mt76/mt7921/pci.c
index 7a790ddf43bb..49a37185f056 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/pci.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/pci.c
@@ -343,11 +343,14 @@ static int mt7921_pci_probe(struct pci_dev *pdev,
pci_set_drvdata(pdev, mdev);
+ dev = container_of(mdev, struct mt792x_dev, mt76);
+
regs = pcim_iomap_region(pdev, 0, pci_name(pdev));
- if (IS_ERR(regs))
- return PTR_ERR(regs);
+ if (IS_ERR(regs)) {
+ ret = PTR_ERR(regs);
+ goto err_free_dev;
+ }
- dev = container_of(mdev, struct mt792x_dev, mt76);
dev->fw_features = features;
dev->hif_ops = &mt7921_pcie_ops;
dev->irq_map = &irq_map;
@@ -359,8 +362,10 @@ static int mt7921_pci_probe(struct pci_dev *pdev,
/* MT7902 needs a mutable copy because wm2_complete_mask differs */
map = devm_kmemdup(&pdev->dev, &irq_map,
sizeof(irq_map), GFP_KERNEL);
- if (!map)
- return -ENOMEM;
+ if (!map) {
+ ret = -ENOMEM;
+ goto err_free_dev;
+ }
map->rx.wm2_complete_mask = 0;
dev->irq_map = map;
--
2.25.1
^ permalink raw reply related
* Re: [PATCH wireless-next] wifi: mt76: mt7925: add Netgear A8500 USB device ID
From: Sean Wang @ 2026-05-27 6:04 UTC (permalink / raw)
To: Lucid Duck
Cc: nbd, lorenzo.bianconi, sean.wang, linux-wireless, linux-mediatek,
morrownr, stable
In-Reply-To: <20260326190346.415226-1-lucid_duck@justthetip.ca>
Hi Devin,
On Thu, Mar 26, 2026 at 2:07 PM Lucid Duck <lucid_duck@justthetip.ca> wrote:
>
> Add USB device ID for the Netgear A8500 (0846:9050) which uses
> the mt7925 chipset.
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Lucid Duck <lucid_duck@justthetip.ca>
Sorry for the late reply.
I ran checkpatch.pl on the patch and got the following warning:
WARNING: The commit message has 'stable@', perhaps it also needs a 'Fixes:' tag?
Could you please send a v2 that drops the Cc: stable tag and uses:
Signed-off-by: Devin Wittmayer <lucid_duck@justthetip.ca>
to keep it consistent with the other patches you sent?
Thanks.
> ---
> drivers/net/wireless/mediatek/mt76/mt7925/usb.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/usb.c b/drivers/net/wireless/mediatek/mt76/mt7925/usb.c
> index d9968f038..e44f0cafd 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7925/usb.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7925/usb.c
> @@ -12,6 +12,9 @@
> static const struct usb_device_id mt7925u_device_table[] = {
> { USB_DEVICE_AND_INTERFACE_INFO(0x0e8d, 0x7925, 0xff, 0xff, 0xff),
> .driver_info = (kernel_ulong_t)MT7925_FIRMWARE_WM },
> + /* Netgear, Inc. A8500 */
> + { USB_DEVICE_AND_INTERFACE_INFO(0x0846, 0x9050, 0xff, 0xff, 0xff),
> + .driver_info = (kernel_ulong_t)MT7925_FIRMWARE_WM },
> /* Netgear, Inc. A9000 */
> { USB_DEVICE_AND_INTERFACE_INFO(0x0846, 0x9072, 0xff, 0xff, 0xff),
> .driver_info = (kernel_ulong_t)MT7925_FIRMWARE_WM },
> --
> 2.53.0
>
>
^ permalink raw reply
* Re: [patch 01/24] timekeeping: Provide ktime_get_snapshot_id()
From: Thomas Weißschuh @ 2026-05-27 6:56 UTC (permalink / raw)
To: Thomas Gleixner
Cc: LKML, David Woodhouse, Miroslav Lichvar, John Stultz,
Stephen Boyd, Anna-Maria Behnsen, Frederic Weisbecker,
Arthur Kiyanovski, Rodolfo Giometti, Vincent Donnefort,
Marc Zyngier, Oliver Upton, kvmarm, Oliver Upton, Richard Cochran,
netdev, Takashi Iwai, Miri Korenblit, Johannes Berg, Jacob Keller,
Tony Nguyen, Saeed Mahameed, Peter Hilber, Michael S. Tsirkin,
virtualization, linux-wireless, linux-sound
In-Reply-To: <20260526171222.769770418@kernel.org>
On Tue, May 26, 2026 at 07:13:33PM +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: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Plus some subjective nitpicks below.
> ---
> include/linux/timekeeping.h | 29 ++++++++++-----
> kernel/time/timekeeping.c | 84 +++++++++++++++++++++++++++++++++-----------
> 2 files changed, 84 insertions(+), 29 deletions(-)
>
> --- a/include/linux/timekeeping.h
> +++ b/include/linux/timekeeping.h
> @@ -276,24 +276,28 @@ static inline bool ktime_get_aux_ts64(cl
> #endif
>
> /**
> - * struct system_time_snapshot - simultaneous raw/real time capture with
> - * counter value
> - * @cycles: Clocksource counter value to produce the system times
> - * @real: Realtime system time
> - * @boot: Boot time
> - * @raw: Monotonic raw system time
> - * @cs_id: Clocksource ID
> + * struct system_time_snapshot - Simultaneous time capture of CLOCK_MONOTONIC_RAW,
> + * a selected CLOCK_* and the clocksource counter value
> + * @cycles: Clocksource counter value to produce the system times
> + * @sys: The system time of the selected CLOCK ID
> + * @real: Realtime system time
> + * @boot: Boot time
> + * @raw: Monotonic raw system time
> + * @cs_id: Clocksource ID
> * @clock_was_set_seq: The sequence number of clock-was-set events
> * @cs_was_changed_seq: The sequence number of clocksource change events
> + * @valid: True if the snapshot is valid
> */
> struct system_time_snapshot {
> u64 cycles;
> + ktime_t sys;
> ktime_t real;
> ktime_t boot;
> ktime_t raw;
> enum clocksource_ids cs_id;
> unsigned int clock_was_set_seq;
> u8 cs_was_changed_seq;
> + u8 valid;
> };
>
> /**
> @@ -341,9 +345,16 @@ extern int get_device_system_crosststamp
> struct system_device_crosststamp *xtstamp);
>
> /*
> - * Simultaneously snapshot realtime and monotonic raw clocks
> + * Simultaneously snapshot a given clock with MONOTONIC_RAW and the underlying
> + * clocksource counter value.
> */
> -extern void ktime_get_snapshot(struct system_time_snapshot *systime_snapshot);
> +extern bool ktime_get_snapshot_id(struct system_time_snapshot *systime_snapshot,
> + clockid_t clock_id);
None of the callers (except the wrapper below, which gets removed later) is
checking the return value. Having both the return value and the valid member
looks a bit weird, too.
Clockid parameter first for consistency?
> +
> +static inline void ktime_get_snapshot(struct system_time_snapshot *systime_snapshot)
> +{
> + WARN_ON_ONCE(!ktime_get_snapshot_id(systime_snapshot, CLOCK_REALTIME));
> +}
>
> /*
> * Persistent clock related interfaces
> --- a/kernel/time/timekeeping.c
> +++ b/kernel/time/timekeeping.c
> @@ -1183,43 +1183,87 @@ noinstr time64_t __ktime_get_real_second
> }
>
> /**
> - * ktime_get_snapshot - snapshots the realtime/monotonic raw clocks with counter
> - * @systime_snapshot: pointer to struct receiving the system time snapshot
> + * ktime_get_snapshot_id - Simultaneously snapshot a given clock ID with
> + * CLOCK_MONOTONIC_RAW and the underlying
> + * clocksource counter value.
> + * @systime_snapshot: Pointer to struct receiving the system time snapshot
> + * @clock_id: The clock ID to snapshot
> */
> -void ktime_get_snapshot(struct system_time_snapshot *systime_snapshot)
> +bool ktime_get_snapshot_id(struct system_time_snapshot *systime_snapshot, clockid_t clock_id)
> {
> - struct timekeeper *tk = &tk_core.timekeeper;
> + ktime_t base_raw, base_sys, offs_sys, *offs, offs_zero = 0;
> + u64 nsec_raw, nsec_sys, now;
> + struct timekeeper *tk;
> + struct tk_data *tkd;
This indirection only makes sense with the support for AUX clocks added later.
> unsigned int seq;
> - ktime_t base_raw;
> ktime_t base_real;
> ktime_t base_boot;
The ktime_t variable declarations are weird now.
> - u64 nsec_raw;
> - u64 nsec_real;
> - u64 now;
>
> - WARN_ON_ONCE(timekeeping_suspended);
> + /* Invalidate the snapshot for all failure cases */
> + systime_snapshot->valid = false;
> +
> + if (WARN_ON_ONCE(timekeeping_suspended))
> + return false;
> +
> + switch (clock_id) {
> + case CLOCK_REALTIME:
> + tkd = &tk_core;
> + offs = &tk_core.timekeeper.offs_real;
> + break;
> + /* Map RAW to MONOTONIC so the loop below is trivial */
> + case CLOCK_MONOTONIC_RAW:
> + case CLOCK_MONOTONIC:
> + tkd = &tk_core;
> + offs = &offs_zero;
> + break;
> + case CLOCK_BOOTTIME:
> + tkd = &tk_core;
> + offs = &tk_core.timekeeper.offs_boot;
> + break;
> + default:
> + WARN_ON_ONCE(1);
> + return false;
> + }
> +
> + tk = &tkd->timekeeper;
>
> do {
> - seq = read_seqcount_begin(&tk_core.seq);
> + seq = read_seqcount_begin(&tkd->seq);
> +
> now = tk_clock_read(&tk->tkr_mono);
> systime_snapshot->cs_id = tk->tkr_mono.clock->id;
> systime_snapshot->cs_was_changed_seq = tk->cs_was_changed_seq;
> systime_snapshot->clock_was_set_seq = tk->clock_was_set_seq;
> - base_real = ktime_add(tk->tkr_mono.base,
> - tk_core.timekeeper.offs_real);
> - base_boot = ktime_add(tk->tkr_mono.base,
> - tk_core.timekeeper.offs_boot);
> +
> + base_sys = tk->tkr_mono.base;
> + offs_sys = *offs;
> base_raw = tk->tkr_raw.base;
> - nsec_real = timekeeping_cycles_to_ns(&tk->tkr_mono, now);
> - nsec_raw = timekeeping_cycles_to_ns(&tk->tkr_raw, now);
> - } while (read_seqcount_retry(&tk_core.seq, seq));
> +
> + /* Kept around until the callers are fixed up */
> + base_real = ktime_add(base_sys, tk_core.timekeeper.offs_real);
> + base_boot = ktime_add(base_sys, tk_core.timekeeper.offs_boot);
> +
> + nsec_sys = timekeeping_cycles_to_ns(&tk->tkr_mono, now);
> + nsec_raw = timekeeping_cycles_to_ns(&tk->tkr_raw, now);
> + } while (read_seqcount_retry(&tkd->seq, seq));
>
> systime_snapshot->cycles = now;
> - systime_snapshot->real = ktime_add_ns(base_real, nsec_real);
> - systime_snapshot->boot = ktime_add_ns(base_boot, nsec_real);
> + systime_snapshot->sys = ktime_add_ns(base_sys, offs_sys + nsec_sys);
Technically offs_sys is ktime_t and not u64, so would need ktime_add().
(Not that it makes a difference)
> + systime_snapshot->real = ktime_add_ns(base_real, nsec_sys);
> + systime_snapshot->boot = ktime_add_ns(base_boot, nsec_sys);
> systime_snapshot->raw = ktime_add_ns(base_raw, nsec_raw);
> +
> + /*
> + * Special case for PTP. Just transfer the raw time into sys,
> + * so the call sites can consistently use snap::sys.
> + */
> + if (clock_id == CLOCK_MONOTONIC_RAW)
> + systime_snapshot->sys = systime_snapshot->raw;
> + /* Tell the consumer that this snapshot is valid */
> + systime_snapshot->valid = true;
> + return true;
> }
> -EXPORT_SYMBOL_GPL(ktime_get_snapshot);
> +EXPORT_SYMBOL_GPL(ktime_get_snapshot_id);
>
> /* Scale base by mult/div checking for overflow */
> static int scale64_check_overflow(u64 mult, u64 div, u64 *base)
>
^ permalink raw reply
* Re: [patch 02/24] timekeeping: Use system_time_snapshot::sys instead of ::real
From: Thomas Weißschuh @ 2026-05-27 6:58 UTC (permalink / raw)
To: Thomas Gleixner
Cc: LKML, David Woodhouse, Miroslav Lichvar, John Stultz,
Stephen Boyd, Anna-Maria Behnsen, Frederic Weisbecker,
Arthur Kiyanovski, Rodolfo Giometti, Vincent Donnefort,
Marc Zyngier, Oliver Upton, kvmarm, Oliver Upton, Richard Cochran,
netdev, Takashi Iwai, Miri Korenblit, Johannes Berg, Jacob Keller,
Tony Nguyen, Saeed Mahameed, Peter Hilber, Michael S. Tsirkin,
virtualization, linux-wireless, linux-sound
In-Reply-To: <20260526171222.846848261@kernel.org>
On Tue, May 26, 2026 at 07:13:38PM +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: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
^ permalink raw reply
* Re: [patch 03/24] pps: generators: Use ktime_get_real_ts64() instead of ktime_get_snapshot()
From: Thomas Weißschuh @ 2026-05-27 7:00 UTC (permalink / raw)
To: Thomas Gleixner
Cc: LKML, David Woodhouse, Miroslav Lichvar, John Stultz,
Stephen Boyd, Anna-Maria Behnsen, Frederic Weisbecker,
Arthur Kiyanovski, Rodolfo Giometti, Vincent Donnefort,
Marc Zyngier, Oliver Upton, kvmarm, Oliver Upton, Richard Cochran,
netdev, Takashi Iwai, Miri Korenblit, Johannes Berg, Jacob Keller,
Tony Nguyen, Saeed Mahameed, Peter Hilber, Michael S. Tsirkin,
virtualization, linux-wireless, linux-sound
In-Reply-To: <20260526171222.920736414@kernel.org>
On Tue, May 26, 2026 at 07:13:43PM +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>
> Cc: Rodolfo Giometti <giometti@enneenne.com>
Reviewed-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
These preparation commits could also go to the front of the series.
^ permalink raw reply
* Re: [patch 04/24] pps: Convert to ktime_get_snapshot_id()
From: Thomas Weißschuh @ 2026-05-27 7:02 UTC (permalink / raw)
To: Thomas Gleixner
Cc: LKML, David Woodhouse, Miroslav Lichvar, John Stultz,
Stephen Boyd, Anna-Maria Behnsen, Frederic Weisbecker,
Arthur Kiyanovski, Rodolfo Giometti, Vincent Donnefort,
Marc Zyngier, Oliver Upton, kvmarm, Oliver Upton, Richard Cochran,
netdev, Takashi Iwai, Miri Korenblit, Johannes Berg, Jacob Keller,
Tony Nguyen, Saeed Mahameed, Peter Hilber, Michael S. Tsirkin,
virtualization, linux-wireless, linux-sound
In-Reply-To: <20260526171222.995833811@kernel.org>
On Tue, May 26, 2026 at 07:13:48PM +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>
> Cc: Rodolfo Giometti <giometti@enneenne.com>
Reviewed-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> ---
> include/linux/pps_kernel.h | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> --- a/include/linux/pps_kernel.h
> +++ b/include/linux/pps_kernel.h
> @@ -99,12 +99,14 @@ static inline void timespec_to_pps_ktime
>
> static inline void pps_get_ts(struct pps_event_time *ts)
> {
> +#ifdef CONFIG_NTP_PPS
IS_ENABLED()?
> struct system_time_snapshot snap;
>
> - ktime_get_snapshot(&snap);
> - ts->ts_real = ktime_to_timespec64(snap.real);
> -#ifdef CONFIG_NTP_PPS
> + ktime_get_snapshot_id(&snap, CLOCK_REALTIME);
> + ts->ts_real = ktime_to_timespec64(snap.sys);
> ts->ts_raw = ktime_to_timespec64(snap.raw);
> +#else
> + ktime_get_real_ts64(&ts->ts_real);
> #endif
> }
>
>
^ permalink raw reply
* Re: [patch 05/24] KVM: arm64: Use ktime_get_snapshot_id() to retrieve CLOCK_BOOTTIME
From: Thomas Weißschuh @ 2026-05-27 7:02 UTC (permalink / raw)
To: Thomas Gleixner
Cc: LKML, David Woodhouse, Miroslav Lichvar, John Stultz,
Stephen Boyd, Anna-Maria Behnsen, Frederic Weisbecker,
Arthur Kiyanovski, Vincent Donnefort, Marc Zyngier, Oliver Upton,
kvmarm, Rodolfo Giometti, Oliver Upton, Richard Cochran, netdev,
Takashi Iwai, Miri Korenblit, Johannes Berg, Jacob Keller,
Tony Nguyen, Saeed Mahameed, Peter Hilber, Michael S. Tsirkin,
virtualization, linux-wireless, linux-sound
In-Reply-To: <20260526171223.070087856@kernel.org>
On Tue, May 26, 2026 at 07:13:53PM +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>
> Cc: Vincent Donnefort <vdonnefort@google.com>
> Cc: Marc Zyngier <maz@kernel.org>
> Cc: Oliver Upton <oliver.upton@linux.dev>
> Cc: kvmarm@lists.linux.dev
Reviewed-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
^ permalink raw reply
* Re: [patch 06/24] KVM: arm64: Use ktime_get_snapshot_id() to snapshot CLOCK_REALTIME
From: Thomas Weißschuh @ 2026-05-27 7:03 UTC (permalink / raw)
To: Thomas Gleixner
Cc: LKML, David Woodhouse, Miroslav Lichvar, John Stultz,
Stephen Boyd, Anna-Maria Behnsen, Frederic Weisbecker,
Arthur Kiyanovski, Marc Zyngier, Oliver Upton, kvmarm,
Rodolfo Giometti, Vincent Donnefort, Oliver Upton,
Richard Cochran, netdev, Takashi Iwai, Miri Korenblit,
Johannes Berg, Jacob Keller, Tony Nguyen, Saeed Mahameed,
Peter Hilber, Michael S. Tsirkin, virtualization, linux-wireless,
linux-sound
In-Reply-To: <20260526171223.144327185@kernel.org>
On Tue, May 26, 2026 at 07:13:58PM +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>
> Cc: Marc Zyngier <maz@kernel.org>
> Cc: Oliver Upton <oupton@kernel.org>
> Cc: kvmarm@lists.linux.dev
Reviewed-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
^ 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