diff mbox series

[Bluez,v1] doc/mgmt-api - Add a new error code for HCI status 0x3e

Message ID 20210429111523.Bluez.v1.1.Ic00ed950add081b346d6c8ced590bb7b2eb6e9f7@changeid
State New
Headers show
Series [Bluez,v1] doc/mgmt-api - Add a new error code for HCI status 0x3e | expand

Commit Message

Yu Liu April 29, 2021, 6:15 p.m. UTC
We want to retry the pairing when HCI status 0x3e (Connection failed to
established/Synchronization timeout) is returned from the controller.
This is to add a new MGMT error code so that we can catch this 0x3e
failure and issue a retry in the user space.

Reviewed-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
---

Changes in v1:
- Initial change

 doc/mgmt-api.txt | 2 ++
 1 file changed, 2 insertions(+)

Comments

bluez.test.bot@gmail.com April 29, 2021, 6:48 p.m. UTC | #1
This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=475329

---Test result---

Test Summary:
CheckPatch                    PASS      0.23 seconds
GitLint                       PASS      0.10 seconds
Prep - Setup ELL              PASS      39.85 seconds
Build - Prep                  PASS      0.09 seconds
Build - Configure             PASS      6.93 seconds
Build - Make                  FAIL      36.64 seconds
Make Check                    FAIL      0.20 seconds
Make Dist                     PASS      9.88 seconds
Make Dist - Configure         PASS      4.29 seconds
Make Dist - Make              PASS      68.58 seconds
Build w/ext ELL - Configure   PASS      6.93 seconds
Build w/ext ELL - Make        PASS      160.00 seconds

Details
##############################
Test: CheckPatch - PASS
Desc: Run checkpatch.pl script with rule in .checkpatch.conf

##############################
Test: GitLint - PASS
Desc: Run gitlint with rule in .gitlint

##############################
Test: Prep - Setup ELL - PASS
Desc: Clone, build, and install ELL

##############################
Test: Build - Prep - PASS
Desc: Prepare environment for build

##############################
Test: Build - Configure - PASS
Desc: Configure the BlueZ source tree

##############################
Test: Build - Make - FAIL
Desc: Build the BlueZ source tree
Output:
ell/cert.c:38:10: fatal error: tls.h: No such file or directory
   38 | #include "tls.h"
      |          ^~~~~~~
compilation terminated.
make[1]: *** [Makefile:6864: ell/cert.lo] Error 1
make: *** [Makefile:4060: all] Error 2


##############################
Test: Make Check - FAIL
Desc: Run 'make check'
Output:
ell/cert.c:38:10: fatal error: tls.h: No such file or directory
   38 | #include "tls.h"
      |          ^~~~~~~
compilation terminated.
make[1]: *** [Makefile:6864: ell/cert.lo] Error 1
make: *** [Makefile:10315: check] Error 2


##############################
Test: Make Dist - PASS
Desc: Run 'make dist' and build the distribution tarball

##############################
Test: Make Dist - Configure - PASS
Desc: Configure the source from distribution tarball

##############################
Test: Make Dist - Make - PASS
Desc: Build the source from distribution tarball

##############################
Test: Build w/ext ELL - Configure - PASS
Desc: Configure BlueZ source with '--enable-external-ell' configuration

##############################
Test: Build w/ext ELL - Make - PASS
Desc: Build BlueZ source with '--enable-external-ell' configuration



---
Regards,
Linux Bluetooth
Yu Liu May 5, 2021, 4:06 p.m. UTC | #2
ping for attention.


On Thu, Apr 29, 2021 at 11:15 AM Yu Liu <yudiliu@google.com> wrote:
>

> We want to retry the pairing when HCI status 0x3e (Connection failed to

> established/Synchronization timeout) is returned from the controller.

> This is to add a new MGMT error code so that we can catch this 0x3e

> failure and issue a retry in the user space.

>

> Reviewed-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>

> ---

>

> Changes in v1:

> - Initial change

>

>  doc/mgmt-api.txt | 2 ++

>  1 file changed, 2 insertions(+)

>

> diff --git a/doc/mgmt-api.txt b/doc/mgmt-api.txt

> index 5355fedb0..f7cbf7ab2 100644

> --- a/doc/mgmt-api.txt

> +++ b/doc/mgmt-api.txt

> @@ -200,6 +200,7 @@ and Command Complete events:

>  0x12   RFKilled

>  0x13   Already Paired

>  0x14   Permission Denied

> +0x15   Connection Not Established

>

>  As a general rule all commands generate the events as specified below,

>  however invalid lengths or unknown commands will always generate a

> @@ -1112,6 +1113,7 @@ Pair Device Command

>                                 Not Powered

>                                 Invalid Index

>                                 Already Paired

> +                               Connection Not Established

>

>

>  Cancel Pair Device Command

> --

> 2.31.1.527.g47e6f16901-goog

>
Luiz Augusto von Dentz May 5, 2021, 10:15 p.m. UTC | #3
Hi Yu,

On Thu, Apr 29, 2021 at 11:15 AM Yu Liu <yudiliu@google.com> wrote:
>

> We want to retry the pairing when HCI status 0x3e (Connection failed to

> established/Synchronization timeout) is returned from the controller.

> This is to add a new MGMT error code so that we can catch this 0x3e

> failure and issue a retry in the user space.

>

> Reviewed-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>

> ---

>

> Changes in v1:

> - Initial change

>

>  doc/mgmt-api.txt | 2 ++

>  1 file changed, 2 insertions(+)

>

> diff --git a/doc/mgmt-api.txt b/doc/mgmt-api.txt

> index 5355fedb0..f7cbf7ab2 100644

> --- a/doc/mgmt-api.txt

> +++ b/doc/mgmt-api.txt

> @@ -200,6 +200,7 @@ and Command Complete events:

>  0x12   RFKilled

>  0x13   Already Paired

>  0x14   Permission Denied

> +0x15   Connection Not Established

>

>  As a general rule all commands generate the events as specified below,

>  however invalid lengths or unknown commands will always generate a

> @@ -1112,6 +1113,7 @@ Pair Device Command

>                                 Not Powered

>                                 Invalid Index

>                                 Already Paired

> +                               Connection Not Established

>

>

>  Cancel Pair Device Command

> --

> 2.31.1.527.g47e6f16901-goog

>


Applied, thanks.

-- 
Luiz Augusto von Dentz
Marcel Holtmann May 7, 2021, 8:18 a.m. UTC | #4
Hi Yu,

> We want to retry the pairing when HCI status 0x3e (Connection failed to

> established/Synchronization timeout) is returned from the controller.

> This is to add a new MGMT error code so that we can catch this 0x3e

> failure and issue a retry in the user space.

> 

> Reviewed-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>

> ---

> 

> Changes in v1:

> - Initial change

> 

> doc/mgmt-api.txt | 2 ++

> 1 file changed, 2 insertions(+)

> 

> diff --git a/doc/mgmt-api.txt b/doc/mgmt-api.txt

> index 5355fedb0..f7cbf7ab2 100644

> --- a/doc/mgmt-api.txt

> +++ b/doc/mgmt-api.txt

> @@ -200,6 +200,7 @@ and Command Complete events:

> 0x12	RFKilled

> 0x13	Already Paired

> 0x14	Permission Denied

> +0x15	Connection Not Established

> 

> As a general rule all commands generate the events as specified below,

> however invalid lengths or unknown commands will always generate a

> @@ -1112,6 +1113,7 @@ Pair Device Command

> 				Not Powered

> 				Invalid Index

> 				Already Paired

> +				Connection Not Established


I really dislike the naming. And even more so, I request the motive here.

So looking at our code, we have 3 cases where we use the previous status:

	MGMT_STATUS_CONNECT_FAILED, /* Page Timeout */
	MGMT_STATUS_CONNECT_FAILED, /* Connection Establishment Failed */
	MGMT_STATUS_CONNECT_FAILED, /* MAC Connection Failed */

