Re: Re: [Sugar-devel] Patch: Mobile dongles

2012-03-27 Thread forster
Paul

Keeping the dongle powered also happens with automatic power management on the 
1.75 (ie 15 seconds with no input). Same problem though, keyboard or trackpad 
input to wake up powers down the dongle.

It takes 35 seconds for the dongle to appear in the frame, then user input is 
required, more waiting, a total time of 65 seconds to make a connection.

The Huawei is rated at <= 500mA or 2.5W. That is presumably a peak rating, it 
is slightly warm to touch, my guess 1W or a little less average. I think not 
worth keeping powered during power switch initiated sleep.

You say "the hardware control is all or none' I took that to mean all 3 USB 
ports, but in suspend, it has the memory stick light out but the dongle light 
on. (the light may respond to data as well as power).

There is a case for powering the USB ports whenever a USB device is connected 
(automatic power management suspend not power switch initated sleep), it is 
impossible to know the characteristics of every USB device and whether they 
will recover gracefully to power interuption. If the user wanted best battery 
life they wouldnt leave a power hungry USB device plugged in.

Tony

> fors...@ozonline.com.au wrote:
>  > Paul
>  > 
>  > Tried this with a XO-1.75 and a XO-1.5 both running OS31
>  > Tried a Huawei mobile dongle, a memory stick and a mouse
>  > 
>  > The only case where a USB device remains powered during sleep is the 
> mobile 
>  > dongle on the 1.75
> 
> 
> huh.  okay, well, 1.75 is the first of the XO models that has the
> ability to leave the USB ports powered (and i assume they all do when
> the mobile dongle is used - the hardware control is all or none).  i
> guess that driver is talking to the USB stack somehow to accomplish
> this.
> 
> next question:  is this the right behavior?  if the dongle weren't
> power cycled during resume, i guess that might be a good thing?
> 
> paul
> 
>  > 
>  > Tony
>  > 
>  > > fors...@ozonline.com.au wrote:
>  > >  > Thanks
>  > >  > 
>  > >  > I have noticed another issue with the mobile dongle.  OS31, XO-1.75
>  > >  > Press the power button once and wait for sleep.  The dongle remains
>  > > 
>  > > this is very surprising.  do other USB devices remain powered when the
>  > > laptop sleeps?  we've done nothing intentional to change this (or fix 
> this,
>  > > depending on your point of view :-) in this release. 
>  > > 
>  > > paul
>  > > 
>  > >  > powered on (which is a good or bad thing depending on your point of
>  > >  > view), then press the power button to wake the laptop, the dongle
>  > >  > is briefly turned off and the connection is lost, negating any
>  > >  > benefit from keeping it powered during sleep.
>  > >  > 
>  > >  > Tony
>  > >  > 
>  > > =-
>  > >  paul fox, p...@laptop.org
>  > > ___
>  > > Sugar-devel mailing list
>  > > sugar-de...@lists.sugarlabs.org
>  > > http://lists.sugarlabs.org/listinfo/sugar-devel
>  > > 
>  > > _
>  > > This mail has been virus scanned by Australia On Line
>  > > see http://www.australiaonline.net.au/mailscanning
> 
> =-
>  paul fox, p...@laptop.org
> 
> _
> This mail has been virus scanned by Australia On Line
> see http://www.australiaonline.net.au/mailscanning

___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: [Sugar-devel] Patch: Mobile dongles

2012-03-27 Thread James Cameron
On Tue, Mar 27, 2012 at 10:17:16AM -0400, Paul Fox wrote:
> huh.  okay, well, 1.75 is the first of the XO models that has the
> ability to leave the USB ports powered (and i assume they all do when
> the mobile dongle is used - the hardware control is all or none).  i
> guess that driver is talking to the USB stack somehow to accomplish
> this.

interesting.  that might mean we could provide USB mouse wakeup support
on XO-1.75 by tweaking the kernel.

> next question:  is this the right behavior?  if the dongle weren't
> power cycled during resume, i guess that might be a good thing?

