Comment 4 for bug 698331

Revision history for this message
Martin Pitt (pitti) wrote :

While I can't replicate the actual suspend problem on my X201 running current Natty, I confirm that the pm-utils hook doesn't immediately release the module, as writing to the file in /proc is not synchronous. Adding some debugging output to the hook reveals:

=== before ===-
--- /proc/acpi/ibm/bluetooth ----
status: enabled
commands: enable, disable
--- rfkill ---
0: tpacpi_bluetooth_sw: Bluetooth
 Soft blocked: no
 Hard blocked: no
1: tpacpi_wwan_sw: Wireless WAN
 Soft blocked: no
 Hard blocked: no
2: phy0: Wireless LAN
 Soft blocked: no
 Hard blocked: no
10: hci0: Bluetooth
 Soft blocked: no
 Hard blocked: no
--- lsmod ---
btusb 18600 2

=== after ===-
--- /proc/acpi/ibm/bluetooth ----
status: disabled
commands: enable, disable
--- rfkill ---
0: tpacpi_bluetooth_sw: Bluetooth
 Soft blocked: yes
 Hard blocked: no
1: tpacpi_wwan_sw: Wireless WAN
 Soft blocked: no
 Hard blocked: no
2: phy0: Wireless LAN
 Soft blocked: no
 Hard blocked: no
10: hci0: Bluetooth
 Soft blocked: no
 Hard blocked: no
--- lsmod ---
btusb 18600 2

=== after 0.5 s ===-
--- /proc/acpi/ibm/bluetooth ----
status: disabled
commands: enable, disable
--- rfkill ---
0: tpacpi_bluetooth_sw: Bluetooth
 Soft blocked: yes
 Hard blocked: no
1: tpacpi_wwan_sw: Wireless WAN
 Soft blocked: no
 Hard blocked: no
2: phy0: Wireless LAN
 Soft blocked: no
 Hard blocked: no
--- lsmod ---
btusb 18600 0

I. e. merely sleeping for 0.5 seconds after writing the proc file helps. I'll write a better hook which waits for the module to get unused.