Bug 282789 - iwlwifi hangs on boot with request_module_nowait("iwlmvm") -- broken after 2ac644317e671b001d3fb8fd924a1ae808a0bf32
Summary: iwlwifi hangs on boot with request_module_nowait("iwlmvm") -- broken after 2a...
Status: In Progress
Alias: None
Product: Base System
Classification: Unclassified
Component: wireless (show other bugs)
Version: CURRENT
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Bjoern A. Zeeb
URL:
Keywords: regression
Depends on:
Blocks: iwlwifi
  Show dependency treegraph
 
Reported: 2024-11-15 22:59 UTC by Ruslan Makhmatkhanov
Modified: 2024-11-16 15:54 UTC (History)
3 users (show)

See Also:


Attachments
boot hang (245.02 KB, image/jpeg)
2024-11-15 22:59 UTC, Ruslan Makhmatkhanov
no flags Details
ctrl+t (284.08 KB, image/jpeg)
2024-11-15 23:30 UTC, Ruslan Makhmatkhanov
no flags Details
verbose boot (302.05 KB, image/jpeg)
2024-11-15 23:30 UTC, Ruslan Makhmatkhanov
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ruslan Makhmatkhanov freebsd_committer freebsd_triage 2024-11-15 22:59:25 UTC
Created attachment 255206 [details]
boot hang

Hello, that's the last revision when my wireless connection worked:

==========
commit 65691b2dafda23691c3989749def755a98e731ec (HEAD)
Author: Robert William Vesterman <bob@vesterman.com>
Date:   Thu Oct 17 22:54:39 2024 -0400

	libexec/rc/rc.d/netif: Typo fix
==========

If I fetch the next couple of wifi related commits, then system just stops booting at iwlwifi initialization stage. See attached screenshot.

Minimal commit I tested, after that wifi breaks is:

==========
commit 878ede1a0d0f10f851b2bc54be1e28f512bfc016
Author: Mark Johnston <markj@FreeBSD.org>
Date:   Mon Oct 28 13:51:58 2024 +0000

    fstyp: Fix some memory safety bugs
==========


Last commit I tested, to not avail:
==========
commit 12fc79619acaa3041f9c032bc9afe7d2005b942e (HEAD -> main, origin/main, origin/HEAD)
Author: Randall Stewart <rrs@FreeBSD.org>
Date:   Fri Nov 15 12:37:05 2024 -0500

    Change the SOCKBUF_LOCK calls to use the more refined SOCK_XXXBUF_LOCK/UNLOCK.
==========

I also tried to install wifi-firmware-iwlwifi-kmod-20241017_1.

That's my adapter:
==========
iwlwifi0@pci0:0:20:3:	class=0x028000 rev=0x00 hdr=0x00 vendor=0x8086 device=0x02f0 subvendor=0x8086 subdevice=0x0070
    vendor     = 'Intel Corporation'
    device     = 'Comet Lake PCH-LP CNVi WiFi'
    class      = network
==========

Since I don't see any complains in mailing list about this issue, it looks like something my particular chipset, so please help me to figure out what's wrong.
Comment 1 Bjoern A. Zeeb freebsd_committer freebsd_triage 2024-11-15 23:14:35 UTC
(a) can you power off your machine entirely and try again  (do you do any dual-boot or wifi passthru)?  I had one (private) report which was exactly like yours and solved that way by the user.

(b) if it doesn't help please do a boot -v (bootverbose) and/or if the hang persists would be interesting to know where/what.  Does ^T reveal anything; if not can you use the debugger and check?
Comment 2 Ruslan Makhmatkhanov freebsd_committer freebsd_triage 2024-11-15 23:29:43 UTC
(In reply to Bjoern A. Zeeb from comment #1)
a) yes, I have windows as second system, but there are no issues with that with kernel prior 2ac644317e671. I tried to power off twice, but nothing changed. Enter and ^T are working, but ctrl+alt+del is not, so the only I can do is poweroff by button.

