Re: [MM] Power down during init

2012-09-20 Thread Marius Kotsbak

Den 19. sep. 2012 07:47, skrev Aleksander Morgado:

On 09/18/2012 08:03 PM, Dan Williams wrote:

Btw, is this expected?:

model: '+CGMM: MF820D'

A bug, the handler code here probably needs to strip out the CGMM if
found.  Most devices don't actually prefix the CGMM response with
+CGMM so the code wasn't built to handle that, either in 05/06 or git
master I guess.

Fixed in git master now.



Thanks. Works fine now. Also the Sierra modem in the 
'power-down-during-init' branch.


--
Marius

___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [MM] Power down during init

2012-09-19 Thread Ben Chan

 How long? I think the timeout is 3 seconds now so maybe it should be
 increased.


could be up to 30s, which is likely a firmware issue.

- Ben
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [MM] Power down during init

2012-09-19 Thread Aleksander Morgado

  I briefly tested the patch on Samsung/Icera Y3300/Y3400 modems.
  Planning to do some more stress tests later this week.
 
 
  I'm assuming the tests went well? :-)
 

 Except for the issue that CFUN+4 can occasionally take a long time
 to finish :(
 
 How long? I think the timeout is 3 seconds now so maybe it should be
 increased.
 

It takes up to 30s in the Samsung/Icera modems, so the callback is
currently set to 40s in the power down of the Icera plugin. Which means
we would be skipping the power-down during init for all Icera-based
modems, unless we can find that the issue is really Samsung/Icera
specific only.

-- 
Aleksander
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [MM] Power down during init

2012-09-19 Thread Aleksander Morgado

 
 We need to run the power-down during init *only* after having checked
 current/modem capabilities. Will update the patch.
 

I pushed a new 'power-down-during-init' branch to the upstream git tree,
including the change of when the power down command is run, so that we
only run it after having loaded capabilities.

Also configured the step with a new modem_init_power_down callback,
which is set to the same implementation of the modem_power_down
callback of each plugin, if any. The only exception right now is the
Icera plugin, due to the CFUN=4 taking too long issue; in this case the
power-down is only run during disabling, not during init.

-- 
Aleksander
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [MM] Power down during init (was: Re: [MM master] Re: [MM06] [PATCH] sierra: use +CFUN=4 for powering down)

2012-09-18 Thread Dan Williams
On Tue, 2012-09-18 at 19:45 +0200, Marius Kotsbak wrote:
 2012/9/18 Aleksander Morgado aleksan...@lanedo.com
 Hey Dan and Marius,
 
 
  Power Up = enabled
  Power Down = disabled
 
  So we already have those states in ModemManager via the
 Enable() method
  and the modem states.  It's just that not all devices
 actually implement
  the low-power mode when disabling, partially because we're
 not always
  sure of the side-effects.
 
 
  The problem here isn't that we don't have a safe power-down
 command; the
  problem is that even if we have it, we don't use it just
 after plugging
  in the modem:
initialized - locked - disabled
 
  But for that 'disabled' state we didn't run the power-down
 command even
  if we have it, so the radio interface may be powered on
 there. That's
  the thing to fix by running the disabling sequence just
 after
  initialization. If there is no default power down command,
 then we would
  run the disabling sequence but without any power down
 command, so no big
  deal.
 
 
 The attached patch runs just a new power-down step during the
 modem
 initialization, to ensure it starts in low power mode. Adding
 a new step
 to run power-down instead of running the whole disabling
 sequence seemed
 a better option, as the disabling sequence really assumes we
 were
 previously enabled. Note that this patch just re-uses the
 power-down
 implementation given in each plugin, which we previously used
 only
 during the disabling sequence.
 
 Given that it's quite a big change, can you guys try it with
 some of the
 modems that we know have given issues before with these
 things? Thinking
 on Sierra modems specifically here. I've got a Wavecom modem
 which also
 had issues with CFUN (e.g. rebooting on CFUN=1 if it was
 already in
 CFUN=1), but won't be able to test it until Friday.
 
 Tested my ZTE MF820D and seems to work nice. Would this be possible to
 backport to MM_06?

It could be, patches accepted unless we get to it first :)

 Btw, is this expected?:
 
 model: '+CGMM: MF820D'

A bug, the handler code here probably needs to strip out the CGMM if
found.  Most devices don't actually prefix the CGMM response with
+CGMM so the code wasn't built to handle that, either in 05/06 or git
master I guess.

Dan


___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [MM] Power down during init (was: Re: [MM master] Re: [MM06] [PATCH] sierra: use +CFUN=4 for powering down)

2012-09-18 Thread Marius Kotsbak
2012/9/18 Marius Kotsbak marius.kots...@gmail.com

 2012/9/18 Aleksander Morgado aleksan...@lanedo.com

 Hey Dan and Marius,

 
  Power Up = enabled
  Power Down = disabled
 
  So we already have those states in ModemManager via the Enable() method
  and the modem states.  It's just that not all devices actually
 implement
  the low-power mode when disabling, partially because we're not always
  sure of the side-effects.
 
 
  The problem here isn't that we don't have a safe power-down command; the
  problem is that even if we have it, we don't use it just after plugging
  in the modem:
initialized - locked - disabled
 
  But for that 'disabled' state we didn't run the power-down command even
  if we have it, so the radio interface may be powered on there. That's
  the thing to fix by running the disabling sequence just after
  initialization. If there is no default power down command, then we would
  run the disabling sequence but without any power down command, so no big
  deal.
 

 The attached patch runs just a new power-down step during the modem
 initialization, to ensure it starts in low power mode. Adding a new step
 to run power-down instead of running the whole disabling sequence seemed
 a better option, as the disabling sequence really assumes we were
 previously enabled. Note that this patch just re-uses the power-down
 implementation given in each plugin, which we previously used only
 during the disabling sequence.

 Given that it's quite a big change, can you guys try it with some of the
 modems that we know have given issues before with these things? Thinking
 on Sierra modems specifically here. I've got a Wavecom modem which also
 had issues with CFUN (e.g. rebooting on CFUN=1 if it was already in
 CFUN=1), but won't be able to test it until Friday.


 Tested my ZTE MF820D and seems to work nice.


But it seems not to work with my Sierra modem in AT mode:

ModemManager[3734]: debug [1347998708.810662] [mm-serial-port.c:929]
mm_serial_port_open(): (ttyUSB3) device open count is 4 (open)
ModemManager[3734]: debug [1347998708.810953] [mm-at-serial-port.c:392]
debug_log(): (ttyUSB3): -- 'ATE0CR'
ModemManager[3734]: debug [1347998708.815802] [mm-at-serial-port.c:392]
debug_log(): (ttyUSB3): -- 'ATE'
ModemManager[3734]: debug [1347998708.822968] [mm-at-serial-port.c:392]
debug_log(): (ttyUSB3): -- '0CR'
ModemManager[3734]: debug [1347998708.824151] [mm-at-serial-port.c:392]
debug_log(): (ttyUSB3): -- 'CRLFOKCRLF'
ModemManager[3734]: debug [1347998708.824446] [mm-serial-port.c:969]
mm_serial_port_close(): (ttyUSB3) device open count is 3 (close)
ModemManager[3734]: debug [1347998708.824688] [mm-at-serial-port.c:392]
debug_log(): (ttyUSB3): -- 'AT+CMEE=1CR'
ModemManager[3734]: debug [1347998708.840464] [mm-at-serial-port.c:392]
debug_log(): (ttyUSB3): -- 'CRLFOKCRLF'
ModemManager[3734]: debug [1347998708.840817] [mm-serial-port.c:969]
mm_serial_port_close(): (ttyUSB3) device open count is 2 (close)
ModemManager[3734]: debug [1347998708.841066] [mm-at-serial-port.c:392]
debug_log(): (ttyUSB3): -- 'AT!pcstate=0CR'
ModemManager[3734]: debug [1347998708.865357] [mm-at-serial-port.c:392]
debug_log(): (ttyUSB3): -- 'CRLFERRORCRLF'
ModemManager[3734]: debug [1347998708.865590] [mm-serial-parsers.c:316]
mm_serial_parser_v1_parse(): Got failure code 100: Unknown error
ModemManager[3734]: debug [1347998708.865743] [mm-iface-modem.c:3025]
initialization_modem_power_down_ready(): Modem initially powered down...

This might be caused by the check if it is CDMA or GSM modem is run before
it knows the answer (see my patch I send in a moment).

--
Marius
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [MM] Power down during init (was: Re: [MM master] Re: [MM06] [PATCH] sierra: use +CFUN=4 for powering down)

2012-09-18 Thread Ben Chan
I briefly tested the patch on Samsung/Icera Y3300/Y3400 modems.
Planning to do some more stress tests later this week.

It may not be a bad idea to allow a plugin to override the
power-down-on-initialization behavior.

Thanks,
Ben

On Tue, Sep 18, 2012 at 7:24 AM, Aleksander Morgado
aleksan...@lanedo.com wrote:
 Hey Dan and Marius,


 Power Up = enabled
 Power Down = disabled

 So we already have those states in ModemManager via the Enable() method
 and the modem states.  It's just that not all devices actually implement
 the low-power mode when disabling, partially because we're not always
 sure of the side-effects.


 The problem here isn't that we don't have a safe power-down command; the
 problem is that even if we have it, we don't use it just after plugging
 in the modem:
   initialized - locked - disabled

 But for that 'disabled' state we didn't run the power-down command even
 if we have it, so the radio interface may be powered on there. That's
 the thing to fix by running the disabling sequence just after
 initialization. If there is no default power down command, then we would
 run the disabling sequence but without any power down command, so no big
 deal.


 The attached patch runs just a new power-down step during the modem
 initialization, to ensure it starts in low power mode. Adding a new step
 to run power-down instead of running the whole disabling sequence seemed
 a better option, as the disabling sequence really assumes we were
 previously enabled. Note that this patch just re-uses the power-down
 implementation given in each plugin, which we previously used only
 during the disabling sequence.

 Given that it's quite a big change, can you guys try it with some of the
 modems that we know have given issues before with these things? Thinking
 on Sierra modems specifically here. I've got a Wavecom modem which also
 had issues with CFUN (e.g. rebooting on CFUN=1 if it was already in
 CFUN=1), but won't be able to test it until Friday.

 Cheers!

 --
 Aleksander

 ___
 networkmanager-list mailing list
 networkmanager-list@gnome.org
 https://mail.gnome.org/mailman/listinfo/networkmanager-list

___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [MM] Power down during init

2012-09-18 Thread Aleksander Morgado

 I briefly tested the patch on Samsung/Icera Y3300/Y3400 modems.
 Planning to do some more stress tests later this week.
 

I'm assuming the tests went well? :-)

 It may not be a bad idea to allow a plugin to override the
 power-down-on-initialization behavior.
 

Not a big deal I guess; given that not all modems support
power-down/low-power properly.

-- 
Aleksander
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [MM] Power down during init

2012-09-18 Thread Aleksander Morgado

 Hey Dan and Marius,
 
 
  Power Up = enabled
  Power Down = disabled
 
  So we already have those states in ModemManager via the
 Enable() method
  and the modem states.  It's just that not all devices
 actually implement
  the low-power mode when disabling, partially because we're
 not always
  sure of the side-effects.
 
 
  The problem here isn't that we don't have a safe power-down
 command; the
  problem is that even if we have it, we don't use it just after
 plugging
  in the modem:
initialized - locked - disabled
 
  But for that 'disabled' state we didn't run the power-down
 command even
  if we have it, so the radio interface may be powered on there.
 That's
  the thing to fix by running the disabling sequence just after
  initialization. If there is no default power down command,
 then we would
  run the disabling sequence but without any power down command,
 so no big
  deal.
 
 
 The attached patch runs just a new power-down step during the modem
 initialization, to ensure it starts in low power mode. Adding a
 new step
 to run power-down instead of running the whole disabling
 sequence seemed
 a better option, as the disabling sequence really assumes we were
 previously enabled. Note that this patch just re-uses the power-down
 implementation given in each plugin, which we previously used only
 during the disabling sequence.
 
 Given that it's quite a big change, can you guys try it with
 some of the
 modems that we know have given issues before with these things?
 Thinking
 on Sierra modems specifically here. I've got a Wavecom modem
 which also
 had issues with CFUN (e.g. rebooting on CFUN=1 if it was already in
 CFUN=1), but won't be able to test it until Friday.
 
 
 Tested my ZTE MF820D and seems to work nice.
 
 
 But it seems not to work with my Sierra modem in AT mode:
 
 ModemManager[3734]: debug [1347998708.810662] [mm-serial-port.c:929]
 mm_serial_port_open(): (ttyUSB3) device open count is 4 (open)
 ModemManager[3734]: debug [1347998708.810953]
 [mm-at-serial-port.c:392] debug_log(): (ttyUSB3): -- 'ATE0CR'
 ModemManager[3734]: debug [1347998708.815802]
 [mm-at-serial-port.c:392] debug_log(): (ttyUSB3): -- 'ATE'
 ModemManager[3734]: debug [1347998708.822968]
 [mm-at-serial-port.c:392] debug_log(): (ttyUSB3): -- '0CR'
 ModemManager[3734]: debug [1347998708.824151]
 [mm-at-serial-port.c:392] debug_log(): (ttyUSB3): -- 'CRLFOKCRLF'
 ModemManager[3734]: debug [1347998708.824446] [mm-serial-port.c:969]
 mm_serial_port_close(): (ttyUSB3) device open count is 3 (close)
 ModemManager[3734]: debug [1347998708.824688]
 [mm-at-serial-port.c:392] debug_log(): (ttyUSB3): -- 'AT+CMEE=1CR'
 ModemManager[3734]: debug [1347998708.840464]
 [mm-at-serial-port.c:392] debug_log(): (ttyUSB3): -- 'CRLFOKCRLF'
 ModemManager[3734]: debug [1347998708.840817] [mm-serial-port.c:969]
 mm_serial_port_close(): (ttyUSB3) device open count is 2 (close)
 ModemManager[3734]: debug [1347998708.841066]
 [mm-at-serial-port.c:392] debug_log(): (ttyUSB3): -- 'AT!pcstate=0CR'
 ModemManager[3734]: debug [1347998708.865357]
 [mm-at-serial-port.c:392] debug_log(): (ttyUSB3): --
 'CRLFERRORCRLF'
 ModemManager[3734]: debug [1347998708.865590]
 [mm-serial-parsers.c:316] mm_serial_parser_v1_parse(): Got failure code
 100: Unknown error
 ModemManager[3734]: debug [1347998708.865743] [mm-iface-modem.c:3025]
 initialization_modem_power_down_ready(): Modem initially powered down...
 
 This might be caused by the check if it is CDMA or GSM modem is run
 before it knows the answer (see my patch I send in a moment).
 

Right you are.

We need to run the power-down during init *only* after having checked
current/modem capabilities. Will update the patch.

-- 
Aleksander
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [MM] Power down during init

2012-09-18 Thread Ben Chan
On Tue, Sep 18, 2012 at 10:05 PM, Aleksander Morgado
aleksan...@lanedo.com wrote:

 I briefly tested the patch on Samsung/Icera Y3300/Y3400 modems.
 Planning to do some more stress tests later this week.


 I'm assuming the tests went well? :-)


Except for the issue that CFUN+4 can occasionally take a long time
to finish :(

Still haven't found the root cause or a better workaround.

 It may not be a bad idea to allow a plugin to override the
 power-down-on-initialization behavior.


 Not a big deal I guess; given that not all modems support
 power-down/low-power properly.

 --
 Aleksander
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [MM] Power down during init

2012-09-18 Thread Aleksander Morgado


 I briefly tested the patch on Samsung/Icera Y3300/Y3400 modems.
 Planning to do some more stress tests later this week.


 I'm assuming the tests went well? :-)

 
 Except for the issue that CFUN+4 can occasionally take a long time
 to finish :(
 
 Still haven't found the root cause or a better workaround.
 

Oh, of course, that... yeah, not ideal :-/

-- 
Aleksander
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [MM] Power down during init

2012-09-18 Thread Aleksander Morgado
On 09/18/2012 08:03 PM, Dan Williams wrote:
  Btw, is this expected?:
  
  model: '+CGMM: MF820D'
 A bug, the handler code here probably needs to strip out the CGMM if
 found.  Most devices don't actually prefix the CGMM response with
 +CGMM so the code wasn't built to handle that, either in 05/06 or git
 master I guess.

Fixed in git master now.

-- 
Aleksander
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list