Skip to content

Conversation

AgustinLorenzo
Copy link
Contributor

@AgustinLorenzo AgustinLorenzo commented Jul 20, 2025

Migrate wifi configuration (ath10k) device paths for 6.12 kernel
The device tree PCIe host node name has been changed in the new
6.12 kernel[1]. Hence we have to update the wifi device path to
make sure it can work properly.

This script is based on:
target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/05-wifi-migrate

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-6.12.y&id=07299ba2e7d98045e6b522f7c5b97f402b15bc82

FYI @robimarko @Ansuel

AgustinLorenzo referenced this pull request Jul 20, 2025
The device tree PCIe host node name has been changed in the new
6.12 kernel[1]. Hence we have to update the wifi device path to
make sure it can work properly.

This script is based on:
target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/05-wifi-migrate

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-6.12.y&id=07299ba2e7d98045e6b522f7c5b97f402b15bc82
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: #18725
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
@github-actions github-actions bot added the target/qualcommax pull request/issue for qualcommax target label Jul 20, 2025
@AgustinLorenzo AgustinLorenzo marked this pull request as draft July 27, 2025 01:37
@AgustinLorenzo
Copy link
Contributor Author

Please do not merge this PR. Tomorrow I will try to combine the 6.6 script for both kernel versions.

@Djfe
Copy link
Contributor

Djfe commented Jul 27, 2025

you can always mark PRs as drafts if you don't want them to be merged, yet

@qosmio
Copy link
Contributor

qosmio commented Jul 29, 2025

Would this be better as just updating 05-wifi-migrate?