b) bootverbose doesn't shed any light as I can say. Nor ^T - just LA entry. I attached screenshots for these. I can use debugger if you tell me what to do. I have not experience with that.
Comment 3 Ruslan Makhmatkhanov freebsd_committer freebsd_triage 2024-11-15 23:30:08 UTC
Created attachment 255208 [details]
ctrl+t
Comment 4 Ruslan Makhmatkhanov freebsd_committer freebsd_triage 2024-11-15 23:30:28 UTC
Created attachment 255209 [details]
verbose boot
Comment 5 Bjoern A. Zeeb freebsd_committer freebsd_triage 2024-11-16 01:10:42 UTC
You know how you get past this issue (boot -s, mount -uw /, edit /etc/rc.conf setting devmatch_blocklist="if_iwlwifi" to avoid it being loaded automatically, exit) ...?

I'll drop you some debugging and other changes to try privately.
Comment 6 Tomoaki AOKI 2024-11-16 13:07:26 UTC
The same happenes when updated main, amd64
 from: commit 439fa16e1fd35181898b61264b205bf3b7103a41
 to:   commit 566c039d1e7555343fcf6439a10e56f5a632c0fe

For me, even ctrl-alt-del doesn't work and needed forcible power off.
Blocklisting if_iwlwifi allowed me to boot sanely.


Old hardware probe (of the exactly same computer, except attached USB devices.
No NIC is attached via USB.) is at URL below.

http://bsd-hardware.info/?probe=676f16ac86
Comment 7 Bjoern A. Zeeb freebsd_committer freebsd_triage 2024-11-16 15:54:11 UTC
Ruslan sent me debug information and I do now understand where the problem comes from but not yet why it only happens for some chipsets only.

Or possibly not chipsets but something else;  the entire order is triggered from SYSINITs via module_init;  in the cases of hang iwl_mvm_init() has not run (or not run to completion).

For cards here it looks like (with XXX-BZ printfs added to show the problem)

------
Autoloading module: if_iwlwifi                                                                                                                               
Intel(R) Wireless WiFi based driver for FreeBSD                                                                                                              
XXX-BZ iwl_opmode_register:1933: name 'iwlmvm' ops 0xffffffff82ba6d38                                                                                        
XXX-BZ iwl_opmode_register:1940: name 'iwlmvm' ops 0xffffffff82ba6d38 op 0xffffffff82baf0e0

^^^^ this is missing for the people with "hangs"
                                                                  
pci0: driver added                                                                                                                                           
found-> vendor=0x8086, dev=0x2725, revid=0x1a                                                                                                                
        domain=0, bus=0, slot=5, func=0                                                                                                                      
        class=02-80-00, hdrtype=0x00, mfdev=0                                                                                                                
        cmdreg=0x0407, statreg=0x0010, cachelnsz=0 (dwords)                                                                                                  
        lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)                                                                                         
        powerspec 3  supports D0 D3  current D0                                                                                                              
        MSI supports 1 message, 64 bit                                                                                                                       
        MSI-X supports 16 messages in map 0x10                                                                                                               
pci0:0:5:0: reprobing on driver added                                                                                                                        
iwlwifi0: <iwlwifi> mem 0x800010000-0x800013fff at device 5.0 on pci0                                                                                        
iwlwifi0: attempting to allocate 6 MSI-X vectors (16 supported)                                                                                              
msi: routing MSI-X IRQ 60 to local APIC 0 vector 57                                                                                                          
msi: routing MSI-X IRQ 61 to local APIC 1 vector 51                                                                                                          
msi: routing MSI-X IRQ 62 to local APIC 2 vector 52                                                                                                          
msi: routing MSI-X IRQ 63 to local APIC 3 vector 51                                                                                                          
msi: routing MSI-X IRQ 64 to local APIC 0 vector 58                        
msi: routing MSI-X IRQ 65 to local APIC 1 vector 52                                                                                                          
iwlwifi0: using IRQs 60-65 for MSI-X                                                                                                                         
iwlwifi0: Detected crf-id 0x400410, cnv-id 0x400410 wfpm id 0x80000000                                                                                       
iwlwifi0: PCI dev 2725/0024, rev=0x420, rfid=0x10d000                                                                                                        
iwlwifi0: Detected Intel(R) Wi-Fi 6 AX210 160MHz                                                                                                             
...
------

And so for the people where it does not work:

in iwl_req_fw_callback op->ops is not defined and it tries to load the ilwmvm module ( which we don't have given we never split the driver given we do not have dwm support ).

I'll go and investigate why we never make it to the second SYSINIT.