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

ath11k/ath12k firmware missing, CONFIG_IRQ_REMAP not defined either #3621

Closed
OdinVex opened this issue Oct 13, 2024 · 13 comments · Fixed by #3640
Closed

ath11k/ath12k firmware missing, CONFIG_IRQ_REMAP not defined either #3621

OdinVex opened this issue Oct 13, 2024 · 13 comments · Fixed by #3640
Labels
board/generic-x86-64 Generic x86-64 Boards (like Intel NUC) bug

Comments

@OdinVex
Copy link

OdinVex commented Oct 13, 2024

Describe the issue you are experiencing

I've attempted to add the firmware for ath11k and ath12k (to support my 17cb:1107 WiFi 7 card) to /mnt/data/supervisor/firmware and reboot but I'm not sure it's loading, dmesg's only output is:

[    5.322474] ath12k_pci 0000:06:00.0: BAR 0: assigned [mem 0xf0200000-0xf03fffff 64bit]
[    5.322512] ath12k_pci 0000:06:00.0: enabling device (0100 -> 0102)
[    5.323444] ath12k_pci 0000:06:00.0: failed to get 16 MSI vectors, only -28 available
[    5.323473] ath12k_pci 0000:06:00.0: failed to alloc msi: -28
[    5.325225] ath12k_pci: probe of 0000:06:00.0 failed with error -28

What operating system image do you use?

generic-x86-64 (Generic UEFI capable x86-64 systems)

What version of Home Assistant Operating System is installed?

6.6.46-haos

Did the problem occur after upgrading the Operating System?

Ongoing

Hardware details

17cb:1107, WiFi 7 Card, a Qualcomm "FastConnect" WCN7850 (WCN7851) M.2 M-Key.

Steps to reproduce the issue

  1. Install an ath11k/ath12k wireless card.
  2. Boot the system
  3. Copy firmware files.
  4. Reboot.
    ...

Anything in the Supervisor logs that might be useful for us?

N/A, None

Anything in the Host logs that might be useful for us?

[    5.322474] ath12k_pci 0000:06:00.0: BAR 0: assigned [mem 0xf0200000-0xf03fffff 64bit]
[    5.322512] ath12k_pci 0000:06:00.0: enabling device (0100 -> 0102)
[    5.323444] ath12k_pci 0000:06:00.0: failed to get 16 MSI vectors, only -28 available
[    5.323473] ath12k_pci 0000:06:00.0: failed to alloc msi: -28
[    5.325225] ath12k_pci: probe of 0000:06:00.0 failed with error -28

System information

No response

Additional information

Permissions on the files are correct, I even tried just copying ath11k and ath12k folders alone since they don't exist in HAOS, no effect. Rebooting server doesn't change anything.

@OdinVex OdinVex added the bug label Oct 13, 2024
@OdinVex OdinVex changed the title ath11k/ath12k drivers missing ath11k/ath12k firmware missing Oct 13, 2024
@OdinVex
Copy link
Author

OdinVex commented Oct 13, 2024

linux-firmware has it and supposedly it's been supported since kernel 6.3. I'm thinking the driver isn't detecting the firmware files because of the whole symlinking deal.

@OdinVex
Copy link
Author

OdinVex commented Oct 20, 2024

Some digging around, this might be a two-part issue? One is the missing firmware but the other is the driver not being able to allocate MSI vectors. Some google-foo shows people getting it to work on systems by compiling the kernel with "CONFIG_IRQ_REMAP" enabled.

@OdinVex
Copy link
Author

OdinVex commented Oct 20, 2024

# modinfo ath12k
filename:       /lib/modules/6.6.54-haos/kernel/drivers/net/wireless/ath/ath12k/ath12k.ko
license:        Dual BSD/GPL
description:    Core module for Qualcomm Atheros 802.11be wireless LAN cards.
license:        Dual BSD/GPL
description:    Driver support for Qualcomm Technologies PCIe 802.11be WLAN devices
alias:          pci:v000017CBd00001107sv*sd*bc*sc*i*
alias:          pci:v000017CBd00001109sv*sd*bc*sc*i*
depends:        mac80211,qmi_helpers,cfg80211,mhi
retpoline:      Y
intree:         Y
name:           ath12k
vermagic:       6.6.54-haos SMP preempt mod_unload 
parm:           debug_mask:Debugging mask (uint)

It's not showing any firmware files, so that's of concern but maybe that gets loaded/used after the MSI bits?

Edit: Attempts to rmmod and insmod don't change whether it shows firmware files loaded by the module or not.
Edit: A grep of kernel compile flags shows CONFIG_IRQ_REMAP is not set, that may be required for cards such as these?

@OdinVex OdinVex changed the title ath11k/ath12k firmware missing ath11k/ath12k firmware missing, CONFIG_IRQ_REMAP not defined either Oct 20, 2024
@agners
Copy link
Member

agners commented Oct 21, 2024

-28 is ENOSPC, and it seems that CONFIG_IRQ_REMAP is about IRQ remapping. On my Arch Linux distribution that config is enabled, I think we can safely enable it for HAOS as well.

@OdinVex
Copy link
Author

OdinVex commented Oct 21, 2024

-28 is ENOSPC, and it seems that CONFIG_IRQ_REMAP is about IRQ remapping. On my Arch Linux distribution that config is enabled, I think we can safely enable it for HAOS as well.

Same for my Manjaro installation and an Ubuntu Server I manage. Edit: It'd also be nice to include the ath*k firmwares out-of-box considering they're required for many net-related devices.

@agners agners added the board/generic-x86-64 Generic x86-64 Boards (like Intel NUC) label Oct 21, 2024
agners added a commit that referenced this issue Oct 21, 2024
Add support for interrupt remapping for IO-APIC and MSI devices as
required by some ath12k devices.

Fixes: #3621
agners added a commit that referenced this issue Oct 21, 2024
Add support for interrupt remapping for IO-APIC and MSI devices as
required by some ath12k devices.

Fixes: #3621
@agners
Copy link
Member

agners commented Oct 21, 2024

Edit: It'd also be nice to include the ath*k firmwares out-of-box considering they're required for many net-related devices.

Hm, we don't ship any ath11k today, I guess shipping firmwares for the chips which are available as a general purpose PCIe device makes sense. The problem is, things are a bit tight on the root file system partition, so depending on size, it might not be possible to add the firmwares right now. I'll leave this up to @sairon to decide.

@OdinVex
Copy link
Author

OdinVex commented Oct 21, 2024

Edit: It'd also be nice to include the ath*k firmwares out-of-box considering they're required for many net-related devices.

Hm, we don't ship any ath11k today, I guess shipping firmwares for the chips which are available as a general purpose PCIe device makes sense. The problem is, things are a bit tight on the root file system partition, so depending on size, it might not be possible to add the firmwares right now. I'll leave this up to @sairon to decide.

ath11k or ath12k. The firmwares I'm more focused on are for wireless cards. I don't know enough about HAOS to know why the root filesystem would (edit )have constraints but those firmwares are important to get networking going. I'm guessing it has to do with HAOS devices (Green/Yellow/Blue)?

@OdinVex
Copy link
Author

OdinVex commented Oct 21, 2024

Thank you @agners for adding the kernel config option. I use the fully-managed HAOS-on-metal install, any guess at when it might reach regular updates for it?

Edit:

Core 2024.10.3
Supervisor 2024.10.2
Operating System 13.2
Frontend 20241002.3

The first Wednesday of November or would the current beta have it yet?

@agners
Copy link
Member

agners commented Oct 21, 2024

Thank you @agners for adding the kernel config option. I use the fully-managed HAOS-on-metal install, any guess at when it might reach regular updates for it?

HAOS releases don't follow a fixed pattern. We just released HAOS 13.2, it will be a couple of weeks at least until the next update.

You can update to a dev version however, and it is fairly safe to do so since we have the A/B type fallback. Also, the current code base is pretty much 13.2 plus this change (and a stable kernel bump).

ha os update --version 14.0.dev20241021, but you'll have to wait until the build is finished.

@OdinVex
Copy link
Author

OdinVex commented Oct 21, 2024

Thank you @agners for adding the kernel config option. I use the fully-managed HAOS-on-metal install, any guess at when it might reach regular updates for it?

HAOS releases don't follow a fixed pattern. We just released HAOS 13.2, it will be a couple of weeks at least until the next update.

You can update to a dev version however, and it is fairly safe to do so since we have the A/B type fallback. Also, the current code base is pretty much 13.2 plus this change (and a stable kernel bump).

ha os update --version 14.0.dev20241021, but you'll have to wait until the build is finished.

Thank you, will try it out. Hopeful this is all the card needs to get going.

@OdinVex
Copy link
Author

OdinVex commented Oct 21, 2024

It's able to resize the MSI now, that's one issue resolved. Now I'm tackling:

[    5.338151] ath12k_pci 0000:06:00.0: BAR 0: assigned [mem 0xf0200000-0xf03fffff 64bit]
[    5.338186] ath12k_pci 0000:06:00.0: enabling device (0100 -> 0102)
[    5.357604] ath12k_pci 0000:06:00.0: Hardware name: wcn7850 hw2.0
...
[    5.418285] mhi mhi0: Requested to power ON
[    5.418313] mhi mhi0: Power on setup success
[    5.418401] mhi mhi0: Direct firmware load for ath12k/WCN7850/hw2.0/amss.bin failed with error -2
[    5.418407] mhi mhi0: Error loading firmware: -2

Edit: What little bit of searching I can about this error suggests it can't find the firmware. With the read-only filesystem I am forced to use the 'updates' link but I don't think that will work in this case.

@OdinVex
Copy link
Author

OdinVex commented Oct 22, 2024

I wonder if it would be better to overlay (instead of using the updates symlink) the /mnt/data/supervisor/firmware/ dir if it exists... A merged type?

Edit: Removed erroneous last edit, this works for now but is needed each boot:

mount -o bind /mnt/data/supervisor/firmware /lib/firmware
rmmod ath12k && insmod ath12k

[    5.390269] ath12k_pci 0000:06:00.0: BAR 0: assigned [mem 0xf0200000-0xf03fffff 64bit]
[    5.390306] ath12k_pci 0000:06:00.0: enabling device (0100 -> 0102)
[    5.421919] ath12k_pci 0000:06:00.0: Hardware name: wcn7850 hw2.0
[    6.062773] ath12k_pci 0000:06:00.0: chip_id 0x2 chip_family 0x4 board_id 0xff soc_id 0x40170200
[    6.062782] ath12k_pci 0000:06:00.0: fw_version 0x100301e1 fw_build_timestamp 2023-12-06 04:05 fw_build_id QC_IMAGE_VERSION_STRING=WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
[    6.062848] ath12k_pci 0000:06:00.0: qmi failed to load regdb bin:
[    6.062851] ath12k_pci 0000:06:00.0: qmi failed to load regdb file:-2

regdb issues appear to be a driver version issue from some posts online suggesting needing newer ath.git (https://lore.kernel.org/all/87ttmlrc8l.fsf@kernel.org/T/)

Edit: The mount -o bind was necessary because the firmware does not load from the updates symlink.

@OdinVex
Copy link
Author

OdinVex commented Oct 22, 2024

For anyone else finding these posts it looks like the ath12k driver is (also) too old at this time to run the card. Firmware loading won't work either via updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
board/generic-x86-64 Generic x86-64 Boards (like Intel NUC) bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants