athp icon indicating copy to clipboard operation
athp copied to clipboard

Page Fault for QCA6174

Open NathanKuo0821 opened this issue 5 years ago • 13 comments

I running QCA6174 with FreeBSD RELEASE 12.0 on my laptop, after load the driver the page fault error occurred.

I try to replace the board data based on issues https://github.com/erikarn/athp/issues/20 , but the issue still exist.

Does anyone have an idea for this issue? I need some help.

Infomation: OS : FreeBSD 12.0 Driver : git clone --branch NEW_ATHP_ARVIF_LOCK https://github.com/Geramy/athp Laptop : Lenovo T400

Command: kldload athp_QCA6174_hw3.0_board.bin kldload athp_QCA6174_hw3.0_firmware-4.bin kldload if_athp

Log: FreeBSD 12.0-RELEASE FreeBSD 12.0-RELEASE GENERIC amd64

panic: page fault

GNU gdb 6.1.1 [FreeBSD] Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "amd64-marcel-freebsd"...

Unread portion of the kernel message buffer: athp0: wmi unified ready event not received

Fatal trap 12: page fault while in kernel mode cpuid = 1; apic id = 01 fault virtual address = 0x58 fault code = supervisor read data, page not present instruction pointer = 0x20:0xffffffff82a26fc1 stack pointer = 0x28:0xfffffe002e63b6c0 frame pointer = 0x28:0xfffffe002e63b720 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 0 (athp0 ath10k_at_wq) trap number = 12 panic: page fault cpuid = 1 time = 1581651376 KDB: stack backtrace: 0 0xffffffff80be7977 at kdb_backtrace+0x67 1 0xffffffff80b9b563 at vpanic+0x1a3 2 0xffffffff80b9b3b3 at panic+0x43 3 0xffffffff8107496f at trap_fatal+0x35f 4 0xffffffff810749c9 at trap_pfault+0x49 5 0xffffffff81073fee at trap+0x29e 6 0xffffffff8104f1d5 at calltrap+0x8 7 0xffffffff82a26e81 at ath10k_ce_init_pipe+0x31 8 0xffffffff82a28a59 at ath10k_pci_init_pipes+0x49 9 0xffffffff82a223a0 at ath10k_pci_warm_reset+0xf0 10 0xffffffff82a2225f at ath10k_pci_safe_chip_reset+0x3f 11 0xffffffff82a2a624 at ath10k_pci_hif_stop+0x64 12 0xffffffff82a2f14c at ath10k_hif_stop+0x2c 13 0xffffffff82a2e30b at ath10k_core_start+0x81b 14 0xffffffff82a2f837 at ath10k_core_probe_fw+0x2f7 15 0xffffffff82a32c88 at attempt_ath10k_core_probe_fw+0x18 16 0xffffffff82a30c97 at ath10k_core_register_work+0x27 17 0xffffffff80bf9cb4 at taskqueue_run_locked+0x154 Uptime: 4m44s

https://imgur.com/L4x229k https://imgur.com/5fiUXcb https://imgur.com/j6vGwho

Nathan Kuo

NathanKuo0821 avatar Feb 14 '20 03:02 NathanKuo0821

After change the board data from the https://github.com/kvalo/ath10k-firmware/blob/master/QCA6174/hw3.0/board.bin , loading the driver work.

Now the issue is when I create the wlan interface by using command "ifconfig wlan0 create wlandev athp0" , the system panic , I need some help, plz.

The log: athp0: ath10k_download_cal_dt: TODO: device tree check athp0: ath10k_wmi_event_service_ready_work: TODO: EEPROM code: 0x0000006c athp0: failed to enable PMF QOS: -35 kernel trap 12 with interrupts disabled

Fatal trap 12: page fault while in kernel mode cpuid = 0; apic id = 00 fault virtual address = 0x20 fault code = supervisor read data, page not present instruction pointer = 0x20:0xffffffff80bfe337 stack pointer = 0x28:0xfffffe002e45e500 frame pointer = 0x28:0xfffffe002e45e510 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = resume, IOPL = 0 current process = 1417 (ifconfig) trap number = 12 panic: page fault cpuid = 0 time = 1581899134 KDB: stack backtrace: 0 0xffffffff80be7977 at kdb_backtrace+0x67 1 0xffffffff80b9b563 at vpanic+0x1a3 2 0xffffffff80b9b3b3 at panic+0x43 3 0xffffffff8107496f at trap_fatal+0x35f 4 0xffffffff810749c9 at trap_pfault+0x49 5 0xffffffff81073fee at trap+0x29e 6 0xffffffff8104f1d5 at calltrap+0x8 7 0xffffffff80b7b149 at __mtx_unlock_sleep+0xb9 8 0xffffffff8296c356 at ath10k_start+0x6f6 9 0xffffffff829323a0 at athp_vap_create+0x60 10 0xffffffff80cd6ebd at wlan_clone_create+0xcd 11 0xffffffff80c9ec15 at if_clone_createif+0xb5 12 0xffffffff80c9c1c7 at ifioctl+0x5f7 13 0xffffffff80c04f3d at kern_ioctl+0x26d 14 0xffffffff80c04c5e at sys_ioctl+0x15e 15 0xffffffff81075449 at amd64_syscall+0x369 16 0xffffffff8104fabd at fast_syscall_common+0x101 Uptime: 2m19s Dumping 370 out of 3938 MB:..5%..13%..22%..31%..44%..52%..61%..74%..83%..91% Dump complete

NathanKuo0821 avatar Feb 17 '20 06:02 NathanKuo0821

Hey Guys, Is anyone still here? Can you help?

Nathan Kuo

NathanKuo0821 avatar Feb 25 '20 06:02 NathanKuo0821

Hello, i can confirm i have exactly the same problem, a panic due to a mutex, on FreeBSD current

nerzhul avatar Feb 27 '20 19:02 nerzhul

Sorry I did not read the entire post we are currently working on mutex issues.

Geramy avatar May 08 '20 01:05 Geramy

What machines or laptops are you guys running?

Geramy avatar May 08 '20 03:05 Geramy

Hi Geramy,

Freebsd 12 running on thinkpad t400

The attached is my note.

Thanks.

Nathan Kuo

From: Geramy [mailto:[email protected]] Sent: Friday, May 8, 2020 11:23 AM To: erikarn/athp Cc: NathanKuo0821; Author Subject: Re: [erikarn/athp] Page Fault for QCA6174 (#24)

What machines or laptops are you guys running?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/erikarn/athp/issues/24#issuecomment-625609128 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ADRAYFVLVDCSVQJM6FS5FSDRQN3K3ANCNFSM4KU7XVBQ .

-- Avast 防毒軟體已檢查此封電子郵件的病毒。 https://www.avast.com/antivirus

install freebsd 12

login : root password : 12345678

dhclient em0

UI

pkg update pkg install xorg pkg install gnome3 pkg install vim

vim /etc/rc.conf gdm_enable="YES" gnome_enable="YES"

reboot

group root

vim /etc/group wheel:*:0:root,jjplus

download kernel

fetch -o /tmp ftp://ftp.freebsd.org/pub/uname -s/releases/uname -m/uname -r | cut -d'-' -f1,2/src.txz tar -C / -xvf /tmp/src.txz

compile kernel

cd /usr/src make kernel-toolchain make kernel make buildkernel KERNCONF=GENERIC make installkernel KERNCONF=GENERIC

download athp for ath10k

git clone --branch NEW_ATHP_ARVIF_LOCK https://github.com/Geramy/athp vim /root/athp/otus/freebsd/src/sys/modules/build_module #!/bin/sh

X_SRCDIR=${X_SRCDIR:="/usr/src"} X_KERNDIR=${X_KERNDIR:="/usr/obj/usr/src/amd64.amd64/sys/GENERIC"} X_KMODOWN=${X_KMODOWN:="root"} X_KMODGRP=${X_KMODGRP:="root"}

This allows for -HEAD includes for net80211 ..

env CFLAGS="-I../../../sys/"
make
MODULES_OVERRIDE=""
DEBUG_FLAGS="-g"
DEBUG_FLAGS="-g"
KMODDIR="/root/athp/otus/freebsd/modules/"
KMODOWN="${X_KMODOWN}"
KMODGRP="${X_KMODGRP}"
MAKESYSPATH="${X_SRCDIR}/share/mk"
SYSDIR="${X_SRCDIR}/sys/"
KERNBUILDDIR="${X_KERNDIR}"
KERN_DEBUGDIR=""
$@

ref athfw/QCA6174 to copy firmware5

FreeBSD 12.0 Mounting Drives

pkg install fusefs-ntfs fusefs-ext4fuse fusefs-ext2 fusefs-simple-mtpfs reboot kldload fuse ntfs-3g /dev/da0s1 /mnt/

ref web site

https://headthirst.com/freebsd-mounting.html https://unix.stackexchange.com/questions/204956/how-do-you-install-the-freebsd10-kernel-sources https://github.com/Geramy/athp https://github.com/erikarn/athp/issues/11

FreeBSD-12.0-RELEASE-amd64-dvd1.imgPTN

NathanKuo0821 avatar May 08 '20 10:05 NathanKuo0821

i have an older razer blade 2015 model the QCA6174 is branded as "killer networking" wireless card

nupfel avatar May 08 '20 16:05 nupfel

hello @Geramy i'm on a acer aspire S13

nerzhul avatar May 09 '20 08:05 nerzhul

hi! Does anyone have the exact models of their cards? Even the FCC IDs stamped on them would be nice.

There are a handful of QCA6174 variants out there and they have different data path / command path needs.

I've fixed one bug in the RX path that caused a panic on my QCA6174 HW3.2, but there are other NICs out there and other bugs to chase.

I'd like to try and fix them all but I will need more NICs to test! Thanks!

erikarn avatar Jun 18 '20 16:06 erikarn

@erikarn just compiled your module (cheating on the MA_OWNED undefined in my case).

Here is the dmesg when i load the if_athp after compilation:

athp0: <QCA6174> mem 0xb1000000-0xb11fffff irq 17 at device 0.0 on pci1
athp_pci_attach: msicount=8, msixcount=0
athp0: athp_pci_attach: 8 MSI interrupts
athp0: ath10k_pci_alloc_pipes: WARNING: configuring 4k dmamap size for pipe 5; figure out what to do instead
athp0: ath10k_pci_alloc_pipes: WARNING: configuring 4k dmamap size for pipe 6; figure out what to do instead
athp0: athp_pci_attach: chipid: 0x00340aff
athp0: ath10k_fetch_fw_file: firmware_get: athp_cal-pci-athp0.bin
athp_cal-pci-athp0.bin: could not load firmware image, error 2
athp0: ath10k_fetch_fw_file: firmware_get: athp_QCA6174_hw3.0_board.bin
athp0: ath10k_fetch_fw_file: firmware_get: athp_QCA6174_hw3.0_firmware-5.bin
athp_QCA6174_hw3.0_firmware-5.bin: could not load firmware image, error 2
athp0: could not fetch firmware file 'athp_QCA6174_hw3.0/firmware-5.bin': -1
athp0: ath10k_fetch_fw_file: firmware_get: athp_QCA6174_hw3.0_firmware-4.bin
athp0: ath10k_core_init_firmware_features: hardware crypto
athp0: ath10k_download_cal_dt: TODO: device tree check

No interface appears in ifconfig, certainly due to the firmware issue

nerzhul avatar Jun 19 '20 07:06 nerzhul

i just cheated again, adding the new modules and replacing firmware-5 with firmware-6 (which exists not the first) in the code. you have a PR adding the missing parts here: https://github.com/erikarn/athp/pull/36 Now i have a better dmesg output but no network card appear in ifconfig:

athp0: <QCA6174> mem 0xb1000000-0xb11fffff irq 17 at device 0.0 on pci1
athp_pci_attach: msicount=8, msixcount=0
athp0: athp_pci_attach: 8 MSI interrupts
athp0: ath10k_pci_alloc_pipes: WARNING: configuring 4k dmamap size for pipe 5; figure out what to do instead
athp0: ath10k_pci_alloc_pipes: WARNING: configuring 4k dmamap size for pipe 6; figure out what to do instead
athp0: athp_pci_attach: chipid: 0x00340aff
athp0: ath10k_fetch_fw_file: firmware_get: athp_cal-pci-athp0.bin
athp_cal-pci-athp0.bin: could not load firmware image, error 2
athp0: ath10k_fetch_fw_file: firmware_get: athp_QCA6174_hw3.0_board.bin
athp0: ath10k_fetch_fw_file: firmware_get: athp_QCA6174_hw3.0_firmware-6.bin
athp0: ath10k_core_init_firmware_features: hardware crypto
athp0: ath10k_download_cal_dt: TODO: device tree check
athp0: Unknown eventid: 3
athp0: ath10k_wmi_event_service_ready_work: TODO: EEPROM code: 0x0000006c
athp0: Unknown eventid: 118809
athp0: Unknown eventid: 90118
athp0: htt version request timed out
athp0: failed to setup htt: -60
athp0: ath10k_pci_irq_sync: TODO
athp0: ath10k_pci_kill_tasklet: called
athp0: ath10k_htt_tx_free: called
athp0: ath10k_htt_tx_free: tearing down htt locks
athp0: could not init core (-60)
athp0: could not probe fw, clean up allocations and memory and retry. (-60)
athp0: ath10k_fetch_fw_file: firmware_get: athp_cal-pci-athp0.bin
athp_cal-pci-athp0.bin: could not load firmware image, error 2
athp0: ath10k_fetch_fw_file: firmware_get: athp_QCA6174_hw3.0_board.bin
athp0: ath10k_fetch_fw_file: firmware_get: athp_QCA6174_hw3.0_firmware-6.bin
athp0: ath10k_core_init_firmware_features: hardware crypto
athp0: ath10k_download_cal_dt: TODO: device tree check
athp0: Unknown eventid: 3
athp0: ath10k_wmi_event_service_ready_work: TODO: EEPROM code: 0x0000006c
athp0: Unknown eventid: 118809
athp0: Unknown eventid: 90118
athp0: qca6174 hw3.2 (0x05030000, 0x00340aff) fw WLAN.RM.4.4.1-00140-QCARMSWPZ-1 api 5 htt-ver 3.60 wmi-op 4 htt-op 3 cal otp max-sta 32 raw 0 hwcrypto 1 features wowlan,ignore-otp
athp0: ath10k_core_stop: state=0
athp0: ath10k_wait_for_suspend: state=0
athp0: ath10k_wmi_pdev_suspend_target: called
athp0: htc ep 2 out of TX credits (0 < 1)
athp0: htc ep 2 out of TX credits (0 < 1)
athp0: htc ep 2 out of TX credits (0 < 1)
athp0: htc ep 2 out of TX credits (0 < 1)
athp0: htc ep 2 out of TX credits (0 < 1)
athp0: htc ep 2 out of TX credits (0 < 1)
athp0: htc ep 2 out of TX credits (0 < 1)
athp0: htc ep 2 out of TX credits (0 < 1)
athp0: htc ep 2 out of TX credits (0 < 1)
athp0: htc ep 2 out of TX credits (0 < 1)
athp0: htc ep 2 out of TX credits (0 < 1)
athp0: htc ep 2 out of TX credits (0 < 1)
athp0: htc ep 2 out of TX credits (0 < 1)
athp0: htc ep 2 out of TX credits (0 < 1)
athp0: htc ep 2 out of TX credits (0 < 1)
athp0: htc ep 2 out of TX credits (0 < 1)
athp0: htc ep 2 out of TX credits (0 < 1)
... (more than 100 times this entry)
athp0: htc ep 2 out of TX credits (0 < 1)
athp0: htc ep 2 out of TX credits (0 < 1)
athp0: htc ep 2 out of TX credits (0 < 1)
athp0: htc ep 2 out of TX credits (0 < 1)
athp0: htc ep 2 out of TX credits (0 < 1)
athp0: htc ep 2 out of TX credits (0 < 1)
athp0: ath10k_wmi_cmd_send: failed (-35)
athp0: could not suspend target (-35)
athp0: ath10k_pci_irq_sync: TODO
athp0: ath10k_pci_kill_tasklet: called
athp0: ath10k_htt_tx_free: called
athp0: ath10k_htt_tx_free: tearing down htt locks
athp0: ath10k_mac_register: called
athp0: athp_attach_net80211: called
athp_getradiocaps: called; maxchans=1024
athp0: athp_getradiocaps: enabling HT/VHT rates
athp_getradiocaps: done; maxchans=1024, nchans=278
athp0: athp_attach_11n: 2 tx streams, 2 rx streams
athp0: 11a rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
athp0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
athp0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
athp0: 2T2R
athp0: 11na MCS 20MHz
athp0: MCS 0-7: 6.5Mbps - 65Mbps
athp0: MCS 8-15: 13Mbps - 130Mbps
athp0: 11na MCS 20MHz SGI
athp0: MCS 0-7: 7Mbps - 72Mbps
athp0: MCS 8-15: 14.5Mbps - 144.5Mbps
athp0: 11na MCS 40MHz:
athp0: MCS 0-7: 13.5Mbps - 135Mbps
athp0: MCS 8-15: 27Mbps - 270Mbps
athp0: 11na MCS 40MHz SGI:
athp0: MCS 0-7: 15Mbps - 150Mbps
athp0: MCS 8-15: 30Mbps - 300Mbps
athp0: 11ng MCS 20MHz
athp0: MCS 0-7: 6.5Mbps - 65Mbps
athp0: MCS 8-15: 13Mbps - 130Mbps
athp0: 11ng MCS 20MHz SGI
athp0: MCS 0-7: 7Mbps - 72Mbps
athp0: MCS 8-15: 14.5Mbps - 144.5Mbps
athp0: 11ng MCS 40MHz:
athp0: MCS 0-7: 13.5Mbps - 135Mbps
athp0: MCS 8-15: 27Mbps - 270Mbps
athp0: 11ng MCS 40MHz SGI:
athp0: MCS 0-7: 15Mbps - 150Mbps
athp0: MCS 8-15: 30Mbps - 300Mbps
athp0: [VHT] Channel Widths: 20MHz, 40MHz, 80MHz
athp0: [VHT] Features: 339011b2<MPDU11454,RXLDPC,SHORTGI80,RXSTBC1,RXSTBC2,BFEECAP>
athp0: [VHT] NSS 1: TX MCS 0..9, RX MCS 0..9
athp0: [VHT] NSS 2: TX MCS 0..9, RX MCS 0..9

nerzhul avatar Jun 19 '20 07:06 nerzhul

hi! Does anyone have the exact models of their cards? Even the FCC IDs stamped on them would be nice.

There are a handful of QCA6174 variants out there and they have different data path / command path needs.

I've fixed one bug in the RX path that caused a panic on my QCA6174 HW3.2, but there are other NICs out there and other bugs to chase.

I'd like to try and fix them all but I will need more NICs to test! Thanks!

Alienware 15 R2 (Killer 1535) MSIP-CRM-ATH-QCNFA364A FCC ID: PPD-QCNFA364AH Qualcomm Atheros Model: QCNFA364A CMIITID:2015AJ1614(M) IC: 4104A-QCNFA364A CCAI15LP0770T

Dual-band-Killer1535-802-11ac-M-2-Wireless-Card-For-Bigfoot-Killer-Wireless-AC-1535-Atheros jpg_220x220 Dual-band-Killer1535-802-11ac-M-2-Wireless-Card-For-Bigfoot-Killer-Wireless-AC-1535-Atheros jpg_220x220-2

Output from pciconf none3@pci0:60:0:0: class=0x028000 rev=0x32 hdr=0x00 vendor=0x168c device=0x003e subvendor=0x1a56 subdevice=0x1535 vendor = 'Qualcomm Atheros' device = 'QCA6174 802.11ac Wireless Network Adapter' class = network

PS - The pciconf output is from a fresh install with GENERIC kernel. I have not tried to (compiled or) loaded the drivers from the repo.

DH3S3N avatar Aug 23 '22 15:08 DH3S3N

please do throw patches at me, I'm tidying up the tree right now in an attempt to get it ready to land.

-adrian

On Tue, 23 Aug 2022 at 08:31, DH3S3N @.***> wrote:

hi! Does anyone have the exact models of their cards? Even the FCC IDs stamped on them would be nice.

There are a handful of QCA6174 variants out there and they have different data path / command path needs.

I've fixed one bug in the RX path that caused a panic on my QCA6174 HW3.2, but there are other NICs out there and other bugs to chase.

I'd like to try and fix them all but I will need more NICs to test! Thanks!

Alienware 15 R2 (Killer 1535) MSIP-CRM-ATH-QCNFA364A FCC ID: PPD-QCNFA364AH Qualcomm Atheros Model: QCNFA364A CMIITID:2015AJ1614(M) IC: 4104A-QCNFA364A CCAI15LP0770T [image: Dual-band-Killer1535-802-11ac-M-2-Wireless-Card-For-Bigfoot-Killer-Wireless-AC-1535-Atheros jpg_220x220] https://user-images.githubusercontent.com/59414907/186199377-fe0117b1-6547-4e95-8c00-a2ddcf5326ab.jpg [image: Dual-band-Killer1535-802-11ac-M-2-Wireless-Card-For-Bigfoot-Killer-Wireless-AC-1535-Atheros jpg_220x220-2] https://user-images.githubusercontent.com/59414907/186199477-ed3c71cc-33a0-408d-aa1b-52671c26559f.jpg 6

— Reply to this email directly, view it on GitHub https://github.com/erikarn/athp/issues/24#issuecomment-1224238440, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAI2L3IQDOIGKSGYMEU2X63V2TVEXANCNFSM4KU7XVBQ . You are receiving this because you were mentioned.Message ID: @.***>

erikarn avatar Aug 23 '22 15:08 erikarn