And they do map to the 3 available transports, either via BR/EDR or LE or AMP. That means if you call Pair Device you already know well today when it fails to establish the link and can retry it.

My question, what are you trying to fix here.

Regards

Marcel
Yu Liu May 7, 2021, 4:43 p.m. UTC | #5
Hi Marcel,

We have a couple of bugs where the controller failed on the Read
Remote Feature command after initial connection with the 0x3E error,
guy.damary@intel made some suggestions after root caused the issues,
you can see his detailed suggestions here:
https://buganizer.corp.google.com/issues/174806913#comment98. To
summarize: he suggests us to retry up to 3 times if 0x3E is
encountered during LE pairing.

Regarding this change: I see MGMT_STATUS_CONNECT_FAILED could be
returned under 4 different scenarios, 3 in the mgmt_status_table table
and 1 in pair_device as a fallback error to cover all the other cases,
so I decided to introduce a new error code to make sure we don't retry
in the cases where we shouldn't. If you think this cae be avoided by
checking other flags at the same time, I can then drop the change from
the kernel and only change the user space.

Thanks


On Fri, May 7, 2021 at 1:19 AM Marcel Holtmann <marcel@holtmann.org> wrote:
>

> Hi Yu,

>

> > We want to retry the pairing when HCI status 0x3e (Connection failed to

> > established/Synchronization timeout) is returned from the controller.

> > This is to add a new MGMT error code so that we can catch this 0x3e

> > failure and issue a retry in the user space.

> >

> > Reviewed-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>

> > ---

> >

> > Changes in v1:

> > - Initial change

> >

> > doc/mgmt-api.txt | 2 ++

> > 1 file changed, 2 insertions(+)

> >

> > diff --git a/doc/mgmt-api.txt b/doc/mgmt-api.txt

> > index 5355fedb0..f7cbf7ab2 100644

> > --- a/doc/mgmt-api.txt

> > +++ b/doc/mgmt-api.txt

> > @@ -200,6 +200,7 @@ and Command Complete events:

> > 0x12  RFKilled

> > 0x13  Already Paired

> > 0x14  Permission Denied

> > +0x15 Connection Not Established

> >

> > As a general rule all commands generate the events as specified below,

> > however invalid lengths or unknown commands will always generate a

> > @@ -1112,6 +1113,7 @@ Pair Device Command

> >                               Not Powered

> >                               Invalid Index

> >                               Already Paired

> > +                             Connection Not Established

>

> I really dislike the naming. And even more so, I request the motive here.

>

> So looking at our code, we have 3 cases where we use the previous status:

>

>         MGMT_STATUS_CONNECT_FAILED, /* Page Timeout */

>         MGMT_STATUS_CONNECT_FAILED, /* Connection Establishment Failed */

>         MGMT_STATUS_CONNECT_FAILED, /* MAC Connection Failed */

>

> And they do map to the 3 available transports, either via BR/EDR or LE or AMP. That means if you call Pair Device you already know well today when it fails to establish the link and can retry it.

>

> My question, what are you trying to fix here.

>

> Regards

>

> Marcel

>
diff mbox series

Patch

diff --git a/doc/mgmt-api.txt b/doc/mgmt-api.txt
index 5355fedb0..f7cbf7ab2 100644
--- a/doc/mgmt-api.txt
+++ b/doc/mgmt-api.txt
@@ -200,6 +200,7 @@  and Command Complete events:
 0x12	RFKilled
 0x13	Already Paired
 0x14	Permission Denied
+0x15	Connection Not Established
 
 As a general rule all commands generate the events as specified below,
 however invalid lengths or unknown commands will always generate a
@@ -1112,6 +1113,7 @@  Pair Device Command
 				Not Powered
 				Invalid Index
 				Already Paired
+				Connection Not Established
 
 
 Cancel Pair Device Command