All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: atmodem: gprs context deactivate crashes ofonod
  2010-05-19 16:40 atmodem: gprs context deactivate crashes ofonod Kalle Valo
@ 2010-05-19 14:02 ` Denis Kenzior
  2010-05-20  6:49   ` Kalle Valo
  0 siblings, 1 reply; 3+ messages in thread
From: Denis Kenzior @ 2010-05-19 14:02 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1151 bytes --]

Hi Kalle,

> Hello again,
> 
> I have been testing ofono with my Huawei E1552 usb stick, which is using
> atmodem and PPP. I noticed that whenever I call test/deactivate-context
> ofono either crashes or busyloops here in at_gprs_deactivate_primary():
> 
> 	if (g_at_chat_send(gcd->chat, buf, none_prefix,
> 				at_cgact_down_cb, cbd, g_free) > 0)
> 		return;
> 
> Further investigation revealed that gcd->chat is already unreferenced in
> setup_ppp():
> 
> 	g_at_chat_unref(gcd->chat);
> 
> So there's a conflict here. How to handle this properly? Calling
> g_at_ppp_shutdown() is most likely not enough, because nobody is not
> creating gcd->chat again which is needed during subsequent activate
> call.
> 
> Comments?
> 

Deactivation of the context was never made to work properly.  For a hint, 
please have a look at gatchat/gsmdial.c.  When PPP is established we should be 
using g_at_chat_suspend.  During a context deactivation we should use 
g_at_ppp_shutdown and then reactivate the gatchat using g_at_chat_resume 
(assuming the Huawei does not HUP the tty when disconnecting the ppp link.)

Regards,
-Denis

^ permalink raw reply	[flat|nested] 3+ messages in thread

* atmodem: gprs context deactivate crashes ofonod
@ 2010-05-19 16:40 Kalle Valo
  2010-05-19 14:02 ` Denis Kenzior
  0 siblings, 1 reply; 3+ messages in thread
From: Kalle Valo @ 2010-05-19 16:40 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 708 bytes --]

Hello again,

I have been testing ofono with my Huawei E1552 usb stick, which is using
atmodem and PPP. I noticed that whenever I call test/deactivate-context
ofono either crashes or busyloops here in at_gprs_deactivate_primary():

	if (g_at_chat_send(gcd->chat, buf, none_prefix,
				at_cgact_down_cb, cbd, g_free) > 0)
		return;

Further investigation revealed that gcd->chat is already unreferenced in
setup_ppp():

	g_at_chat_unref(gcd->chat);

So there's a conflict here. How to handle this properly? Calling
g_at_ppp_shutdown() is most likely not enough, because nobody is not
creating gcd->chat again which is needed during subsequent activate
call.

Comments?

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: atmodem: gprs context deactivate crashes ofonod
  2010-05-19 14:02 ` Denis Kenzior
@ 2010-05-20  6:49   ` Kalle Valo
  0 siblings, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2010-05-20  6:49 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1344 bytes --]

Denis Kenzior <denkenz@gmail.com> writes:

> Hi Kalle,

Hi Denis,

>> I have been testing ofono with my Huawei E1552 usb stick, which is using
>> atmodem and PPP. I noticed that whenever I call test/deactivate-context
>> ofono either crashes or busyloops here in at_gprs_deactivate_primary():
>> 
>> 	if (g_at_chat_send(gcd->chat, buf, none_prefix,
>> 				at_cgact_down_cb, cbd, g_free) > 0)
>> 		return;
>> 
>> Further investigation revealed that gcd->chat is already unreferenced in
>> setup_ppp():
>> 
>> 	g_at_chat_unref(gcd->chat);
>> 
>> So there's a conflict here. How to handle this properly? Calling
>> g_at_ppp_shutdown() is most likely not enough, because nobody is not
>> creating gcd->chat again which is needed during subsequent activate
>> call.
>> 
>> Comments?
>> 
>
> Deactivation of the context was never made to work properly. For a
> hint, please have a look at gatchat/gsmdial.c. When PPP is established
> we should be using g_at_chat_suspend. During a context deactivation we
> should use g_at_ppp_shutdown and then reactivate the gatchat using
> g_at_chat_resume

Ok, thank you for the tips. I'll take a look at this later, I have to
fix some other issues first.

> (assuming the Huawei does not HUP the tty when disconnecting the ppp
> link.)

Let's hope not.

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-05-20  6:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-19 16:40 atmodem: gprs context deactivate crashes ofonod Kalle Valo
2010-05-19 14:02 ` Denis Kenzior
2010-05-20  6:49   ` Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.