it is a radio and controller that associates with a radio network as
soon as it is powered.  this association requires a bit of time, of the
order of a few seconds, and some transmissions at various power levels.
once associated there's an occasional brief transmission to keep the
radio network informed; a kind of keep-alive.

the HSPA term for the association is "attached".

establishing an IP connection is a separate step.

so a power cycle increases the time taken to establish a connection, and
possibly increases the total power consumed.  on the other hand, this
has to be balanced against the power consumed while the laptop is in
suspend.

the effect of a depowering on the radio network is negative but minor.
an identity slot for the device is held available until the keep-alive
is not answered.

-- 
James Cameron
http://quozl.linux.org.au/
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: [Sugar-devel] Patch: Mobile dongles

2012-03-27 Thread Paul Fox
fors...@ozonline.com.au wrote:
 > Paul
 > 
 > Tried this with a XO-1.75 and a XO-1.5 both running OS31
 > Tried a Huawei mobile dongle, a memory stick and a mouse
 > 
 > The only case where a USB device remains powered during sleep is the mobile 
 > dongle on the 1.75


huh.  okay, well, 1.75 is the first of the XO models that has the
ability to leave the USB ports powered (and i assume they all do when
the mobile dongle is used - the hardware control is all or none).  i
guess that driver is talking to the USB stack somehow to accomplish
this.

next question:  is this the right behavior?  if the dongle weren't
power cycled during resume, i guess that might be a good thing?

paul

 > 
 > Tony
 > 
 > > fors...@ozonline.com.au wrote:
 > >  > Thanks
 > >  > 
 > >  > I have noticed another issue with the mobile dongle.  OS31, XO-1.75
 > >  > Press the power button once and wait for sleep.  The dongle remains
 > > 
 > > this is very surprising.  do other USB devices remain powered when the
 > > laptop sleeps?  we've done nothing intentional to change this (or fix this,
 > > depending on your point of view :-) in this release. 
 > > 
 > > paul
 > > 
 > >  > powered on (which is a good or bad thing depending on your point of
 > >  > view), then press the power button to wake the laptop, the dongle
 > >  > is briefly turned off and the connection is lost, negating any
 > >  > benefit from keeping it powered during sleep.
 > >  > 
 > >  > Tony
 > >  > 
 > > =-
 > >  paul fox, p...@laptop.org
 > > ___
 > > Sugar-devel mailing list
 > > sugar-de...@lists.sugarlabs.org
 > > http://lists.sugarlabs.org/listinfo/sugar-devel
 > > 
 > > _
 > > This mail has been virus scanned by Australia On Line
 > > see http://www.australiaonline.net.au/mailscanning

=-
 paul fox, p...@laptop.org
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Re: [Sugar-devel] Patch: Mobile dongles

2012-03-27 Thread forster
Paul

Tried this with a XO-1.75 and a XO-1.5 both running OS31
Tried a Huawei mobile dongle, a memory stick and a mouse

The only case where a USB device remains powered during sleep is the mobile 
dongle on the 1.75

Tony

> fors...@ozonline.com.au wrote:
>  > Thanks
>  > 
>  > I have noticed another issue with the mobile dongle.  OS31, XO-1.75
>  > Press the power button once and wait for sleep.  The dongle remains
> 
> this is very surprising.  do other USB devices remain powered when the
> laptop sleeps?  we've done nothing intentional to change this (or fix this,
> depending on your point of view :-) in this release. 
> 
> paul
> 
>  > powered on (which is a good or bad thing depending on your point of
>  > view), then press the power button to wake the laptop, the dongle
>  > is briefly turned off and the connection is lost, negating any
>  > benefit from keeping it powered during sleep.
>  > 
>  > Tony
>  > 
> =-
>  paul fox, p...@laptop.org
> ___
> Sugar-devel mailing list
> sugar-de...@lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
> 
> _
> This mail has been virus scanned by Australia On Line
> see http://www.australiaonline.net.au/mailscanning

___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: [Sugar-devel] Patch: Mobile dongles

