suspend / resume

2009-03-09 Thread Davide
Hi,

I am using fso on debian.

If I suspend the freerunner with apm -s no problem.

But if the gsm is active  then the freerunner will wakeup
about in a minute ... without I am receiving a call or sms.

Any idea?

Where can I find the event that wake up the phone? Any log?

___
Smartphones-userland mailing list
Smartphones-userland@linuxtogo.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/smartphones-userland


Re: suspend / resume

2009-03-09 Thread Sebastian Reichel
On Mon, Mar 09, 2009 at 06:58:56PM +0100, Davide wrote:
> Hi,
> 
> I am using fso on debian.
> 
> If I suspend the freerunner with apm -s no problem.
> 
> But if the gsm is active  then the freerunner will wakeup
> about in a minute ... without I am receiving a call or sms.
> 
> Any idea?
> 
> Where can I find the event that wake up the phone? Any log?

Hi,

1. You will have to suspend the GSM modem. It would be the easiest
to do this via DBus. Here is a small Python script, which will
suspend the GSM modem *and* your system:

-
#!/usr/bin/python
import dbus, sys, os, gobject

# Setup mainloop and dbus
from dbus.mainloop.glib import DBusGMainLoop
DBusGMainLoop(set_as_default=True)
mainloop = gobject.MainLoop()
bus = dbus.SystemBus()

def getObject( busname, objectpath ):
return bus.get_object( busname, objectpath,
follow_name_owner_changes=True )
def getInterface( busname, objectpath, interface ):
return dbus.Interface(getObject(busname, objectpath), interface)

usageiface  = getInterface( "org.freesmartphone.ousaged",
"/org/freesmartphone/Usage", "org.freesmartphone.Usage" )

usageiface.Suspend()
-


2. You will get the wakeup reason by:
$ cat /sys/class/i2c-adapter/i2c-0/0-0073/neo1973-resume.0/resume_reason | grep 
"*"
In your case it should be "EINT01_GSM"

3. Please be aware of the fact, that the current (2.6.28) debian kernel
will resume with an WSOD, because some of Openmoko's recent patches
are missing.

-- Sebastian Reichel


signature.asc
Description: Digital signature
___
Smartphones-userland mailing list
Smartphones-userland@linuxtogo.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/smartphones-userland


Re: suspend / resume

2009-03-09 Thread Davide
YES!!! YOU ARE RIGHT!!!

With fso suspend all ok! both system and gsm are suspended!
And when a call comes the phone will wake up!

2009/3/9 Sebastian Reichel :
> On Mon, Mar 09, 2009 at 06:58:56PM +0100, Davide wrote:
>> Hi,
>>
>> I am using fso on debian.
>>
>> If I suspend the freerunner with apm -s no problem.
>>
>> But if the gsm is active  then the freerunner will wakeup
>> about in a minute ... without I am receiving a call or sms.
>>
>> Any idea?
>>
>> Where can I find the event that wake up the phone? Any log?
>
> Hi,
>
> 1. You will have to suspend the GSM modem. It would be the easiest
> to do this via DBus. Here is a small Python script, which will
> suspend the GSM modem *and* your system:
>
> -
> #!/usr/bin/python
> import dbus, sys, os, gobject
>
> # Setup mainloop and dbus
> from dbus.mainloop.glib import DBusGMainLoop
> DBusGMainLoop(set_as_default=True)
> mainloop = gobject.MainLoop()
> bus = dbus.SystemBus()
>
> def getObject( busname, objectpath ):
>    return bus.get_object( busname, objectpath,
> follow_name_owner_changes=True )
> def getInterface( busname, objectpath, interface ):
>    return dbus.Interface(getObject(busname, objectpath), interface)
>
> usageiface  = getInterface( "org.freesmartphone.ousaged",
> "/org/freesmartphone/Usage", "org.freesmartphone.Usage" )
>
> usageiface.Suspend()
> -
>
>
> 2. You will get the wakeup reason by:
> $ cat /sys/class/i2c-adapter/i2c-0/0-0073/neo1973-resume.0/resume_reason | 
> grep "*"
> In your case it should be "EINT01_GSM"
>
> 3. Please be aware of the fact, that the current (2.6.28) debian kernel
> will resume with an WSOD, because some of Openmoko's recent patches
> are missing.
>
> -- Sebastian Reichel
>
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEARECAAYFAkm1YHEACgkQH0JwilpTmKhV/wCeOPc43qBc7LlULTC2LIEYduyW
> EGwAn1v3YLOUHy0YDAOqWnf1YezbPbRe
> =KWsS
> -END PGP SIGNATURE-
>
> ___
> Smartphones-userland mailing list
> Smartphones-userland@linuxtogo.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/smartphones-userland
>
>

