All of lore.kernel.org
 help / color / mirror / Atom feed
* BUG: btd_profile's accept not been called from second connection and on
@ 2015-12-03 23:37 Felipe Ferreri Tonello
  2015-12-04 11:30 ` Felipe Ferreri Tonello
  0 siblings, 1 reply; 3+ messages in thread
From: Felipe Ferreri Tonello @ 2015-12-03 23:37 UTC (permalink / raw)
  To: linux-bluetooth

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

Hi,

So the accept function callback from btd_profile is only been called on
the first time bluetoothd runs. It never gets called after a
disconnection and reconnection.

I did git bisect and found the commit that caused it:
4522ac85dd6dc1db4d49507330b4abc3bbaf4e6c

But that commit doesn't actually caused the bug. I debugged a little
more and found that from the second connection on the service->state is
BTD_SERVICE_STATE_CONNECTING instead of BTD_SERVICE_STATE_DISCONNECTED
(which is the state when first connecting), thus causing the
btd_profile's accept function not to be called in service_accept().

I didn't have time to debug more so I wanted to shout here if anyone has
any idea on why this is happening and how to fix it.

Thanks in advance,

Felipe

[-- Attachment #2: 0x92698E6A.asc --]
[-- Type: application/pgp-keys, Size: 7310 bytes --]

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

* Re: BUG: btd_profile's accept not been called from second connection and on
  2015-12-03 23:37 BUG: btd_profile's accept not been called from second connection and on Felipe Ferreri Tonello
@ 2015-12-04 11:30 ` Felipe Ferreri Tonello
  2015-12-04 11:48   ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 3+ messages in thread
From: Felipe Ferreri Tonello @ 2015-12-04 11:30 UTC (permalink / raw)
  To: linux-bluetooth

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



On 12/03/2015 11:37 PM, Felipe Ferreri Tonello wrote:
> Hi,
> 
> So the accept function callback from btd_profile is only been called on
> the first time bluetoothd runs. It never gets called after a
> disconnection and reconnection.
> 
> I did git bisect and found the commit that caused it:
> 4522ac85dd6dc1db4d49507330b4abc3bbaf4e6c
> 
> But that commit doesn't actually caused the bug. I debugged a little
> more and found that from the second connection on the service->state is
> BTD_SERVICE_STATE_CONNECTING instead of BTD_SERVICE_STATE_DISCONNECTED
> (which is the state when first connecting), thus causing the
> btd_profile's accept function not to be called in service_accept().
> 
> I didn't have time to debug more so I wanted to shout here if anyone has
> any idea on why this is happening and how to fix it.

I will two patches that fixes this bug.

Felipe

[-- Attachment #2: 0x92698E6A.asc --]
[-- Type: application/pgp-keys, Size: 7195 bytes --]

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

* Re: BUG: btd_profile's accept not been called from second connection and on
  2015-12-04 11:30 ` Felipe Ferreri Tonello
@ 2015-12-04 11:48   ` Luiz Augusto von Dentz
  0 siblings, 0 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2015-12-04 11:48 UTC (permalink / raw)
  To: Felipe Ferreri Tonello; +Cc: linux-bluetooth

Hi Felipe,

On Fri, Dec 4, 2015 at 1:30 PM, Felipe Ferreri Tonello
<eu@felipetonello.com> wrote:
>
>
> On 12/03/2015 11:37 PM, Felipe Ferreri Tonello wrote:
>> Hi,
>>
>> So the accept function callback from btd_profile is only been called on
>> the first time bluetoothd runs. It never gets called after a
>> disconnection and reconnection.
>>
>> I did git bisect and found the commit that caused it:
>> 4522ac85dd6dc1db4d49507330b4abc3bbaf4e6c
>>
>> But that commit doesn't actually caused the bug. I debugged a little
>> more and found that from the second connection on the service->state is
>> BTD_SERVICE_STATE_CONNECTING instead of BTD_SERVICE_STATE_DISCONNECTED
>> (which is the state when first connecting), thus causing the
>> btd_profile's accept function not to be called in service_accept().
>>
>> I didn't have time to debug more so I wanted to shout here if anyone has
>> any idea on why this is happening and how to fix it.

Interesting, it doesn't seems to manifest in case of HoG, but that is
probably because it still uses btd_device_add_attio_callback which is
now deprecated. Well I was planning to start to cleanup the use of it
so it nice that you are testing accept code path.



-- 
Luiz Augusto von Dentz

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

end of thread, other threads:[~2015-12-04 11:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-03 23:37 BUG: btd_profile's accept not been called from second connection and on Felipe Ferreri Tonello
2015-12-04 11:30 ` Felipe Ferreri Tonello
2015-12-04 11:48   ` Luiz Augusto von Dentz

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.