Bug 243992 - iwm(4): iwm_pcie_load_section: Could not load the [0] uCode section (Intel Wireless-AC 9560)
Summary: iwm(4): iwm_pcie_load_section: Could not load the [0] uCode section (Intel Wi...
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: wireless (show other bugs)
Version: 12.1-STABLE
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-wireless (Nobody)
URL:
Keywords: IntelNetworking, needs-qa
Depends on:
Blocks:
 
Reported: 2020-02-08 21:24 UTC by iron.udjin
Modified: 2023-11-20 10:51 UTC (History)
12 users (show)

See Also:


Attachments
patch (1.61 KB, patch)
2020-03-27 18:27 UTC, Mark Johnston
no flags Details | Diff
dmesg logs (37.98 KB, application/x-xz-compressed-tar)
2020-09-26 22:29 UTC, Peter Kerr
tiritiri.pk: maintainer-approval? (wireless)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description iron.udjin 2020-02-08 21:24:27 UTC
Hello,

WIFI module is integrated to mainboard "Asus ROG MAXIMUS XI HERO (WI-FI)".

iwm0@pci0:0:20:3:	class=0x028000 card=0x00348086 chip=0xa3708086 rev=0x10 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Wireless-AC 9560 [Jefferson Peak]'
    class      = network

OS: 12.1-STABLE r357667

I tried both variants: compile kernel with built-in iwn support and iwn as a module. Result is the same.

In /boot/loader.conf:

if_iwm_load="YES"
iwm9260fw_load="YES"

In dmesg I see:
iwm0: <Intel(R) Dual Band Wireless AC 9560> mem 0xa4334000-0xa4337fff irq 16 at device 20.3 on pci0
iwm0: fw chunk addr 0x404000 len 712 failed to load
iwm0: iwm_pcie_load_section: Could not load the [0] uCode section
iwm0: iwm_start_fw: failed 60
iwm0: Failed to start INIT ucode: 60

... and ifconfig doesn't how iwm interface.

Is there a way to make it work?

Thank you!
Comment 1 vidwer+fbsdbugs 2020-02-08 21:32:34 UTC
(In reply to iron.udjin from comment #0)
/etc/rc.conf should have settings like:

wlans_iwm0="wlan0"
ifconfig_wlan0="wpa dhcp"

Save rc.conf, followed by either a reboot or 'service netif restart'.
Comment 2 iron.udjin 2020-02-09 02:37:15 UTC
(In reply to vidwer+fbsdbugs from comment #1)

I added those lines inito /etc/rc.conf and restrted netif and got in logs:

Feb  9 04:31:21 IRON kernel: iwm0: <Intel(R) Dual Band Wireless AC 9560> mem 0xa4334000-0xa4337fff irq 16 at device 20.3 on pci0
Feb  9 04:31:26 IRON kernel: iwm0: fw chunk addr 0x404000 len 712 failed to load
Feb  9 04:31:26 IRON kernel: iwm0: iwm_pcie_load_section: Could not load the [0] uCode section
Feb  9 04:31:26 IRON kernel: iwm0: iwm_start_fw: failed 60
Feb  9 04:31:26 IRON kernel: iwm0: Failed to start INIT ucode: 60
Feb  9 04:31:26 IRON dhclient[1188]: wlan0: not found
Feb  9 04:31:26 IRON dhclient[1188]: exiting.
Feb  9 04:31:26 IRON root[1191]: /etc/rc.d/dhclient: WARNING: failed to start dhclient
Comment 3 Mark Johnston freebsd_committer freebsd_triage 2020-02-11 05:18:55 UTC
This chip should be using iwm9000fw, not iwm9260fw.  Does it work if you preload that instead?
Comment 4 iron.udjin 2020-02-11 07:28:16 UTC
(In reply to Mark Johnston from comment #3)
No, the same error:

iwm0: <Intel(R) Dual Band Wireless AC 9560> mem 0xa4334000-0xa4337fff irq 16 at device 20.3 on pci0
iwm0: fw chunk addr 0x404000 len 712 failed to load
iwm0: iwm_pcie_load_section: Could not load the [0] uCode section
iwm0: iwm_start_fw: failed 60
iwm0: Failed to start INIT ucode: 60
Comment 5 Mark Johnston freebsd_committer freebsd_triage 2020-03-27 18:27:36 UTC
Created attachment 212764 [details]
patch

This is a shot in the dark, but could anyone seeing the problem try the attached patch?
Comment 6 iron.udjin 2020-03-28 10:02:36 UTC
(In reply to Mark Johnston from comment #5)

Just tested your patch. It doesn't work:

iwm0: <Intel(R) Dual Band Wireless AC 9560> mem 0xa4334000-0xa4337fff at device 20.3 on pci0
iwm0: fw chunk addr 0x404000 len 712 failed to load
iwm0: iwm_pcie_load_section: Could not load the [0] uCode section
iwm0: iwm_start_fw: failed 60
iwm0: Failed to start INIT ucode: 60
Comment 7 pete 2020-07-20 03:47:48 UTC
I am not sure if this is helpful, but I have a AC-9560 on a Lenovo Thinkpad P43s running CURRENT that ran into this issue.  I tried rebooting the system while getting the same uCode loading error, but after powering off the system completely and powering back on the firmware loaded and the NIC is working as expected again.

The NIC was working fine for ages, then i booted a linux image off of USB to test something, and when i rebooted back into CURRENT the firmware failed to load.  So perhaps there was some junk that didn't get cleared from the linux kernel preventing the firmware from loading?  Honestly have no idea but thought i'd throw it out there.
Comment 8 Dries Michiels freebsd_committer freebsd_triage 2020-07-25 15:12:35 UTC
I also have the same problem. I'm not able to have any wifi with my AC9560 on my laptop :-(. My wireless interface doesn't seem to pop-up but driver does attach. Iron, have you been able to get it to work?
Comment 9 iron.udjin 2020-07-25 22:32:19 UTC
(In reply to Dries Michiels from comment #8)

Unfortunately, it still doesn't work. No workaround or patch yet.

(In reply to Dries Michiels from comment #8)

I tested in the same way - no result. Even after power cycle.
Comment 10 Dries Michiels freebsd_committer freebsd_triage 2020-07-26 08:19:28 UTC
I also confirm to have booted a Linux on this machine. I have a triple boot setup ATM. I haven't been able to get the adapter to show in my ifconfig list once, unlucky. I reached out to Ulrich Spörlein, who has the exact some model of laptop as me, the Lenovo T490, and for him wifi works just fine. So it must be a race condition between loading Linux once and afterwards continuing with FreeBSD. Weird.
Comment 11 Bjoern A. Zeeb freebsd_committer freebsd_triage 2020-07-27 10:09:46 UTC
I cannot offer you a fix currently for this but if any of you is adventurous enough to compile and install a HEAD from a few weeks ago somewhere (could be a USB pen drive for testing) please check out and see if the PCI attach and firmware loading parts from here will work:
https://lists.freebsd.org/pipermail/freebsd-wireless/2020-July/009233.html

If you would love to test but cannot checkout the git/compile/install a kernel let me know and I'll go and see.

PS: there is one more complication to testing not listed in the email if your if_iwm currently is auto-loaded you'll have to unload that first before you can load the if_iwl.
Comment 12 Dries Michiels freebsd_committer freebsd_triage 2020-07-27 18:46:55 UTC
This is my dmesg output when grepping iwm with my current configuration (no source update yet):

iwm0: <Intel(R) Dual Band Wireless AC 9560> mem 0xbd738000-0xbd73bfff at device 20.3 on pci0
iwm0: hw rev 0x310, fw ver 34.3125811985.0, address f8:ac:65:e1:26:7a

Nothing else, no errors etc, the wireless interface is just not created for ifconfig to use.
Comment 13 Oleksandr Kryvulia 2020-07-27 19:06:17 UTC
I have Lenovo Thinkpad T490 with AC9560 wireless card and it works very well. One or two times it doesn't detected on boot and for me helps reset bios to default settings and power cycle after that.
Comment 14 Dries Michiels freebsd_committer freebsd_triage 2020-08-01 17:31:20 UTC
God sorry I was an idiot, RTFM, after 
# ifconfig wlan0 create wlandev iwm0

I was able to continue further all good for me, sorry for the noise.
Comment 15 Peter Kerr 2020-09-19 20:57:16 UTC
Add to this: Huawei MateBook 13-S WRT-WX9
FreeBSD 12.2-BETA2 r365865 GENERIC amd64
$ pciconf -lcvV
none4@pci0:0:20:3:   class=ox028000   card=0x20348086   chip=0x9df08086   rev=0x30   hdr=0x00
vendor         = 'Intel Corporation'
device          = 'Cannon Point-LP CNV1 [ Wireless-AC ]
...

As well as the message 
iwm0: iwm_start_fw: failed 60

I also sometimes get 
iwm0: (Intel(R) Dual Band Wireless AC 9560) mem 0x94210000 - 0x9421bfff at device 20.3 on pci0
iwm0: hw rev 0x310 fw ver 34.3125011985.0 address XX:XX:XX:XX:XX:XX
iwm0: failed to send antennas before calibration: 35
iwm_run_init_ucode: failed 35
iwm0: could not initiate scan

My device has only USB Type 3 ports for external comms | video | charging,
and whether or not iwm loads or not seems to depend on what is connected to which of the two USB ports. With nothing in either port, and starting from power off, wlan0 sets up OK every time (so far). What additional logs can I send?
Comment 16 Peter Kerr 2020-09-26 22:29:50 UTC
Created attachment 218342 [details]
dmesg logs

full explanation inside tarball
Comment 17 Arie Bikker 2020-12-03 12:18:15 UTC
(In reply to pete from comment #7)
Can confirm a repeatable malfunction on warm booting from another OS (Windows)
System: Thinkpad X1 Yoga 4th (20QF), bios version 1.41 (2020-10-27)
iwm dmesg after warm reboot from windows:

iwm0: <Intel(R) Dual Band Wireless AC 9560> mem 0xea338000-0xea33bfff irq 16 at device 20.3 on pci0
iwm0: fw chunk addr 0x404000 len 712 failed to load
iwm0: iwm_pcie_load_section: Could not load the [0] uCode section
iwm0: iwm_start_fw: failed 60
iwm0: Failed to start INIT ucode: 60

iwm dmesg after full power down:

iwm0: <Intel(R) Dual Band Wireless AC 9560> mem 0xea338000-0xea33bfff irq 16 at device 20.3 on pci0
iwm0: hw rev 0x310, fw ver 34.3125811985.0, address 84:c5:a6:29:b6:02

My haunch is: "Bios Bug". Probably windows loads firmware that prevents the next load by FreeBSD after warm reboot. Shouldn't windows's firmware load been undone by the BIOS during reboot?
If so, this is strictly not a FreeBSD driver issue (although I would be happy if some fix arrived ;)
Comment 18 Peter Kerr 2021-04-27 20:30:55 UTC
Add to comment #15
After a clean install (not upgrade) of 13.0-RELEASE the problem is still there.
It still looks like bus contention to me. Another way I can stop the ucode loading is to add to /etc/rc.local the following
/usr/sbin/usbconfig -u 0 -a 3 power_save 

Without powersave, with no usb devices plugged in, and cold start, is a useful workaround.
Comment 19 zxystd 2021-05-04 06:08:25 UTC
I have fix this issue in OpenIntelWireless/itlwm project:
https://github.com/OpenIntelWireless/itlwm/commit/1fc63d576975d56578ce2048f00f83e7ca550d97

I am not sure if it is a hardware bug for newer intel wireless card, for 9560ac-cnvi and later Gen2 cards, MSI-X interrupt mode is enable by default, Intel wireless drivers on linux/Windows are supported and using MSI-X interrupt default, when rebooting to freebsd, iwm on freebsd only support MSI interrupt but the hardware is configure as MSI-X, so the interrupt will never happened and caused the issue.
Here are two solutions:
1. Implement MSI-X interrupt mode on iwm.
2. Disable MSI-X when init the hardware, and it is the solution what I am using.

Thanks,
zxystd
Comment 20 Cameron Katri 2021-05-08 18:07:00 UTC
I have a Lenovo Y540 which also has a AC 9560, and was having this issue. I tried cold booting but that didn’t work, what eventually did get it to work consistently is booting while Ethernet is connected, if cold boot with Ethernet my wireless card will work (although sometimes requiring me to restart netif) until I boot into Linux, although sometimes booting FreeBSD working wireless to windows back to FreeBSD will still work.
Comment 21 Vasile Buruiana 2021-09-05 08:24:08 UTC
I found a way to re-create the problem:

########  how to become happy with your FreeBSD ###########

Boot *win, make sure WiFi is working through Intel AC9560 Wireless adapter.

Shut it down (start-shutdown) [OPTIONALLY: remove power cable from PSU, count 10 seconds, insert power cable]. Turn on the system. If FreeBSD is on another hard drive, enter your favorite mainboard firmware interface (BIOS/UEFI), change primary boot device to FreeBSD hard drive, save and exit.  Boot FreeBSD. Surprise - iwm0 is loading:

 
iwm0: <Intel(R) Dual Band Wireless AC 9560> mem 0xb4518000-0xb451bfff at device 20.3 on pci0
iwm0: hw rev 0x310, fw ver 34.3125811985.0, address 28:7f:cf:f1:47:71

kldstat says:
41    1 0xffffffff84ff1000    16c20 if_iwm.ko
42    1 0xffffffff85008000   28df7f iwm9000fw.ko

dhclient works fine. However the data rate is around 3 MBytes/second - meaning it transfers around 2 x 8", 1.2MB ancient floppy disks every single second, or the same speed as a SCSI 1.2" 9-track open reel-to-reel tape drive. Anyway, better than the situation described below.


########  how to become sad ############

Boot *win, test your wifi connection.

RESTART it (no shut down). If FreeBSD is on another hard drive, enter BIOS/UEFI, change boot device to FreeBSD, save and exit.  Boot FreeBSD.

Surprise:

iwm0: <Intel(R) Dual Band Wireless AC 9560> mem 0xea238000-0xea23bfff at device 20.3 on pci0
iwm0: fw chunk addr 0x404000 len 712 failed to load
iwm0: iwm_pcie_load_section: Could not load the [0] uCode section
iwm0: iwm_start_fw: failed 60
iwm0: Failed to start INIT ucode: 60

##############################################
#  read from the beginning to be happy again #
############################################## 

This should be something related to the firmware memory area not being released properly under *win when restarting, but properly released when *win is shutting down. FreeBSD is unable to transfer the uCode because AC9560 does not accept - there is already a firmware loaded inside. 


Please recreate this experiment to confirm.
Comment 22 klmanion 2021-11-13 12:55:24 UTC
(In reply to Vasile Buruiana from comment #21)

I can confirm that I encountered the bug in question after restarting from Windows 10 and subsequently booting into FreeBSD 13.  After shutting down from Windows, FreeBSD was able to successfully create the network interface.