All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] android/health: Fix reconnect scenario
@ 2014-08-11 17:23 Lukasz Rymanowski
  2014-08-13 13:09 ` Ravi kumar Veeramally
  2014-08-13 14:57 ` Johan Hedberg
  0 siblings, 2 replies; 4+ messages in thread
From: Lukasz Rymanowski @ 2014-08-11 17:23 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Lukasz Rymanowski

When trying to reconnect to HDP device, BfA tries to connect MDL even
MCL is not connected.

D/BlueZ   ( 2218): external/bluetooth/bluez/android/hal-health.c:connect_channel()
I/bluetoothd( 2220): bluetoothd[2221]: external/bluetooth/bluez/android/health.c:bt_health_connect_channel()
I/bluetoothd( 2220): bluetoothd[2221]: external/bluetooth/bluez/android/health.c:create_channel() mdep 1
D/BlueZ   ( 2218): external/bluetooth/bluez/android/hal-bluetooth.c:handle_acl_state_changed() state 0
I/bluetoothd( 2220): bluetoothd[2221]: external/bluetooth/bluez/android/mcap-lib.c:mcap_create_mdl()
I/bluetoothd( 2220): bluetoothd[2221]: health: error creating mdl MCL is not connected

This patch makes sure that MCL is connected before trying to connect
MDL.
---
 android/health.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/android/health.c b/android/health.c
index 2d80365..f4edc3e 100644
--- a/android/health.c
+++ b/android/health.c
@@ -1949,7 +1949,7 @@ static void bt_health_connect_channel(const void *buf, uint16_t len)
 		}
 	}
 
