All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] android: Fix for BT Turn off while pairing
@ 2014-02-13 10:51 Lukasz Rymanowski
  2014-02-17 13:46 ` Szymon Janc
  0 siblings, 1 reply; 2+ messages in thread
From: Lukasz Rymanowski @ 2014-02-13 10:51 UTC (permalink / raw
  To: linux-bluetooth; +Cc: Lukasz Rymanowski

This patch fix an issue when Android disables BT during ongoing
paring. In this case mgmt did not accept any commands and BT gets
in some unknown state.
Since Android turns off BT anyway, it is ok to just cancel all
the mgmt requests before send power off command.
---
 android/bluetooth.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/android/bluetooth.c b/android/bluetooth.c
index ff41627..ad8cfec 100644
--- a/android/bluetooth.c
+++ b/android/bluetooth.c
@@ -2907,6 +2907,9 @@ static void handle_disable_cmd(const void *buf, uint16_t len)
 		goto reply;
 	}
 
+	/* Cancel all pending requests. Need it in case of ongoing paring */
+	mgmt_cancel_index(mgmt_if, adapter.index);
+
 	if (!set_mode(MGMT_OP_SET_POWERED, 0x00)) {
 		status = HAL_STATUS_FAILED;
 		goto reply;
-- 
1.8.4


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

* Re: [PATCH] android: Fix for BT Turn off while pairing
  2014-02-13 10:51 [PATCH] android: Fix for BT Turn off while pairing Lukasz Rymanowski
@ 2014-02-17 13:46 ` Szymon Janc
  0 siblings, 0 replies; 2+ messages in thread
From: Szymon Janc @ 2014-02-17 13:46 UTC (permalink / raw
  To: Lukasz Rymanowski; +Cc: linux-bluetooth

Hi Łukasz,

On Thursday 13 of February 2014 11:51:32 Lukasz Rymanowski wrote:
> This patch fix an issue when Android disables BT during ongoing
> paring. In this case mgmt did not accept any commands and BT gets
> in some unknown state.
> Since Android turns off BT anyway, it is ok to just cancel all
> the mgmt requests before send power off command.
> ---
>  android/bluetooth.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/android/bluetooth.c b/android/bluetooth.c
> index ff41627..ad8cfec 100644
> --- a/android/bluetooth.c
> +++ b/android/bluetooth.c
> @@ -2907,6 +2907,9 @@ static void handle_disable_cmd(const void *buf, uint16_t len)
>  		goto reply;
>  	}
>  
> +	/* Cancel all pending requests. Need it in case of ongoing paring */
> +	mgmt_cancel_index(mgmt_if, adapter.index);
> +
>  	if (!set_mode(MGMT_OP_SET_POWERED, 0x00)) {
>  		status = HAL_STATUS_FAILED;
>  		goto reply;

Applied, thanks. 

-- 
Best regards, 
Szymon Janc

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

end of thread, other threads:[~2014-02-17 13:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-13 10:51 [PATCH] android: Fix for BT Turn off while pairing Lukasz Rymanowski
2014-02-17 13:46 ` Szymon Janc

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.