Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qualcommax: add 6.6 testing kernel #14844

Merged
9 commits merged into from Mar 22, 2024
Merged

qualcommax: add 6.6 testing kernel #14844

9 commits merged into from Mar 22, 2024

Conversation

robimarko
Copy link
Contributor

6.6 testing kernel support for qualcommax is based of PR #14751.

I only tested this on a couple of ipq807x boards, ipq60xx is untested.

Do note that there is a WLAN device path change happening in 6.6 and so I added a migration for it, however I still need to collect and then add migrations for devices that use additional PCIe cards.
I would appreciate if people having those boards can post their current device paths from /etc/config/wireless

@github-actions github-actions bot added build/scripts/tools pull request/issues for build, scripts and tools related changes kernel pull request/issue with Linux kernel related changes core packages pull request/issue for core (in-tree) packages target/qualcommax pull request/issue for qualcommax target labels Mar 10, 2024
@robimarko robimarko added the ci:kernel:ipq807x:generic:testing Triggers CI kernel test jobs for ipq807x/generic target testing kernel label Mar 10, 2024
@mrkiko
Copy link
Contributor

mrkiko commented Mar 10, 2024

Great work, thank you a lot!!
I have only nbg7815 - so I don't think it has PCI device. Incase I'm wrong, let me know.

@testuser7
Copy link
Contributor

QCA9984 on Linksys MX5300: soc@0/10000000.pci/pci0001:00/0001:00:00.0/0001:01:00.0

@robimarko robimarko force-pushed the qualcommax-6.6 branch 2 times, most recently from 35554d9 to d71ea99 Compare March 11, 2024 19:20
@robimarko robimarko removed the ci:kernel:ipq807x:generic:testing Triggers CI kernel test jobs for ipq807x/generic target testing kernel label Mar 11, 2024
@github-actions github-actions bot removed the build/scripts/tools pull request/issues for build, scripts and tools related changes label Mar 11, 2024
@map-b
Copy link

map-b commented Mar 11, 2024

QCA9887 on Xiaomi AX3600:

config wifi-device 'radio0'
        option type 'mac80211'
        option path 'soc/20000000.pci/pci0000:00/0000:00:00.0/0000:01:00.0'

@mantas-p
Copy link
Contributor

When building with CONFIG_KERNEL_PERF_EVENTS following symbols are missing:

ARM_SMMU_V3_PMU
ARM_CORESIGHT_PMU_ARCH_SYSTEM_PMU

Otherwise seems to boot/init OK on ipq60xx, though I haven't checked the network performance.

@robimarko robimarko force-pushed the qualcommax-6.6 branch 2 times, most recently from fbd3df4 to 457ea9d Compare March 12, 2024 20:05
@breeze303
Copy link

Uploading C3648DD3DC87386C0B2A54E434C527A5.png…
Added redmi ax5 and verified that it can start normally

@McGiverGim
Copy link

Tested in a Xiaomi AX3600 used as AP in a MESH and all seems to be working... I will report back if I see some problem.

@robimarko robimarko changed the title [RFT, RFC] qualcommax: add 6.6 testing kernel qualcommax: add 6.6 testing kernel Mar 14, 2024
@robimarko
Copy link
Contributor Author

This is basically done, but I need to make the path conversion script depend on 6.6 kernel only for now.

@testuser7
Copy link
Contributor

I have this stack trace when sysupgrading on kernel 6.6:

Thu Jan  1 04:21:43 UTC 1970 upgrade: Commencing upgrade. Closing all shell sessions.
Watchdog handover: fd=3
- watchdog -
[15703.661691] ath11k_pci 0000:01:00.0 phy2-ap0: left allmulticast mode
[15703.663271] ath11k_pci 0000:01:00.0 phy2-ap0: left promiscuous mode
[15703.669709] br-lan: port 5(phy2-ap0) entered disabled state
Watchdog did not previously reset the system
Thu Jan  1 04:21:43 UTC 1970 upgrade: Sending TERM to remaining processes ...
Thu Jan  1 04:21:43 UTC 1970 upgrade: Sending signal TERM to hostapd (2039)
Thu Jan  1 04:21:43 UTC 1970 upgrade: Sending signal TERM to hostapd (2088)
Thu Jan  1 04:21:43 UTC 1970 upgrade: Sending signal TERM to netifd (2104)
Thu Jan  1 04:21:47 UTC 1970 upgrade: Sending KILL to remaining processes ...
Thu Jan  1 04:21:47 UTC 1970 upgrade: Sending signal KILL to netifd (2104)
[15716.036911] stage2 (3917): drop_caches: 3
Thu Jan  1 04:21:56 UTC 1970 upgrade: Switching to ramdisk...
Thu Jan  1 04:21:57 UTC 1970 upgrade: Performing system upgrade...
verifying sysupgrade tar file integrity
Unlocking kernel ...

