Bug 246998 - iwm: Wireless device not working after resume
Summary: iwm: Wireless device not working after resume
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: wireless (show other bugs)
Version: CURRENT
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-wireless (Nobody)
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2020-06-05 12:14 UTC by Oleksandr Kryvulia
Modified: 2020-06-09 06:52 UTC (History)
3 users (show)

See Also:


Attachments
proposed patch (606 bytes, patch)
2020-06-05 15:13 UTC, Mark Johnston
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oleksandr Kryvulia 2020-06-05 12:14:30 UTC
After suspend/resume wlan device cannot associate with following errors in dmesg:

Jun  5 14:57:31 thinkpad wpa_supplicant[13794]: wlan0: CTRL-EVENT-TERMINATING 
Jun  5 14:57:32 thinkpad wpa_supplicant[15619]: Successfully initialized wpa_supplicant
Jun  5 14:57:32 thinkpad wpa_supplicant[16028]: ioctl[SIOCS80211, op=103, val=0, arg_len=128]: Device not configured
Jun  5 14:57:32 thinkpad kernel: iwm0: radio is disabled by hardware switch
Jun  5 14:57:32 thinkpad kernel: iwm_run_init_ucode: failed 1
Jun  5 14:57:32 thinkpad kernel: iwm_init_hw failed 1
Jun  5 14:57:32 thinkpad kernel: iwm0: iwm_rftoggle_task: rfkill switch, disabling interface
Jun  5 14:57:32 thinkpad wpa_supplicant[16028]: wlan0: CTRL-EVENT-SCAN-FAILED ret=-1 retry=1
Jun  5 14:57:35 thinkpad dhclient[42891]: send_packet: Network is down

Wireless device is 
iwm0@pci0:3:0:0:        class=0x028000 rev=0x63 hdr=0x00 vendor=0x8086 device=0x08b2 subvendor=0x8086 subdevice=0x4270
    vendor     = 'Intel Corporation'
    device     = 'Wireless 7260'
    class      = network
Comment 1 Mark Johnston freebsd_committer 2020-06-05 14:44:29 UTC
Which revision are you running?  r361273 might be relevant.
Comment 2 Oleksandr Kryvulia 2020-06-05 15:06:13 UTC
r361662
Comment 3 Mark Johnston freebsd_committer 2020-06-05 15:13:11 UTC
Created attachment 215252 [details]
proposed patch

Thanks.  Could you please try the attached patch?
Comment 4 Oleksandr Kryvulia 2020-06-05 15:52:29 UTC
Your patch doesn't help, same errors.
Thank you.
Comment 5 Mark Johnston freebsd_committer 2020-06-05 20:10:20 UTC
I'm not able to reproduce this on a laptop with a 8265 chip.  You might try seeing if reverting r361662 fixes the problem.  And of course, make sure that the rfkill switch is not actually engaged. :)
Comment 6 Oleksandr Kryvulia 2020-06-06 06:35:39 UTC
I installed FreeBSD into this laptop (Lenovo Thinkpad E540) in February 2020 and wireless never works after suspend-resume. So my problem is not related to r361662. Pressing wireless switch on keyboard (Fn+F8) doesn't make any difference. Only reboot needed.
Comment 7 Adrian Chadd freebsd_committer 2020-06-06 15:08:29 UTC
hi!

Just try disabling the rfkill path totally:

edit if_iwm_pcie_trans.c, go to the function named iwm_check_rfkill() and change "return rv" to "return 0".

I dont' know if the hardware is active or not at this point, but at least we'll know it's not because it's getting a spurious rfkill interrupt or something.
Comment 8 Adrian Chadd freebsd_committer 2020-06-06 15:08:49 UTC
hi!

Just try disabling the rfkill path totally:

edit if_iwm_pcie_trans.c, go to the function named iwm_check_rfkill() and change "return rv" to "return 0".

I dont' know if the hardware is active or not at this point, but at least we'll know it's not because it's getting a spurious rfkill interrupt or something.
Comment 9 Oleksandr Kryvulia 2020-06-07 13:44:10 UTC
Hi!
Disabling rfkill doesn't change anything. May be it's related to some ACPI issue?
Comment 10 Andriy Gapon freebsd_committer 2020-06-09 06:52:55 UTC
(In reply to Alexandr Krivulya from comment #9)
Could you try to debug it further?
E.g., you can add printf-s to see why the code decides that "radio is disabled by hardware switch" and so on.

Nobody else can reproduce this problem, so unless you debug your issue, there's a little chance that it would be fixed.