___
Smartphones-userland mailing list
Smartphones-userland@linuxtogo.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/smartphones-userland


Re: suspend / resume

2009-03-09 Thread Timo Juhani Lindfors
Sebastian Reichel  writes:
> to do this via DBus. Here is a small Python script, which will

I use

mdbus -s org.freesmartphone.ogsmd /org/freesmartphone/GSM/Device 
org.freesmartphone.Resource.Suspend
sleep 4
apm -s
sleep 4
mdbus -s org.freesmartphone.ogsmd /org/freesmartphone/GSM/Device 
org.freesmartphone.Resource.Resume

in my suspend script.

> 3. Please be aware of the fact, that the current (2.6.28) debian kernel
> will resume with an WSOD, because some of Openmoko's recent patches
> are missing.

Which ones? I am running recent andy-tracking and I need the "sleep 4"
there or Xglamo will hit http://docs.openmoko.org/trac/ticket/1315



___
Smartphones-userland mailing list
Smartphones-userland@linuxtogo.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/smartphones-userland


Re: suspend / resume

2009-03-09 Thread Sebastian Reichel
On Mon, Mar 09, 2009 at 09:39:38PM +0200, Timo Juhani Lindfors wrote:
> > 3. Please be aware of the fact, that the current (2.6.28) debian kernel
> > will resume with an WSOD, because some of Openmoko's recent patches
> > are missing.
> 
> Which ones? I am running recent andy-tracking and I need the "sleep 4"
> there or Xglamo will hit http://docs.openmoko.org/trac/ticket/1315

Well - I think I tracked my WSOD down to the fact, that it always
happens when I suspend while the display is disabled. I'm also using
qi. This sounds like [1], so I hope it will be fixed when the 2.6.29
Debian kernel arrives :)

-- Sebastian

[1] 
http://git.openmoko.org/?p=kernel.git;a=commit;h=83cf37799009f6a3db4fef141c798c876124954f


signature.asc
Description: Digital signature
___
Smartphones-userland mailing list
Smartphones-userland@linuxtogo.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/smartphones-userland


HTC Dream Suspend/Resume (was: HTC Dream status ?)

2010-04-05 Thread Michael 'Mickey' Lauer
More updates here...

> The truth is, obviously in our 2.6.32 for some reason that is unknown,
> we don't get the "freezing tasks... CPU halted" messages, which probably
> means the earlysuspend (android invention :/) or the wakelocks (android
> invention :/) are giving us problems / aborting the suspend / whatever.

Once I removed the usb vbus wakelock in htc_battery.c, the freezing
tasks started to appear (which is good). The bad thing is it is then
stuck in a suspend/resume loop -- it immediately resumes after suspend.
(Yes, I even removed all wakelocks from the defconfig to make sure they
don't interfere).

I'm lucky I got so far, but now I really need some help from kernel
people.

-- 
:M:


___
Smartphones-userland mailing list
Smartphones-userland@linuxtogo.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/smartphones-userland


make suspend/resume not kill ssh connections with wlan

2009-10-23 Thread Timo Juhani Lindfors
Hi,

I realized that automatic suspend would be much more useful if it did
not kill my ssh connections over wlan. It seems that kernel does not
restore the state of wlan networking on resume. It seems I can do this
in userland. I added a few lines to a suspend hook:

essid="$(iwconfig eth0 | tr ' ' '\n' | grep ESSID | cut -d':' -f2|sed 
's/^.//;s/.$//;')"
ap="$(iwconfig eth0 | grep 'Access Point'|cut -d':' -f4-|cut -d' ' -f2)"
ip="$(ip addr show eth0 | grep inet | awk '{print $2}'|cut -d'/' -f1)"
ip route | grep eth0 > /tmp/eth0-routes

and a few lines to resume hook:

iwconfig eth0 essid "$essid"
iwconfig eth0 ap "$ap"
ifconfig eth0 "$ip"
cat /tmp/eth0-routes | while read route; do
ip route replace $route
done

and now my ssh connections don't die if I suspend the phone for a
while. Is there some already existing software that should do this?
Should kernel restore these parameters?

-Timo

___
Smartphones-userland mailing list
Smartphones-userland@linuxtogo.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/smartphones-userland


Re: HTC Dream Suspend/Resume (was: HTC Dream status ?)

2010-04-09 Thread Alain2210
Hello,

Selon Michael 'Mickey' Lauer :

> More updates here...
>
> > The truth is, obviously in our 2.6.32 for some reason that is unknown,
> > we don't get the "freezing tasks... CPU halted" messages, which probably
> > means the earlysuspend (android invention :/) or the wakelocks (android
> > invention :/) are giving us problems / aborting the suspend / whatever.
>
> Once I removed the usb vbus wakelock in htc_battery.c, the freezing
> tasks started to appear (which is good). The bad thing is it is then
> stuck in a suspend/resume loop -- it immediately resumes after suspend.
> (Yes, I even removed all wakelocks from the defconfig to make sure they
> don't interfere).

I have only removed the wake_lock from kernel config and can see the
suspend/resume operation, but it also resumes after suspend saying :

msm_sleep(): mode 0 delay 0 idle 0
msm_sleep(): enter A11S_CLK_SLEEP_EN 0, A11S_PWRDOWN 1, smsm_get_state 10ca9
msm_sleep(): vector ea0e 35392e30 -> e51ff004 10030a28
msm_pm_collapse(): returned 0

but this last line seems to say the the suspend was not done (according to pm.c
it should be 1). However this part is in assembler and I do not understand
how the return value is choosen.

Moreover on openezx there was a register giving the argument of resume. I have
not found it.

By the way, I do not succeed in making wiki work : I do not see the loading in
/sys/class/firmware/ and in dmesg, I see a lot of mmc0 error.

(I use the recent gnu-conform kernel and an "old" rootfs)

Thanks,

Alain

___
Smartphones-userland mailing list
Smartphones-userland@linuxtogo.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/smartphones-userland


Re: HTC Dream Suspend/Resume (was: HTC Dream status ?)

2010-04-09 Thread Alain2210
Hello,

sorry partial answer to myself about wifi (nothing about suspend)
>
> By the way, I do not succeed in making wiki work : I do not see the loading
> in
> /sys/class/firmware/ and in dmesg, I see a lot of mmc0 error.
>

the bug was in the rootfs (build some times ago from OE) : in
/etc/udev there was two rules for firmware.sh
With one rules, it works (with some kernel oops) only loading modules.

Thanks,

alain

___
Smartphones-userland mailing list
Smartphones-userland@linuxtogo.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/smartphones-userland


Re: HTC Dream Suspend/Resume (was: HTC Dream status ?)

2010-04-09 Thread Michael 'Mickey' Lauer
Hi Alain,

> the bug was in the rootfs (build some times ago from OE) : in
> /etc/udev there was two rules for firmware.sh
> With one rules, it works (with some kernel oops) only loading modules.

It's not an OOPS, just a WARNING. For what it's worth, fsodeviced has
now a firmwareloader plugin as well, so if you don't want udev, you can
use fsodevice and enable the loader with

[fsodevice.kernel26_firmwareloader] in fsodeviced.conf.

Ok, back to Wifi, it's good and bad now. It works fine until you
ifconfig wlan0 down, then it crashes and will subsequently lead to a
full hang (can't reboot or turn off the device until you take the
battery out).

Suspend/Resume is still under investigation, GNUtoo (Denis) is working
on it. If you don't mind, we talk a lot about that on #htc-linux and
#openmoko-cdevel, feel invited to join IRC, if you want.

Cheers,


-- 
:M:


___
Smartphones-userland mailing list
Smartphones-userland@linuxtogo.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/smartphones-userland


Re: HTC Dream Suspend/Resume (was: HTC Dream status ?)

2010-04-09 Thread Alain2210
Hello,

Selon Michael 'Mickey' Lauer :

> Hi Alain,
>
> > the bug was in the rootfs (build some times ago from OE) : in
> > /etc/udev there was two rules for firmware.sh
> > With one rules, it works (with some kernel oops) only loading modules.
>
> It's not an OOPS, just a WARNING. For what it's worth, fsodeviced has
> now a firmwareloader plugin as well, so if you don't want udev, you can
> use fsodevice and enable the loader with
>
> [fsodevice.kernel26_firmwareloader] in fsodeviced.conf.

Ok, I still use an old image. I will try do build an recent fso2/zhone2.

>
> Ok, back to Wifi, it's good and bad now. It works fine until you
> ifconfig wlan0 down, then it crashes and will subsequently lead to a
> full hang (can't reboot or turn off the device until you take the
> battery out).

I succeed in logging with ssh and do a /sbin/halt (which by the way does not
halt the phone...)

>
> Suspend/Resume is still under investigation, GNUtoo (Denis) is working
> on it. If you don't mind, we talk a lot about that on #htc-linux and
> #openmoko-cdevel, feel invited to join IRC, if you want.
>

This morning I have read the last 3 days of irc-log of #htc-linux. I'm connected
also since 2 hours.

Thanks,

Alain



___
Smartphones-userland mailing list
Smartphones-userland@linuxtogo.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/smartphones-userland


Re: make suspend/resume not kill ssh connections with wlan

2009-10-23 Thread Joachim Breitner
Hi,

Am Freitag, den 23.10.2009, 13:03 +0300 schrieb Timo Juhani Lindfors:
> Is there some already existing software that should do this?
> Should kernel restore these parameters? 

what if you move between WLANs while suspending? 

I’d say a program like wpasupplicant should handle this intelligently,
e.g. after resume check if the same WLAN is in range and then quickly
re-connect, and otherwise just look for new WLANs. But I’m not sure if
it does this already. At least on my laptop, I often have to re-load the
WLAN driver after suspend anyways, to get back in quickly.

Greetings,
Joachim


-- 
Joachim "nomeata" Breitner
  mail: m...@joachim-breitner.de | ICQ# 74513189 | GPG-Key: 4743206C
  JID: nome...@joachim-breitner.de | http://www.joachim-breitner.de/
  Debian Developer: nome...@debian.org


signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil
___
Smartphones-userland mailing list
Smartphones-userland@linuxtogo.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/smartphones-userland


Re: make suspend/resume not kill ssh connections with wlan

2009-10-23 Thread Timo Juhani Lindfors
Joachim Breitner  writes:
> what if you move between WLANs while suspending? 

Good point. I guess I could add logic to use "iwlist" to check if the
$ap is still within range?

> I’d say a program like wpasupplicant should handle this intelligently,
> e.g. after resume check if the same WLAN is in range and then quickly
> re-connect, and otherwise just look for new WLANs. But I’m not sure if

But if "re-connect" means new DHCP query then the IP could change?

-Timo

___
Smartphones-userland mailing list
Smartphones-userland@linuxtogo.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/smartphones-userland


Re: make suspend/resume not kill ssh connections with wlan

2009-10-23 Thread Stefan Monnier
> But if "re-connect" means new DHCP query then the IP could change?

Yes, tho many DHCP clients are clever enough to send the previously used
IP to the DHCP server, so the server can give them the same IP as
last time (and some DHCP servers try to do that on their own based on
the mac address).
I.e. if your IP changes every time you connect, maybe there's a way to
address this directly by changing your DHCP server or client.


Stefan



___
Smartphones-userland mailing list
Smartphones-userland@linuxtogo.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/smartphones-userland