2012-03-26 Thread Jerry Vonau
On Mon, 2012-03-26 at 13:27 -0400, Paul Fox wrote:
> jerry wrote:
>  > On Mon, 2012-03-26 at 11:54 -0400, Paul Fox wrote:
>  > > jerry wrote:
>  > >  > On Mon, 2012-03-26 at 16:44 +1100, fors...@ozonline.com.au wrote:
>  > >  > > David
>  > >  > > 
>  > >  > > This message was sent with a gsm dongle on an xo-1
>  > >  > >  
>  > >  > >  modem:Huawei E160E
>  > >  > >  carrier:Locked to Dodo (an Optus reseller)
>  > >  > >  XO-1
>  > >  > >  OS31 development which is same as os884 signed
>  > >  > >  
>  > >  > >  in my settings, enter username, password, leave *99# unaltered, 
> dodolns1, blank, blank
>  > >  > >  
>  > >  > >  turn off power management, because XO looses connection in sleep 
> mode
>  > >  > 
>  > >  > I have an enhancements to powerd to inhibit suspend for that issue. 
> The
>  > >  > attached proof of concept patch is heavy on tracing, should apply, 
> maybe
>  > >  > with an offset, and needs /etc/powerd/flags/modules-inhibits created
>  > >  > containing usb_wwan. Once usb_wwan is inserted in the kernel, it 
> remains
>  > >  > in memory you can have NM dispatcher or pppd remove the module when 
> the
>  > >  > connection is torn down to restore normal power management operation.
>  > >  > These features are in testable with au210. Sorry 4g images only, with 
> no
>  > >  > firmware in the image. http://build.laptop.org.au/xo/os/latest/
>  > > 
>  > > is presence of the module really the best way to do this?  is it
>  > > possible to look for the presence of the network interface, or maybe
>  > > simply network traffic, or something similar?  
>  > 
>  > In the field test reports are saying the modem is getting reset upon
>  > suspend while the trying to connect. Think the 15 second, 5 second if
>  > your in suspend and don't have any other user activity, sleep loop may
>  > not allow enough time to have the modem complete the pppd handshake and
>  > bring up the interface. 
> 
> who manages the connection?  network manager?  

NetworkManager/modem-manager

> does it announce the connection sequence via dbus?  

They should but I'm unsure or what signals are. 

> powerd-dbus is already listening for
> connection status to prevent sleep during wifi association -- perhaps
> that mechanism can be leveraged.
> 

That would be the best way.

>  > 
>  > > i assume using the
>  > > existing usb-inhibits is impractical because of the variety of
>  > > devices, is that right?
>  > >   
>  > Yes, that is the reason. We want a one-size-fits-all fix where the user
>  > doesn't have to populate any files. 
>  > 
>  > > i guess it would be too much to ask for all
>  > > GSM devices to be in the same USB class.  :-/
>  > > 
>  > What would be the appropriate USB class? Mine comes up as usb-storage at
>  > first and usb_modeswitch has to act on it adding time to the connection
>  > routine. 
>  > 
>  > > (maybe the module presence check is okay -- it just doesn't feel right.)
>  > > 
>  > I think this could be used for other devices also like wedo or usb2vga
>  > maybe.
> 
> perhaps.
> 
> wedo is readily identifiable by vendor, i think -- and why would one
> want it to inhibit suspend?  that seems more like it should be under
> the activity's control.
> 

Think there needs to be a consensus on what should be in powerd and
which activities need to prevent suspend.

> i'd think (but don't know) that usb2vga would be used seldom enough
> that you could either inhibit suspend manually, or change the config
> so it doesn't suspend when plugged in -- i can't imagine using usb2vga
> when you don't have plenty of power available.

Sure untick the box in the applet is a good workaround, like for a usb
modem. ;)

Jerry





___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: [Sugar-devel] Patch: Mobile dongles