--- a/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/05-wifi-migrate
+++ b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/05-wifi-migrate
@@ -30,10 +30,14 @@ check_path()

        to=${path/soc\//soc@0\/}
+       to=${to/pci\//pcie\/}

        # Checks if kernel version is less than 6.6.0, if it is and the path is using the new format,
        # then path should be migrated to the old format. This would allow users on platforms with two partitions,
        # to test 6.1 and 6.6.
-       [ "$(get_linux_version)" -lt "606000" ] && to=${path/soc@0\//soc\/}
+       [ "$(get_linux_version)" -lt "606000" ] && to=${to/soc@0\//soc\/}
+
+       [ "$(get_linux_version)" -lt "612000" ] && to=${to/pcie\//pci\/}

        [ "$path" = "$to" ] || do_migrate_radio "$config" "$path" "$to"
 }

@AgustinLorenzo
Copy link
Contributor Author

Would this be better as just updating 05-wifi-migrate?

--- a/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/05-wifi-migrate
+++ b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/05-wifi-migrate
@@ -30,10 +30,14 @@ check_path()

        to=${path/soc\//soc@0\/}
+       to=${to/pci\//pcie\/}

        # Checks if kernel version is less than 6.6.0, if it is and the path is using the new format,
        # then path should be migrated to the old format. This would allow users on platforms with two partitions,
        # to test 6.1 and 6.6.
-       [ "$(get_linux_version)" -lt "606000" ] && to=${path/soc@0\//soc\/}
+       [ "$(get_linux_version)" -lt "606000" ] && to=${to/soc@0\//soc\/}
+
+       [ "$(get_linux_version)" -lt "612000" ] && to=${to/pcie\//pci\/}

        [ "$path" = "$to" ] || do_migrate_radio "$config" "$path" "$to"
 }

Hi @qosmio

Would also be a solution, do you prefer to modify my PR and give credit to yourself or open a new PR?

Regards, Agustin

@qosmio
Copy link
Contributor

qosmio commented Jul 30, 2025

Not sure how to modify and push to the same PR. But you're welcome to just change it too.

@AgustinLorenzo
Copy link
Contributor Author

AgustinLorenzo commented Jul 31, 2025

Not sure how to modify and push to the same PR. But you're welcome to just change it too.

Hi @qosmio,

Okay, I do it and give you credit for the change :)

I am also seeing with the change to kernel 6.12 that the router leds stay on even though the ports are not linked.

Today I will compile again and include this patch and see if everything is working correctly.

Regards, Agustin

@AgustinLorenzo AgustinLorenzo force-pushed the main_fix_ath10k_612 branch 2 times, most recently from ddbe7f9 to 8c63b91 Compare July 31, 2025 21:02
@AgustinLorenzo AgustinLorenzo marked this pull request as ready for review July 31, 2025 21:02
@AgustinLorenzo
Copy link
Contributor Author

Hi @qosmio,

I've applied your changes, I'm going to compile to see how it looks :)

@AgustinLorenzo
Copy link
Contributor Author

The change proposed by @qosmio works correctly, and the LED failure was also corrected in the upstream in this commit: 1de1df1

Link to the build: https://github.com/AgustinLorenzo/openwrt/releases/tag/ipq807x-nsswifi-2025-08-01-0156

@robimarko
Copy link
Contributor

Not sure how to modify and push to the same PR. But you're welcome to just change it too.

Hi @qosmio,

Okay, I do it and give you credit for the change :)

I am also seeing with the change to kernel 6.12 that the router leds stay on even though the ports are not linked.

Today I will compile again and include this patch and see if everything is working correctly.

Regards, Agustin

This was fixed via:
1de1df1

@AgustinLorenzo
Copy link
Contributor Author

I just put it in the comment above, @robimarko can you approve the change?


# Checks if kernel version is less than 6.6.0, if it is and the path is using the new format,
# then path should be migrated to the old format. This would allow users on platforms with two partitions,
# to test 6.1 and 6.6.
[ "$(get_linux_version)" -lt "606000" ] && to=${path/soc@0\//soc\/}
[ "$(get_linux_version)" -lt "606000" ] && to=${to/soc@0\//soc\/}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has this been tested on a device?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@robimarko

Migrating a kernel 6.1 config on 6.12

$ cp /etc/config/wireless /etc/config/wireless.old
$ ACTION=add sh /etc/hotplug.d/ieee80211/05-wifi-migrate
--- a/etc/config/wireless.old
+++ b/etc/config/wireless
@@ -1,7 +1,7 @@

 config wifi-device '5g_l'
        option type 'mac80211'
-       option path 'platform/soc/c000000.wifi'
+       option path 'platform/soc@0/c000000.wifi'
        option band '5g'
        option txpower '18'
        option country 'US'
@@ -13,7 +13,7 @@ config wifi-device '5g_l'

 config wifi-device '2g'
        option type 'mac80211'
-       option path 'platform/soc/c000000.wifi+1'
+       option path 'platform/soc@0/c000000.wifi+1'
        option band '2g'
        option txpower '15'
        option country 'US'
@@ -24,7 +24,7 @@ config wifi-device '2g'

 config wifi-device '5g_h'
        option type 'mac80211'
-       option path 'soc/10000000.pci/pci0001:00/0001:00:00.0/0001:01:00.0'
+       option path 'soc@0/10000000.pcie/pci0001:00/0001:00:00.0/0001:01:00.0'
        option band '5g'
        option txpower '30'
        option country 'US'

Coaxing kernel version to 6.6

--- a/rom/lib/functions/system.sh
+++ b/lib/functions/system.sh
@@ -318,6 +318,7 @@ dt_is_enabled() {

 get_linux_version() {
        local ver=$(uname -r)
+       ver=6.6.100
        local minor=${ver%\.*}

        printf "%d%02d%03d" ${ver%%\.*} ${minor#*\.} ${ver##*\.} 2>/dev/null
--- a/etc/config/wireless.old
+++ b/etc/config/wireless
@@ -1,7 +1,7 @@

 config wifi-device '5g_l'
        option type 'mac80211'
-       option path 'platform/soc/c000000.wifi'
+       option path 'platform/soc@0/c000000.wifi'
        option band '5g'
        option txpower '18'
        option country 'US'
@@ -13,7 +13,7 @@ config wifi-device '5g_l'

 config wifi-device '2g'
        option type 'mac80211'
-       option path 'platform/soc/c000000.wifi+1'
+       option path 'platform/soc@0/c000000.wifi+1'
        option band '2g'
        option txpower '15'
        option country 'US'
@@ -24,7 +24,7 @@ config wifi-device '2g'

 config wifi-device '5g_h'
        option type 'mac80211'
-       option path 'soc/10000000.pci/pci0001:00/0001:00:00.0/0001:01:00.0'
+       option path 'soc@0/10000000.pci/pci0001:00/0001:00:00.0/0001:01:00.0'
        option band '5g'
        option txpower '30'
        option country 'US'

Kernel 6.1

--- a/rom/lib/functions/system.sh
+++ b/lib/functions/system.sh
@@ -318,6 +318,7 @@ dt_is_enabled() {

 get_linux_version() {
        local ver=$(uname -r)
+       ver=6.1.100
        local minor=${ver%\.*}

        printf "%d%02d%03d" ${ver%%\.*} ${minor#*\.} ${ver##*\.} 2>/dev/null

Reverts back to 6.1 config

➤ ACTION=add sh /etc/hotplug.d/ieee80211/05-wifi-migrate
➤ sha /etc/config/wireless.old /etc/config/wireless
bca7dd3e742b518acb1da2340f7362bac39613bbe5c56aa3e0d608e0069e5d0d  /etc/config/wireless.old
bca7dd3e742b518acb1da2340f7362bac39613bbe5c56aa3e0d608e0069e5d0d  /etc/config/wireless

@AgustinLorenzo
Copy link
Contributor Author

@robimarko any news from that?

@nbd168
Copy link
Member

nbd168 commented Aug 9, 2025

If you're doing a migration anyway, please migrate to phy names, as done on the mediatek mt7622.
See https://github.com/openwrt/openwrt/blob/main/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network#L42
That way if the path ever changes again, user configurations won't need another migration.

When this is set up properly, phys are automatically renamed to wl0, wl1, ... based on the path in board.json, and those names remain stable, since board.json can change across updates.

@AgustinLorenzo
Copy link
Contributor Author

Hi @nbd168 and @robimarko

It could be an option but I think it would be better right now to approve this PR to correct this problem that happens after the migration to 6.12 (which has already been done in other devices) and for the future to do the PR to migrate it as you said.

Regards

@AgustinLorenzo
Copy link
Contributor Author

@robimarko any news from that? It's a small change for fix an issue with the migration to 6.12

… kernel

The device tree PCIe host node name has been changed in the new
6.12 kernel[1]. Hence we have to update the wifi device path to
make sure it can work properly.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-6.12.y&id=07299ba2e7d98045e6b522f7c5b97f402b15bc82

Signed-off-by: Agustin Lorenzo <agustin.lorenzo@thinco.es>
Signed-off-by: Sean Khan <datapronix@protonmail.com>
Link: openwrt#19479
Signed-off-by: Robert Marko <robimarko@gmail.com>
@robimarko robimarko force-pushed the main_fix_ath10k_612 branch from f4ed230 to 21059cb Compare August 27, 2025 07:50
@openwrt-bot openwrt-bot merged commit 21059cb into openwrt:main Aug 27, 2025
2 checks passed
@robimarko
Copy link
Contributor

Thanks! Rebased on top of main and merged!

Vladdrako pushed a commit to Vladdrako/openwrt that referenced this pull request Aug 27, 2025
… kernel

The device tree PCIe host node name has been changed in the new
6.12 kernel[1]. Hence we have to update the wifi device path to
make sure it can work properly.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-6.12.y&id=07299ba2e7d98045e6b522f7c5b97f402b15bc82

Signed-off-by: Agustin Lorenzo <agustin.lorenzo@thinco.es>
Signed-off-by: Sean Khan <datapronix@protonmail.com>
Link: openwrt#19479
Signed-off-by: Robert Marko <robimarko@gmail.com>
Lienol pushed a commit to Lienol/openwrt that referenced this pull request Aug 27, 2025
… kernel

The device tree PCIe host node name has been changed in the new
6.12 kernel[1]. Hence we have to update the wifi device path to
make sure it can work properly.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-6.12.y&id=07299ba2e7d98045e6b522f7c5b97f402b15bc82

Signed-off-by: Agustin Lorenzo <agustin.lorenzo@thinco.es>
Signed-off-by: Sean Khan <datapronix@protonmail.com>
Link: openwrt/openwrt#19479
Signed-off-by: Robert Marko <robimarko@gmail.com>
@AgustinLorenzo AgustinLorenzo deleted the main_fix_ath10k_612 branch August 31, 2025 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
target/qualcommax pull request/issue for qualcommax target
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants