* [PATCH] Bluetooth: hci_core: Fix attempting to set RPA timeout when unsupported
@ 2020-10-27 7:02 Edward Vear
2020-11-24 2:19 ` Edward Vear
2020-11-25 14:40 ` Marcel Holtmann
0 siblings, 2 replies; 3+ messages in thread
From: Edward Vear @ 2020-10-27 7:02 UTC (permalink / raw)
To: linux-bluetooth; +Cc: edwardvear, marcel, johan.hedberg, davem, kuba
During controller initialization, an LE Set RPA Timeout command is sent
to the controller if supported. However, the value checked to determine
if the command is supported is incorrect. Page 1921 of the Bluetooth
Core Spec v5.2 shows that bit 2 of octet 35 of the Supported_Commands
field corresponds to the LE Set RPA Timeout command, but currently
bit 6 of octet 35 is checked. This patch checks the correct value
instead.
This issue led to the error seen in the following btmon output during
initialization of an adapter (rtl8761b) and prevented initialization
from completing.
< HCI Command: LE Set Resolvable Private Address Timeout (0x08|0x002e) plen 2
Timeout: 900 seconds
> HCI Event: Command Complete (0x0e) plen 4
LE Set Resolvable Private Address Timeout (0x08|0x002e) ncmd 2
Status: Unsupported Remote Feature / Unsupported LMP Feature (0x1a)
= Close Index: 00:E0:4C:6B:E5:03
The error did not appear when running with this patch.
Signed-off-by: Edward Vear <edwardvear@gmail.com>
---
net/bluetooth/hci_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 502552d6e9af..c4aa2cbb9269 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -763,7 +763,7 @@ static int hci_init3_req(struct hci_request *req, unsigned long opt)
hci_req_add(req, HCI_OP_LE_CLEAR_RESOLV_LIST, 0, NULL);
}
- if (hdev->commands[35] & 0x40) {
+ if (hdev->commands[35] & 0x04) {
__le16 rpa_timeout = cpu_to_le16(hdev->rpa_timeout);
/* Set RPA timeout */
--
2.29.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Bluetooth: hci_core: Fix attempting to set RPA timeout when unsupported
2020-10-27 7:02 [PATCH] Bluetooth: hci_core: Fix attempting to set RPA timeout when unsupported Edward Vear
@ 2020-11-24 2:19 ` Edward Vear
2020-11-25 14:40 ` Marcel Holtmann
1 sibling, 0 replies; 3+ messages in thread
From: Edward Vear @ 2020-11-24 2:19 UTC (permalink / raw)
To: linux-bluetooth; +Cc: marcel, johan.hedberg, davem, kuba
Just following up on this. It appears several people have had success
using this patch to get their bluetooth devices working:
https://bugzilla.kernel.org/show_bug.cgi?id=208965. Is there anything
else I should include?
Best,
Edward
On Tue, Oct 27, 2020 at 12:03 AM Edward Vear <edwardvear@gmail.com> wrote:
>
> During controller initialization, an LE Set RPA Timeout command is sent
> to the controller if supported. However, the value checked to determine
> if the command is supported is incorrect. Page 1921 of the Bluetooth
> Core Spec v5.2 shows that bit 2 of octet 35 of the Supported_Commands
> field corresponds to the LE Set RPA Timeout command, but currently
> bit 6 of octet 35 is checked. This patch checks the correct value
> instead.
>
> This issue led to the error seen in the following btmon output during
> initialization of an adapter (rtl8761b) and prevented initialization
> from completing.
>
> < HCI Command: LE Set Resolvable Private Address Timeout (0x08|0x002e) plen 2
> Timeout: 900 seconds
> > HCI Event: Command Complete (0x0e) plen 4
> LE Set Resolvable Private Address Timeout (0x08|0x002e) ncmd 2
> Status: Unsupported Remote Feature / Unsupported LMP Feature (0x1a)
> = Close Index: 00:E0:4C:6B:E5:03
>
> The error did not appear when running with this patch.
>
> Signed-off-by: Edward Vear <edwardvear@gmail.com>
> ---
> net/bluetooth/hci_core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
> index 502552d6e9af..c4aa2cbb9269 100644
> --- a/net/bluetooth/hci_core.c
> +++ b/net/bluetooth/hci_core.c
> @@ -763,7 +763,7 @@ static int hci_init3_req(struct hci_request *req, unsigned long opt)
> hci_req_add(req, HCI_OP_LE_CLEAR_RESOLV_LIST, 0, NULL);
> }
>
> - if (hdev->commands[35] & 0x40) {
> + if (hdev->commands[35] & 0x04) {
> __le16 rpa_timeout = cpu_to_le16(hdev->rpa_timeout);
>
> /* Set RPA timeout */
> --
> 2.29.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Bluetooth: hci_core: Fix attempting to set RPA timeout when unsupported
2020-10-27 7:02 [PATCH] Bluetooth: hci_core: Fix attempting to set RPA timeout when unsupported Edward Vear
2020-11-24 2:19 ` Edward Vear
@ 2020-11-25 14:40 ` Marcel Holtmann
1 sibling, 0 replies; 3+ messages in thread
From: Marcel Holtmann @ 2020-11-25 14:40 UTC (permalink / raw)
To: Edward Vear; +Cc: BlueZ development, Johan Hedberg, David S. Miller, kuba
Hi Edward,
> During controller initialization, an LE Set RPA Timeout command is sent
> to the controller if supported. However, the value checked to determine
> if the command is supported is incorrect. Page 1921 of the Bluetooth
> Core Spec v5.2 shows that bit 2 of octet 35 of the Supported_Commands
> field corresponds to the LE Set RPA Timeout command, but currently
> bit 6 of octet 35 is checked. This patch checks the correct value
> instead.
>
> This issue led to the error seen in the following btmon output during
> initialization of an adapter (rtl8761b) and prevented initialization
> from completing.
>
> < HCI Command: LE Set Resolvable Private Address Timeout (0x08|0x002e) plen 2
> Timeout: 900 seconds
>> HCI Event: Command Complete (0x0e) plen 4
> LE Set Resolvable Private Address Timeout (0x08|0x002e) ncmd 2
> Status: Unsupported Remote Feature / Unsupported LMP Feature (0x1a)
> = Close Index: 00:E0:4C:6B:E5:03
>
> The error did not appear when running with this patch.
>
> Signed-off-by: Edward Vear <edwardvear@gmail.com>
> ---
> net/bluetooth/hci_core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
patch has been applied to bluetooth-next tree.
Regards
Marcel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-11-25 14:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-27 7:02 [PATCH] Bluetooth: hci_core: Fix attempting to set RPA timeout when unsupported Edward Vear
2020-11-24 2:19 ` Edward Vear
2020-11-25 14:40 ` Marcel Holtmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).