Bug 274982 - ath10k0: failed to download calibration data from nvmem-cell 'pre-calibration': -6
Summary: ath10k0: failed to download calibration data from nvmem-cell 'pre-calibration...
Status: In Progress
Alias: None
Product: Base System
Classification: Unclassified
Component: wireless (show other bugs)
Version: 14.0-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: Bjoern A. Zeeb
URL:
Keywords:
Depends on:
Blocks: 273624
  Show dependency treegraph
 
Reported: 2023-11-09 08:16 UTC by Aminavy
Modified: 2024-05-26 07:31 UTC (History)
3 users (show)

See Also:


Attachments
workaround (3.99 KB, text/plain)
2024-05-13 15:50 UTC, Aminavy
no flags Details
ifconfig output (475 bytes, text/plain)
2024-05-13 15:50 UTC, Aminavy
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aminavy 2023-11-09 08:16:00 UTC
Hello!

# freebsd-version -kru
14.0-RC4
14.0-RC4
14.0-RC4-p1


I compiled ath10k and athk_common modules and install it, dmesg when I load the module:

ath10k0: <ath10k_pci> mem 0xd0200000-0xd03fffff at device 0.0 on pci1
ath10k0: pci irq msi oper_irq_mode 2 irq_mode 0 reset_mode 0
ath10k0: successfully loaded firmware image 'ath10k/QCA6174/hw3.0/firmware-6.bin'
ath10k0: qca6174 hw3.2 target 0x05030000 chip_id 0x00340aff sub 17aa:0827
ath10k0: kconfig debug 1 debugfs 0 tracing 0 dfs 0 testmode 0
ath10k0: firmware ver WLAN.RM.4.4.1-00288- api 6 features wowlan,ignore-otp,mfp crc32 bf907c7c
ath10k0: failed to download calibration data from nvmem-cell 'pre-calibration': -6

--------------------------------------------------------------------------

pciconf output:
ath10k0@pci0:1:0:0:	class=0x028000 rev=0x32 hdr=0x00 vendor=0x168c device=0x003e subvendor=0x17aa subdevice=0x0827
    vendor     = 'Qualcomm Atheros'
    device     = 'QCA6174 802.11ac Wireless Network Adapter'
    class      = network
---------------------------

when try to create interface:

# ifconfig wlan0 create wlandev ath10k0
ifconfig: SIOCIFCREATE2 (wlan0): Device not configured


I don't know why this driver is not precompiled
Comment 1 Bjoern A. Zeeb freebsd_committer freebsd_triage 2023-11-10 01:07:14 UTC
Because currently no one has the time do debug and support any of the disconnected LinuxKPI based drivers.  Do you have the time and ability to debug the problem?
Comment 2 Joshua Kinard 2024-02-16 07:28:13 UTC
Tried loading ath10k on a small appliance w/ a QCA9377 module in it and got this same result.  It looks like the 'ath10k_download_cal_nvmem' function is currently rigged to intentionally fail on FreeBSD, because the Linux-specific bits of code are ifdef'ed out, and the only bits that actually fire on FreeBSD just makes the function return EXNIO, so that probably causes the rest of the driver init stack to bail out.

Making a completely uneducated guess, I take it FreeBSD's LinuxKPI layer doesn't handle Linux device-layer functions like 'devm_nvmem_cell_get' and 'nvmem_cell_read'?  Or is it more the code in 'ath10k_download_board_data', which is called after the nvmem_cell functions in the Linux-specific code?

IOW, what's the hang-up on this driver?  There's zero documentation,  current status information, or even a roadmap w/ a "we are here" arrow that I can find to know what the state of things are.
Comment 3 Aminavy 2024-05-13 15:50:00 UTC
Created attachment 250621 [details]
workaround
Comment 4 Aminavy 2024-05-13 15:50:56 UTC
Created attachment 250622 [details]
ifconfig output
Comment 5 Aminavy 2024-05-13 15:51:09 UTC
Yesterday i managed to load it with some tricks, and found two problem: first in loading firmware, and second in authentication.

To load the driver: first load if_ath(I don't know why a memory problem?), load all ath10k firmware for your NIC and finally load if_ath10k (at least working for me with QCA6174).


I attached a log with script and ifconfig output.
Comment 6 Bjoern A. Zeeb freebsd_committer freebsd_triage 2024-05-13 17:25:35 UTC
(In reply to Aminavy from comment #5)

That is exciting news.

I'll go and have a look.  Did you manage this without loading ath first?  I wonder if there's a missing dependency on something else.
I'd definitively go and have a look.

I am currently also preparing an update to Linux v6.9 if you were willing to test that for us, that would be great.  Let me know.
Comment 7 Aminavy 2024-05-14 04:57:37 UTC
I forgot to add:
I can connect to PSK-less networks, connecting to a network with PSK failed with error WRONG KEY, but actually key is correct.
And when I connect to an access point without psk, I can't get internet connection.
Comment 8 Aminavy 2024-05-15 02:56:30 UTC
(In reply to Bjoern A. Zeeb from comment #6)
Yes, I tried without ath, but firmware crashed.
Comment 9 Andre Albsmeier 2024-05-26 07:31:08 UTC
Same here for a

ath10k0@pci0:3:0:0:     class=0x028000 rev=0x31 hdr=0x00 vendor=0x168c device=0x0042 subvendor=0x17aa subdevice=0x0901
    vendor     = 'Qualcomm Atheros'
    device     = 'QCA9377 802.11ac Wireless Network Adapter'
    class      = network

ath10k0: <ath10k_pci> mem 0xa9000000-0xa91fffff irq 17 at device 0.0 on pci3
ath10k0: pci irq msi oper_irq_mode 2 irq_mode 0 reset_mode 0
ath10k0: successfully loaded firmware image 'ath10k/QCA9377/hw1.0/firmware-6.bin'
ath10k0: qca9377 hw1.1 target 0x05020001 chip_id 0x003821ff sub 17aa:0901
ath10k0: kconfig debug 1 debugfs 0 tracing 0 dfs 0 testmode 0
ath10k0: firmware ver WLAN.TF.2.1-00021-QCARMSWP-1 api 6 features wowlan,ignore-otp crc32 42e41877
ath10k0: failed to download calibration data from nvmem-cell 'pre-calibration': -6

but I can't get it attached.

I can help trying out things if desired...