Writing from <stdin> to kernel ...     
[15717.786260] ubi0: attaching mtd22
[15718.616517] ubi0: scanning is finished
[15718.624670] ubi0: attached mtd22 (name "rootfs", size 144 MiB)
[15718.624710] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[15718.629404] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[15718.636288] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[15718.643127] ubi0: good PEBs: 1152, bad PEBs: 0, corrupted PEBs: 0
[15718.649888] ubi0: user volume: 2, internal volumes: 1, max. volumes count: 128
[15718.656147] ubi0: max/mean erase counter: 3/1, WL threshold: 4096, image sequence number: 1710027810
[15718.663275] ubi0: available PEBs: 0, total reserved PEBs: 1152, PEBs reserved for bad PEB handling: 80
[15718.672564] ubi0: background thread "ubi_bgt0d" started, PID 4736
[15718.673387] block ubiblock0_0: created from ubi0:0(rootfs)
UBI device number 0, total 1152 LEBs (146276352 bytes, 139.5 MiB), available 0 LEBs (0 bytes), LEB size 126976 bytes (124.0 KiB)
[15718.754786] ------------[ cut here ]------------
[15718.754818] sysfs group 'power' not found for kobject 'ubiblock0_0'
[15718.758503] WARNING: CPU: 0 PID: 4767 at fs/sysfs/group.c:282 sysfs_remove_group+0x94/0xa0
[15718.764464] Modules linked in: pppoe ppp_async nft_fib_inet nf_flow_table_inet ath11k_pci(O) ath11k_ahb(O) ath11k(O) pppox ppp_generic nft_reject_ipv6 nft_reject_ipv4 nft_reject_inet nft_reject nft_redir nft_quota nft_numgen nft_nat nft_masq nft_log nft_limit nft_hash nft_flow_offload nft_fib_ipv6 nft_fib_ipv4 nft_fib nft_ct nft_chain_nat nf_tables nf_nat nf_flow_table nf_conntrack mac80211(O) cfg80211(O) slhc rfcomm qrtr_smd qrtr_mhi qrtr qmi_helpers(O) nfnetlink nf_reject_ipv6 nf_reject_ipv4 nf_log_syslog nf_defrag_ipv6 nf_defrag_ipv4 mhi libcrc32c hidp hci_uart compat(O) btusb btrtl btmtk btintel bnep bluetooth hid evdev input_core rfkill ecdh_generic ecc sha512_generic sha512_arm64 seqiv sha3_generic jitterentropy_rng drbg michael_mic kpp hmac geniv cmac leds_pca963x leds_gpio xhci_plat_hcd xhci_pci xhci_hcd dwc3 dwc3_qcom qca_nss_dp(O) qca_ssdk(O) gpio_button_hotplug(O) ext4 mbcache jbd2 aquantia hwmon crc_ccitt crc32c_generic
[15718.833111] CPU: 0 PID: 4767 Comm: ubirmvol Tainted: G           O       6.6.20 #0
[15718.855348] Hardware name: Linksys MX8500 (DT)
[15718.862808] pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[15718.867240] pc : sysfs_remove_group+0x94/0xa0
[15718.874092] lr : sysfs_remove_group+0x94/0xa0
[15718.878606] sp : ffffffc092b23950
[15718.882945] x29: ffffffc092b23950 x28: ffffff8003f1bc00 x27: ffffff8005d0e730
[15718.886249] x26: 0000000000000048 x25: ffffff80175d5800 x24: 0000000000000000
[15718.893369] x23: ffffffc081538000 x22: ffffffc081538a98 x21: ffffff80067f3cc8
[15718.900485] x20: ffffffc08083bec8 x19: 0000000000000000 x18: 000000000000017d
[15718.907604] x17: ffffffc092b23780 x16: ffffff8003970080 x15: ffffffc081546d20
[15718.914722] x14: 0000000000000477 x13: 000000000000017d x12: 00000000ffffffea
[15718.921841] x11: 00000000ffffefff x10: ffffffc08159ed20 x9 : ffffffc081546cc8
[15718.928958] x8 : 0000000000017fe8 x7 : c0000000ffffefff x6 : 0000000000057fa8
[15718.936076] x5 : 0000000000000fff x4 : 0000000000000000 x3 : ffffffc092b23750
[15718.943195] x2 : ffffffc081546c60 x1 : ffffffc081546c60 x0 : 0000000000000037
[15718.950313] Call trace:
[15718.957421]  sysfs_remove_group+0x94/0xa0
[15718.959682]  dpm_sysfs_remove+0x5c/0x6c
[15718.963847]  device_del+0x9c/0x420
[15718.967493]  del_gendisk+0x1d4/0x334
[15718.970966]  ubiblock_remove+0xb4/0x150
[15718.974699]  ubiblock_notify+0x5c/0x28c
[15718.978258]  blocking_notifier_call_chain+0x6c/0xa0
[15718.982079]  ubi_volume_notify+0x4c/0x60
[15718.986938]  ubi_remove_volume+0x218/0x340
[15718.991105]  ubi_cdev_ioctl+0x248/0xb84
[15718.995010]  __arm64_sys_ioctl+0x4f4/0xe84
[15718.998744]  invoke_syscall.constprop.0+0x5c/0x104
[15719.002912]  do_el0_svc+0x40/0xc8
[15719.007683]  el0_svc+0x30/0xbc
[15719.011068]  el0t_64_sync_handler+0x100/0x12c
[15719.014022]  el0t_64_sync+0x178/0x17c
[15719.018449] ---[ end trace 0000000000000000 ]---
[15719.022740] block ubiblock0_0: released
[15719.223535] block ubiblock0_0: created from ubi0:0(rootfs)
Volume ID 0, size 75 LEBs (9523200 bytes, 9.0 MiB), LEB size 126976 bytes (124.0 KiB), dynamic, name "rootfs", alignment 1
Set volume size to 126087168
Volume ID 1, size 993 LEBs (126087168 bytes, 120.2 MiB), LEB size 126976 bytes (124.0 KiB), dynamic, name "rootfs_data", alignment 1
Unlocking kernel ...