2012-03-26 Thread Paul Fox
jerry wrote:
 > On Mon, 2012-03-26 at 11:54 -0400, Paul Fox wrote:
 > > jerry wrote:
 > >  > On Mon, 2012-03-26 at 16:44 +1100, fors...@ozonline.com.au wrote:
 > >  > > David
 > >  > > 
 > >  > > This message was sent with a gsm dongle on an xo-1
 > >  > >  
 > >  > >  modem:Huawei E160E
 > >  > >  carrier:Locked to Dodo (an Optus reseller)
 > >  > >  XO-1
 > >  > >  OS31 development which is same as os884 signed
 > >  > >  
 > >  > >  in my settings, enter username, password, leave *99# unaltered, 
 > > dodolns1, blank, blank
 > >  > >  
 > >  > >  turn off power management, because XO looses connection in sleep mode
 > >  > 
 > >  > I have an enhancements to powerd to inhibit suspend for that issue. The
 > >  > attached proof of concept patch is heavy on tracing, should apply, maybe
 > >  > with an offset, and needs /etc/powerd/flags/modules-inhibits created
 > >  > containing usb_wwan. Once usb_wwan is inserted in the kernel, it remains
 > >  > in memory you can have NM dispatcher or pppd remove the module when the
 > >  > connection is torn down to restore normal power management operation.
 > >  > These features are in testable with au210. Sorry 4g images only, with no
 > >  > firmware in the image. http://build.laptop.org.au/xo/os/latest/
 > > 
 > > is presence of the module really the best way to do this?  is it
 > > possible to look for the presence of the network interface, or maybe
 > > simply network traffic, or something similar?  
 > 
 > In the field test reports are saying the modem is getting reset upon
 > suspend while the trying to connect. Think the 15 second, 5 second if
 > your in suspend and don't have any other user activity, sleep loop may
 > not allow enough time to have the modem complete the pppd handshake and
 > bring up the interface. 

who manages the connection?  network manager?  does it announce the
connection sequence via dbus?  powerd-dbus is already listening for
connection status to prevent sleep during wifi association -- perhaps
that mechanism can be leveraged.

 > 
 > > i assume using the
 > > existing usb-inhibits is impractical because of the variety of
 > > devices, is that right?
 > >   
 > Yes, that is the reason. We want a one-size-fits-all fix where the user
 > doesn't have to populate any files. 
 > 
 > > i guess it would be too much to ask for all
 > > GSM devices to be in the same USB class.  :-/
 > > 
 > What would be the appropriate USB class? Mine comes up as usb-storage at
 > first and usb_modeswitch has to act on it adding time to the connection
 > routine. 
 > 
 > > (maybe the module presence check is okay -- it just doesn't feel right.)
 > > 
 > I think this could be used for other devices also like wedo or usb2vga
 > maybe.

perhaps.

wedo is readily identifiable by vendor, i think -- and why would one
want it to inhibit suspend?  that seems more like it should be under
the activity's control.

i'd think (but don't know) that usb2vga would be used seldom enough
that you could either inhibit suspend manually, or change the config
so it doesn't suspend when plugged in -- i can't imagine using usb2vga
when you don't have plenty of power available.

paul
=-
 paul fox, p...@laptop.org
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: [Sugar-devel] Patch: Mobile dongles

2012-03-26 Thread Jerry Vonau
On Mon, 2012-03-26 at 11:54 -0400, Paul Fox wrote:
> jerry wrote:
>  > On Mon, 2012-03-26 at 16:44 +1100, fors...@ozonline.com.au wrote:
>  > > David
>  > > 
>  > > This message was sent with a gsm dongle on an xo-1
>  > >  
>  > >  modem:Huawei E160E
>  > >  carrier:Locked to Dodo (an Optus reseller)
>  > >  XO-1
>  > >  OS31 development which is same as os884 signed
>  > >  
>  > >  in my settings, enter username, password, leave *99# unaltered, 
> dodolns1, blank, blank
>  > >  
>  > >  turn off power management, because XO looses connection in sleep mode
>  > 
>  > I have an enhancements to powerd to inhibit suspend for that issue. The
>  > attached proof of concept patch is heavy on tracing, should apply, maybe
>  > with an offset, and needs /etc/powerd/flags/modules-inhibits created
>  > containing usb_wwan. Once usb_wwan is inserted in the kernel, it remains
>  > in memory you can have NM dispatcher or pppd remove the module when the
>  > connection is torn down to restore normal power management operation.
>  > These features are in testable with au210. Sorry 4g images only, with no
>  > firmware in the image. http://build.laptop.org.au/xo/os/latest/
> 
> is presence of the module really the best way to do this?  is it
> possible to look for the presence of the network interface, or maybe
> simply network traffic, or something similar?  