-	if (!dev->mcl) {
+	if (!dev->mcl || (dev->mcl && !dev->mcl_conn)) {
 		if (connect_mcl(channel) < 0) {
 			error("health: error retrieving HDP SDP record");
 			goto fail;
-- 
1.8.4


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

* Re: [PATCH] android/health: Fix reconnect scenario
  2014-08-11 17:23 [PATCH] android/health: Fix reconnect scenario Lukasz Rymanowski
@ 2014-08-13 13:09 ` Ravi kumar Veeramally
  2014-08-13 14:30   ` Luiz Augusto von Dentz
  2014-08-13 14:57 ` Johan Hedberg
  1 sibling, 1 reply; 4+ messages in thread
From: Ravi kumar Veeramally @ 2014-08-13 13:09 UTC (permalink / raw)
  To: Lukasz Rymanowski, linux-bluetooth

ping.

On 08/11/2014 08:23 PM, Lukasz Rymanowski wrote:
> When trying to reconnect to HDP device, BfA tries to connect MDL even
> MCL is not connected.
>
> D/BlueZ   ( 2218): external/bluetooth/bluez/android/hal-health.c:connect_channel()
> I/bluetoothd( 2220): bluetoothd[2221]: external/bluetooth/bluez/android/health.c:bt_health_connect_channel()
> I/bluetoothd( 2220): bluetoothd[2221]: external/bluetooth/bluez/android/health.c:create_channel() mdep 1
> D/BlueZ   ( 2218): external/bluetooth/bluez/android/hal-bluetooth.c:handle_acl_state_changed() state 0
> I/bluetoothd( 2220): bluetoothd[2221]: external/bluetooth/bluez/android/mcap-lib.c:mcap_create_mdl()
> I/bluetoothd( 2220): bluetoothd[2221]: health: error creating mdl MCL is not connected
>
> This patch makes sure that MCL is connected before trying to connect
> MDL.
> ---
>   android/health.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/android/health.c b/android/health.c
> index 2d80365..f4edc3e 100644
> --- a/android/health.c
> +++ b/android/health.c
> @@ -1949,7 +1949,7 @@ static void bt_health_connect_channel(const void *buf, uint16_t len)
>   		}
>   	}
>   
> -	if (!dev->mcl) {
> +	if (!dev->mcl || (dev->mcl && !dev->mcl_conn)) {
>   		if (connect_mcl(channel) < 0) {
>   			error("health: error retrieving HDP SDP record");
>   			goto fail;

Ravi.

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

* Re: [PATCH] android/health: Fix reconnect scenario
  2014-08-13 13:09 ` Ravi kumar Veeramally
@ 2014-08-13 14:30   ` Luiz Augusto von Dentz
  0 siblings, 0 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2014-08-13 14:30 UTC (permalink / raw)
  To: Ravi kumar Veeramally; +Cc: Lukasz Rymanowski, linux-bluetooth

Hi,

On Wed, Aug 13, 2014 at 4:09 PM, Ravi kumar Veeramally
<ravikumar.veeramally@linux.intel.com> wrote:
> ping.
>
>
> On 08/11/2014 08:23 PM, Lukasz Rymanowski wrote:
>>
>> When trying to reconnect to HDP device, BfA tries to connect MDL even
>> MCL is not connected.
>>
>> D/BlueZ   ( 2218):
>> external/bluetooth/bluez/android/hal-health.c:connect_channel()
>> I/bluetoothd( 2220): bluetoothd[2221]:
>> external/bluetooth/bluez/android/health.c:bt_health_connect_channel()
>> I/bluetoothd( 2220): bluetoothd[2221]:
>> external/bluetooth/bluez/android/health.c:create_channel() mdep 1
>> D/BlueZ   ( 2218):
>> external/bluetooth/bluez/android/hal-bluetooth.c:handle_acl_state_changed()
>> state 0
>> I/bluetoothd( 2220): bluetoothd[2221]:
>> external/bluetooth/bluez/android/mcap-lib.c:mcap_create_mdl()
>> I/bluetoothd( 2220): bluetoothd[2221]: health: error creating mdl MCL is
>> not connected
>>
>> This patch makes sure that MCL is connected before trying to connect
>> MDL.
>> ---
>>   android/health.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/android/health.c b/android/health.c
>> index 2d80365..f4edc3e 100644
>> --- a/android/health.c
>> +++ b/android/health.c
>> @@ -1949,7 +1949,7 @@ static void bt_health_connect_channel(const void
>> *buf, uint16_t len)
>>                 }
>>         }
>>   -     if (!dev->mcl) {
>> +       if (!dev->mcl || (dev->mcl && !dev->mcl_conn)) {
>>                 if (connect_mcl(channel) < 0) {
>>                         error("health: error retrieving HDP SDP record");
>>                         goto fail;
>
>
> Ravi.

Pushed, thanks.


-- 
Luiz Augusto von Dentz

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

* Re: [PATCH] android/health: Fix reconnect scenario
  2014-08-11 17:23 [PATCH] android/health: Fix reconnect scenario Lukasz Rymanowski
  2014-08-13 13:09 ` Ravi kumar Veeramally
@ 2014-08-13 14:57 ` Johan Hedberg
  1 sibling, 0 replies; 4+ messages in thread
From: Johan Hedberg @ 2014-08-13 14:57 UTC (permalink / raw)
  To: Lukasz Rymanowski; +Cc: linux-bluetooth

Hi Lukasz,

On Mon, Aug 11, 2014, Lukasz Rymanowski wrote:
> When trying to reconnect to HDP device, BfA tries to connect MDL even
> MCL is not connected.
> 
> D/BlueZ   ( 2218): external/bluetooth/bluez/android/hal-health.c:connect_channel()
> I/bluetoothd( 2220): bluetoothd[2221]: external/bluetooth/bluez/android/health.c:bt_health_connect_channel()
> I/bluetoothd( 2220): bluetoothd[2221]: external/bluetooth/bluez/android/health.c:create_channel() mdep 1
> D/BlueZ   ( 2218): external/bluetooth/bluez/android/hal-bluetooth.c:handle_acl_state_changed() state 0
> I/bluetoothd( 2220): bluetoothd[2221]: external/bluetooth/bluez/android/mcap-lib.c:mcap_create_mdl()
> I/bluetoothd( 2220): bluetoothd[2221]: health: error creating mdl MCL is not connected
> 
> This patch makes sure that MCL is connected before trying to connect
> MDL.
> ---
>  android/health.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/android/health.c b/android/health.c
> index 2d80365..f4edc3e 100644
> --- a/android/health.c
> +++ b/android/health.c
> @@ -1949,7 +1949,7 @@ static void bt_health_connect_channel(const void *buf, uint16_t len)
>  		}
>  	}
>  
> -	if (!dev->mcl) {
> +	if (!dev->mcl || (dev->mcl && !dev->mcl_conn)) {

The patch looks good but the second check for dev->mcl is a bit
redundant as this part is only evaluated if the first part (!dev->mcl)
was false. So the more concise form would be:

	if (!dev->mcl || !dev->mcl_conn)

However, could you explain to me why these separate variables are needed
to begin with? Why isn't dev->mcl cleared in the mcl_disconnected()
function that sets dev->mcl_conn to false but doesn't do anything to the
dev->mcl pointer?

Johan

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

end of thread, other threads:[~2014-08-13 14:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-11 17:23 [PATCH] android/health: Fix reconnect scenario Lukasz Rymanowski
2014-08-13 13:09 ` Ravi kumar Veeramally
2014-08-13 14:30   ` Luiz Augusto von Dentz
2014-08-13 14:57 ` Johan Hedberg

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.