Writing from <stdin> to kernel ...     
sysupgrade successful
umount: can't unmount /dev: Resource busy
umount: can't unmount /tmp: Resource busy
[15723.907553] remoteproc remoteproc0: stopped remote processor cd00000.q6v5_wcss
[15724.462588] reboot: Restarting system

@robimarko
Copy link
Contributor Author

What is the exact device?

Hopefully it happens on anything using UBI so its easily reproducible

@testuser7
Copy link
Contributor

testuser7 commented Mar 15, 2024

What is the exact device?

Linksys MX8500. There is hardware name in logs.

@qosmio
Copy link

qosmio commented Mar 15, 2024

This is basically done, but I need to make the path conversion script depend on 6.6 kernel only for now.

Not sure if there's any interest. I'm currently testing both 6.1 and 6.6 in a dual partition setup. I modified the 05-migrate-wifi script to be able to switch back and forth as needed.

#!/bin/sh

# This must run before 10-wifi-detect

[ "${ACTION}" = "add" ] || return

. /lib/functions.sh

check_kernel()
{
	local kernel_current=$(ubus call system board|jsonfilter -q -e '@.kernel')
	if [ ${kernel_current//./} -lt "6600" ]; then
	  return 1
	fi
}

do_migrate_radio()
{
	local cfg="$1" from="$2" to="$3"

	config_get path "$cfg" path

	[ "$path" = "$from" ] || return

	uci set "wireless.${cfg}.path=${to}"
	WIRELESS_CHANGED=true

	logger -t wifi-migrate "Updated path of wireless.${cfg} from '${from}' to '${to}'"
}

check_path()
{
	local config
	config="$1"

	config_get path "$config" path

	to=${path/soc\//soc@0\/}

	# 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.
	check_kernel || to=${path/soc@0\//soc\/}

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

migrate_radio()
{
	config_load wireless

	# Check if there is already a section with the target path: In this case, the system
	# was already upgraded to a version without this migration script before; better bail out,
	# as we can't be sure we don't break more than we fix.
	config_foreach check_path wifi-device
}

WIRELESS_CHANGED=false

case "$(board_name)" in
*)

	migrate_radio
    ;;

esac

$WIRELESS_CHANGED && uci commit wireless

exit 0

BTW, using this PR successfully on dynalink dl-wrx36 on NSS build. With very few patch changes. Excellent work!

Copy link
Contributor

@ehem ehem left a comment

Choose a reason for hiding this comment

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

There are history-preserving scripts for this, those should be used instead of manually copying.

Copy link
Contributor

@ehem ehem left a comment

Choose a reason for hiding this comment

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

There are history-preserving scripts which should be used for this instead.

@yyyzz123
Copy link

yyyzz123 commented Mar 16, 2024

It seems need to add "swiotlb=1" to bootargs-append, otherwise Linux 6.6 will pre-allocate 64M of memory, causing a memory drop. Adding this will only allocate 1M of memory (from 450 to 460m available to 500 to 510m available)
"swiotlb=1" I found it from qsdk ipq6018'dts, I don't know if there is a better value.
At the same time, Linux 6.6 also adds a CONFIG_SWIOTLB_DYNAMIC, which seems to be able to dynamically allocate swiotlb.
I tested on ax9000 and there is no problem with this configuration.

@robimarko
Copy link
Contributor Author

@qosmio Now, that is awesome approach you have as we dont need to know the paths in advance.
Can you give me your Co-developed-by so I can credit you?

@robimarko
Copy link
Contributor Author

There are history-preserving scripts which should be used for this instead.

Yes, I plan to redo the copy/paste steps to preserve history

@qosmio
Copy link

qosmio commented Mar 17, 2024

@qosmio Now, that is awesome approach you have as we dont need to know the paths in advance. Can you give me your Co-developed-by so I can credit you?

Sure thing!

Co-developed-by: Sean Khan <datapronix@protonmail.com>

@breeze303
Copy link

Test results for IPQ6018: Redmi AX5, after adding WLAN, it can be used normally without the need to add WLAN conversion like ipq807x. However, this device 360v6 occasionally reboots

@robimarko robimarko force-pushed the qualcommax-6.6 branch 4 times, most recently from 3df531b to 94c2e88 Compare March 22, 2024 10:39
@robimarko
Copy link
Contributor Author

So this has been reworked to preserve patch and config history, end result should be the same but some further testing would be greatly appreciated.

I plan to merge this is testing shows its fine, we can always fix it up.

@McGiverGim
Copy link

Installed on one AX3600 acting as an AP in a MESH network. All seems to be working.

This is an automatically generated commit.

When doing `git bisect`, consider `git bisect --skip`.

Signed-off-by: Robert Marko <robimarko@gmail.com>
This is an automatically generated commit which aids following Kernel patch history,
as git will see the move and copy as a rename thus defeating the purpose.

See: https://lists.openwrt.org/pipermail/openwrt-devel/2023-October/041673.html
for the original discussion.

Signed-off-by: Robert Marko <robimarko@gmail.com>
Drop backported patches already included in 6.6 and refresh the rest to
apply.

Signed-off-by: Robert Marko <robimarko@gmail.com>
Refresh 6.6 qualcommax kernel config via kernel_menuconfig.

Signed-off-by: Robert Marko <robimarko@gmail.com>
SCM header was moved to <linux/firmware/qcom/qcom_scm.h> so adjust the
WCSS patch accordingly.

Signed-off-by: Robert Marko <robimarko@gmail.com>
Add a patch that makes SSDK recognize kernel 6.6 and thus allows
compiling against it.

Signed-off-by: Robert Marko <robimarko@gmail.com>
Since 6.5 netdev_rx_queue was moved out of netdevice.h so include the new
header since that is where it lives now.

Signed-off-by: Robert Marko <robimarko@gmail.com>
Kernel 6.6 has changed the path of WLAN devices as the soc node was updated
to include an adress as well because according to spec it needed one:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/arch/arm64/boot/dts/qcom/ipq8074.dtsi?h=v6.6.21&id=da6aa1111a17db11367817ddc10c5a6c188cdc44

So, this will break existing configuration as device path was changed for
example:
"platform/soc/c000000.wifi" to "platform/soc@0/c000000.wifi"
"platform/soc/c000000.wifi+1" to "platform/soc@0/c000000.wifi+1"

PCIe attached devices also have their path changed, so lets add a script
that will migrate the paths based on the detected running kernel version
so returning to kernel 6.1 will work as well.

Co-developed-by: Sean Khan <datapronix@protonmail.com>
Signed-off-by: Robert Marko <robimarko@gmail.com>
Provide kernel 6.6 as the testing kernel for qualcommax.

Signed-off-by: Robert Marko <robimarko@gmail.com>
@openwrt-bot openwrt-bot closed this pull request by merging all changes into openwrt:main in 36acf88 Mar 22, 2024
@robimarko
Copy link
Contributor Author

Thanks! Rebased on top of main and merged!

@robimarko robimarko deleted the qualcommax-6.6 branch March 29, 2024 10:32
@namiltd namiltd mentioned this pull request Apr 17, 2024
39 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core packages pull request/issue for core (in-tree) packages kernel pull request/issue with Linux kernel related changes target/qualcommax pull request/issue for qualcommax target
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet