Bug 15164

Summary: iwlagn doesn't work after resume - acer_wmi rfkill state not restored - Lenovo Ideapad u330
Product: Drivers Reporter: Michał Witkowski (neuro)
Component: PlatformAssignee: Carlos Corbacho (carlos)
Status: CLOSED CODE_FIX    
Severity: normal CC: acpi-bugzilla, alan, lenb, linville, rjw, rui.zhang
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.33-rc5 Subsystem:
Regression: No Bisected commit-id:
Bug Depends on:    
Bug Blocks: 56331    
Attachments: dmesg after resume in 2.6.33-rc5
dmesg after iwlagn, iwlcore, cfg80211 reload

Description Michał Witkowski 2010-01-28 20:14:58 UTC
Hi,

This is my first bug report so please be forigiving ;) i've got a Lenovo Ideapad u330.

When testing a new kernel (vanilla 2.6.33-rc5) i notived that my Intel 5100 AGN wifi stopped working after resume.

It wouldn't even start workign after reloading cfg80211, iwlcore and iwlagn. Whenever I tried upping the interface (necessary for example for scanning) I got:
SIOCSIFFLAGS: Unknown error 132

And this is the only error I've got _anywhere_. After resume, the card is simple dead under 2.6.33-rc5.

Please note, under 2.6.32.5 everything works fine. I attach dmesg output of init under 2.6.33-rc5, after resume and after reloading modules. To my knowledge, none of these provide any clues... Sometimes, during initialization it gives an error:

iwlagn 0000:03:00.0: firmware: requesting iwlwifi-5000-2.ucode
NET: Registered protocol family 10
iwlagn 0000:03:00.0: loaded firmware version 8.24.2.12
iwlagn 0000:03:00.0: Could not load the INST uCode section due to interrupt
iwlagn 0000:03:00.0: Unable to set up bootstrap uCode: -512
iwlagn 0000:03:00.0: Could not load the INST uCode section due to interrupt
iwlagn 0000:03:00.0: Unable to set up bootstrap uCode: -512
iwlagn 0000:03:00.0: Could not load the INST uCode section due to interrupt
iwlagn 0000:03:00.0: Unable to set up bootstrap uCode: -512
iwlagn 0000:03:00.0: Could not load the INST uCode section due to interrupt
iwlagn 0000:03:00.0: Unable to set up bootstrap uCode: -512
iwlagn 0000:03:00.0: Could not load the INST uCode section due to interrupt
iwlagn 0000:03:00.0: Unable to set up bootstrap uCode: -512
iwlagn 0000:03:00.0: Unable to initialize device after 5 attempts.

Regardles of whether or not these things appear on init, iwlagn works on kernel 2.6.33-rc5 until I suspend/resume.
Comment 1 Michał Witkowski 2010-01-28 20:15:41 UTC
Created attachment 24767 [details]
dmesg after resume in 2.6.33-rc5
Comment 2 Michał Witkowski 2010-01-28 20:16:32 UTC
Created attachment 24768 [details]
dmesg after iwlagn, iwlcore, cfg80211 reload
Comment 3 John W. Linville 2010-01-28 20:28:41 UTC
iwlagn 0000:03:00.0: RF_KILL bit toggled to disable radio.

You have turned-on RF kill (i.e. disabled your wireless LAN)...
Comment 4 Michał Witkowski 2010-01-28 21:23:24 UTC
Ok, I've checked.
Suspend is done by echo "mem" > /sys/power/state under both kernels, as pm-suspend doesn't work for me on 2.6.33-rc5 (bug 15165).

In kernel 2.6.32.5 I get:
iwlagn 0000:03:00.0: RF_KILL bit toggled to enable radio.

In kernel 2.6.33-rc5 I get:
iwlagn 0000:03:00.0: RF_KILL bit toggled to disable radio.

I've dug around and found what changed the situation. I don't know why, but acer_wmi gets loaded under 2.6.33-rc5 and it doesn't under 2.6.32.5. It exposes a rfkill interface in /sys which allows me to switch my wifi back on.

I don't know why my Lenovo U330 suddenly started loading acer_wmi with kernel 2.6.33. While investigating my DSDT table, I've noticed that it has something similar to the WMI interface of acer_wmi, but AFAIK noone ever paid attention.

Now my question is: should I keep acer_wmi (the wifi RFKILL works)? And if so, how can I change it's behaviour so that the rfkill gets reset to true after resume?

Note: could this be moved to the ACPI/wmi/acer department instead of networking? I'm sorry for wrong posting this.
Comment 5 Rafael J. Wysocki 2010-02-01 21:19:20 UTC
Moving.
Comment 6 Zhang Rui 2010-03-10 03:22:04 UTC
ping carlos ...
Comment 7 Zhang Rui 2010-03-25 06:18:50 UTC
ping carlos

and Michal,
please verify the problem still exists in the latest upstream kernel, :p.
Comment 8 Carlos Corbacho 2010-03-27 19:11:52 UTC
The change that cased acer-wmi to load is down to the autoloading for ACPI-WMI drivers being fixed recently to work properly - I've been aware for a while now of certain Lenovo and other makes of laptops that work with acer-wmi.

It looks like acer-wmi might need to set the persistent flag to 'false' on the rfkill devices to force rfkill to restore the state on resume - rfkill doesn't appear to do this by default on resume, though I thought it did.

However, at least from testing on my own old Acer laptop, this hasn't been necessary before, since after resume rfkill was still in the correct state...

I'll see if I can produce a patch that at least doesn't break things here, and then attach it here for testing.