[ltp] X301 and suspending the 3G card

Bjørn Mork linux-thinkpad@linux-thinkpad.org
Thu, 12 Feb 2009 21:40:22 +0100


I have a minor problem with suspend/resume on my X301:  The 3G card
(Ericsson F3507g) is always powered off after such a cycle, regardless
of the state before suspend.  I've worked around it by copying the
bluetooth workaround already present in Debian Lenny (I realise this
uses a deprecated interface - that's just because I hope it's a
temporary hack):

bjorn@nemi:~$ cat /etc/pm/sleep.d/49wwan 
#!/bin/sh
# IBM specific hack to disable/enable wwan.

. "${PM_FUNCTIONS}"

[ -f /proc/acpi/ibm/wan ] || exit $NA

suspend_wwan()
{
        if grep -q enabled /proc/acpi/ibm/wan; then
                savestate ibm_wwan enable
                echo disable > /proc/acpi/ibm/wan
        else
                savestate ibm_wwan disable
        fi
}

resume_wwan()
{
        state_exists ibm_wwan || return
        restorestate ibm_wwan > /proc/acpi/ibm/wan
}

case "$1" in
        hibernate|suspend)
                suspend_wwan
                ;;
        thaw|resume)
                resume_wwan
                ;;
        *) exit $NA
                ;;
esac




But I find this solution less than satisfying:

a) It causes the device to be completely disabled, requiring new
   configuration (enable GPS, connect to 3G network) after resume,
b) the device uses a lot of time to boot up,
c) the device gets a new device address on the usb bus for every resume

The most important is a), which makes it really difficult to maintain
state over suspend/resume.  There are *lots* of parameters that can be
tweaked on this card, using AT commands, and I have no idea how to
save/restore them in a reliable way (no, AT&W + ATZ will not do...)

But it's also quite annoying to have to wait an extra 10 seconds after
resume before the 3G card is available again.  The new device address is
only a cosmetic problem, but still...

BTW, the same problem seems to apply to bluetooth, and probably always
has - ref the default workaround implemented in Debian and probably
other distributions too.  It's just not as annoying since the bluetooth
module rarely is configured in any non-default way.

So, any advice on how to avoid the radio module poweroff on suspend is
appreciated.  I tried changing wan_suspend() to use
TP_ACPI_WGSV_PWR_ON_ON_RESUME instead of TP_ACPI_WGSV_PWR_OFF_ON_RESUME
but it didn't seem to make any difference.  I also tried unloading the
thinkpad_acpi module, but the card is always disabled without the module
and I can't find a way to enable it.

Which makes me grateful for the thinkpad_acpi module, which seems
essential for using this card at all...  Thanks for all the good work!



Bjørn
-- 
return -ENOCOFFEE;