In the field test reports are saying the modem is getting reset upon
suspend while the trying to connect. Think the 15 second, 5 second if
your in suspend and don't have any other user activity, sleep loop may
not allow enough time to have the modem complete the pppd handshake and
bring up the interface. 

> i assume using the
> existing usb-inhibits is impractical because of the variety of
> devices, is that right?
>   
Yes, that is the reason. We want a one-size-fits-all fix where the user
doesn't have to populate any files. 

> i guess it would be too much to ask for all
> GSM devices to be in the same USB class.  :-/
> 
What would be the appropriate USB class? Mine comes up as usb-storage at
first and usb_modeswitch has to act on it adding time to the connection
routine. 

> (maybe the module presence check is okay -- it just doesn't feel right.)
> 
I think this could be used for other devices also like wedo or usb2vga
maybe.

Jerry

 

___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Patch: Mobile dongles

2012-03-26 Thread Paul Fox
jerry wrote:
 > On Mon, 2012-03-26 at 16:44 +1100, fors...@ozonline.com.au wrote:
 > > David
 > > 
 > > This message was sent with a gsm dongle on an xo-1
 > >  
 > >  modem:Huawei E160E
 > >  carrier:Locked to Dodo (an Optus reseller)
 > >  XO-1
 > >  OS31 development which is same as os884 signed
 > >  
 > >  in my settings, enter username, password, leave *99# unaltered, dodolns1, 
 > > blank, blank
 > >  
 > >  turn off power management, because XO looses connection in sleep mode
 > 
 > I have an enhancements to powerd to inhibit suspend for that issue. The
 > attached proof of concept patch is heavy on tracing, should apply, maybe
 > with an offset, and needs /etc/powerd/flags/modules-inhibits created
 > containing usb_wwan. Once usb_wwan is inserted in the kernel, it remains
 > in memory you can have NM dispatcher or pppd remove the module when the
 > connection is torn down to restore normal power management operation.
 > These features are in testable with au210. Sorry 4g images only, with no
 > firmware in the image. http://build.laptop.org.au/xo/os/latest/

is presence of the module really the best way to do this?  is it
possible to look for the presence of the network interface, or maybe
simply network traffic, or something similar?  i assume using the
existing usb-inhibits is impractical because of the variety of
devices, is that right?  i guess it would be too much to ask for all
GSM devices to be in the same USB class.  :-/

(maybe the module presence check is okay -- it just doesn't feel right.)

paul
=-
 paul fox, p...@laptop.org
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: [Sugar-devel] Patch: Mobile dongles

2012-03-26 Thread Paul Fox
fors...@ozonline.com.au wrote:
 > Thanks
 > 
 > I have noticed another issue with the mobile dongle.  OS31, XO-1.75
 > Press the power button once and wait for sleep.  The dongle remains

this is very surprising.  do other USB devices remain powered when the
laptop sleeps?  we've done nothing intentional to change this (or fix this,
depending on your point of view :-) in this release. 

paul

 > powered on (which is a good or bad thing depending on your point of
 > view), then press the power button to wake the laptop, the dongle
 > is briefly turned off and the connection is lost, negating any
 > benefit from keeping it powered during sleep.
 > 
 > Tony
 > 
=-
 paul fox, p...@laptop.org
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Re: Patch: Mobile dongles

2012-03-26 Thread forster
Thanks

I have noticed another issue with the mobile dongle. OS31, XO-1.75
Press the power button once and wait for sleep. The dongle remains powered on 
(which is a good or bad thing depending on your point of view), then press the 
power button to wake the laptop, the dongle is briefly turned off and the 
connection is lost, negating any benefit from keeping it powered during sleep.

Tony


> On Mon, 2012-03-26 at 16:44 +1100, fors...@ozonline.com.au wrote:
> > David
> > 
> > This message was sent with a gsm dongle on an xo-1
> >  
> >  modem:Huawei E160E
> >  carrier:Locked to Dodo (an Optus reseller)
> >  XO-1
> >  OS31 development which is same as os884 signed
> >  
> >  in my settings, enter username, password, leave *99# unaltered, dodolns1, 
> > blank, blank
> >  
> >  turn off power management, because XO looses connection in sleep mode
> 
> I have an enhancements to powerd to inhibit suspend for that issue. The
> attached proof of concept patch is heavy on tracing, should apply, maybe
> with an offset, and needs /etc/powerd/flags/modules-inhibits created
> containing usb_wwan. Once usb_wwan is inserted in the kernel, it remains
> in memory you can have NM dispatcher or pppd remove the module when the
> connection is torn down to restore normal power management operation.
> These features are in testable with au210. Sorry 4g images only, with no
> firmware in the image. http://build.laptop.org.au/xo/os/latest/
> 
> Jerry
> 
> _
> This mail has been virus scanned by Australia On Line
> see http://www.australiaonline.net.au/mailscanning

___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel


Patch: Mobile dongles

2012-03-26 Thread Jerry Vonau
On Mon, 2012-03-26 at 16:44 +1100, fors...@ozonline.com.au wrote:
> David
> 
> This message was sent with a gsm dongle on an xo-1
>  
>  modem:Huawei E160E
>  carrier:Locked to Dodo (an Optus reseller)
>  XO-1
>  OS31 development which is same as os884 signed
>  
>  in my settings, enter username, password, leave *99# unaltered, dodolns1, 
> blank, blank
>  
>  turn off power management, because XO looses connection in sleep mode

I have an enhancements to powerd to inhibit suspend for that issue. The
attached proof of concept patch is heavy on tracing, should apply, maybe
with an offset, and needs /etc/powerd/flags/modules-inhibits created
containing usb_wwan. Once usb_wwan is inserted in the kernel, it remains
in memory you can have NM dispatcher or pppd remove the module when the
connection is torn down to restore normal power management operation.
These features are in testable with au210. Sorry 4g images only, with no
firmware in the image. http://build.laptop.org.au/xo/os/latest/

Jerry
diff --git a/powerd b/powerd
index e849f87..d6af071 100755
--- a/powerd
+++ b/powerd
@@ -1237,6 +1237,35 @@ inhibited_by_files()
 inhibit_files_present || filetimes_busy $t1
 }
 
+# let the presence of kernel modules inhibit suspend
+kmod_inhibit()
+{
+kmodconf=$CONFIGFLAGS/modules-inhibits
+
+loadedmodules=$(lsmod)
+
+trace kmod looking for $(cat $kmodconf)
+wanted=$(cat $kmodconf)   
+
+for module in $wanted
+do 
+trace kmod looking at $module
+foundmodule=$(lsmod | grep $module)
+if [ x"$foundmodule" = "x" ]
+then 
+foundmodule=
+trace kmod not found
+else
+trace kmod matched $foundmodule
+# implicit return value
+trace kmod busy: $foundmodule
+return 0
+break
+fi
+done
+return 1
+}
+
 usb_inhibit()
 {
 
@@ -1266,7 +1295,7 @@ general_inhibit()
 
 laptop_busy()
 {
-general_inhibit || usb_inhibit || cpu_or_network_busy
+general_inhibit || usb_inhibit || cpu_or_network_busy || kmod_inhibit
 }
 
 if [ -e $TPAD_RECAL ]
@@ -1794,6 +1823,9 @@ snooze()
 then
 inhibited_by_files && break 2
 
+# check kernel modules against kmod_inhibit
+kmod_inhibit && break 2
+
 # recheck network packets.
 check_network_activity finish && break
 fi
___
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel