diff mbox series

Bluetooth: mgmt: Fix limited discoverable off timeout

Message ID 20240122165955.280126-1-frederic.danis@collabora.com (mailing list archive)
State Accepted
Commit 53ddef135d3a80064b74964a08b0e0f3aed7c952
Headers show
Series Bluetooth: mgmt: Fix limited discoverable off timeout | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch success CheckPatch PASS
tedd_an/GitLint success Gitlint PASS
tedd_an/SubjectPrefix success Gitlint PASS
tedd_an/BuildKernel success BuildKernel PASS
tedd_an/CheckAllWarning success CheckAllWarning PASS
tedd_an/CheckSparse success CheckSparse PASS
tedd_an/CheckSmatch success CheckSparse PASS
tedd_an/BuildKernel32 success BuildKernel32 PASS
tedd_an/TestRunnerSetup success TestRunnerSetup PASS
tedd_an/TestRunner_l2cap-tester success TestRunner PASS
tedd_an/TestRunner_iso-tester success TestRunner PASS
tedd_an/TestRunner_bnep-tester success TestRunner PASS
tedd_an/TestRunner_mgmt-tester success TestRunner PASS
tedd_an/TestRunner_rfcomm-tester success TestRunner PASS
tedd_an/TestRunner_sco-tester success TestRunner PASS
tedd_an/TestRunner_ioctl-tester success TestRunner PASS
tedd_an/TestRunner_mesh-tester success TestRunner PASS
tedd_an/TestRunner_smp-tester success TestRunner PASS
tedd_an/TestRunner_userchan-tester success TestRunner PASS
tedd_an/IncrementalBuild success Incremental Build PASS

Commit Message

Frédéric Danis Jan. 22, 2024, 4:59 p.m. UTC
LIMITED_DISCOVERABLE flag is not reset from Class of Device and
advertisement on limited discoverable timeout. This prevents to pass PTS
test GAP/DISC/LIMM/BV-02-C

Calling set_discoverable_sync as when the limited discovery is set
correctly update the Class of Device and advertisement.

Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
---
 net/bluetooth/mgmt.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

bluez.test.bot@gmail.com Jan. 22, 2024, 6:03 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=818709

---Test result---

Test Summary:
CheckPatch                    PASS      43.26 seconds
GitLint                       PASS      40.68 seconds
SubjectPrefix                 PASS      39.07 seconds
BuildKernel                   PASS      27.86 seconds
CheckAllWarning               PASS      38.74 seconds
CheckSparse                   PASS      76.42 seconds
CheckSmatch                   PASS      119.42 seconds
BuildKernel32                 PASS      40.00 seconds
TestRunnerSetup               PASS      437.18 seconds
TestRunner_l2cap-tester       PASS      26.76 seconds
TestRunner_iso-tester         PASS      47.64 seconds
TestRunner_bnep-tester        PASS      7.90 seconds
TestRunner_mgmt-tester        PASS      159.16 seconds
TestRunner_rfcomm-tester      PASS      10.99 seconds
TestRunner_sco-tester         PASS      14.43 seconds
TestRunner_ioctl-tester       PASS      12.50 seconds
TestRunner_mesh-tester        PASS      10.90 seconds
TestRunner_smp-tester         PASS      23.59 seconds
TestRunner_userchan-tester    PASS      7.29 seconds
IncrementalBuild              PASS      29.75 seconds



---
Regards,
Linux Bluetooth
patchwork-bot+bluetooth@kernel.org Jan. 23, 2024, 3:30 p.m. UTC | #2
Hello:

This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Mon, 22 Jan 2024 17:59:55 +0100 you wrote:
> LIMITED_DISCOVERABLE flag is not reset from Class of Device and
> advertisement on limited discoverable timeout. This prevents to pass PTS
> test GAP/DISC/LIMM/BV-02-C
> 
> Calling set_discoverable_sync as when the limited discovery is set
> correctly update the Class of Device and advertisement.
> 
> [...]

Here is the summary with links:
  - Bluetooth: mgmt: Fix limited discoverable off timeout
    https://git.kernel.org/bluetooth/bluetooth-next/c/53ddef135d3a

You are awesome, thank you!
diff mbox series

Patch

diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 173986f3405f..8c4493255f92 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -1045,6 +1045,8 @@  static void rpa_expired(struct work_struct *work)
 	hci_cmd_sync_queue(hdev, rpa_expired_sync, NULL, NULL);
 }
 
+static int set_discoverable_sync(struct hci_dev *hdev, void *data);
+
 static void discov_off(struct work_struct *work)
 {
 	struct hci_dev *hdev = container_of(work, struct hci_dev,
@@ -1063,7 +1065,7 @@  static void discov_off(struct work_struct *work)
 	hci_dev_clear_flag(hdev, HCI_DISCOVERABLE);
 	hdev->discov_timeout = 0;
 
-	hci_update_discoverable(hdev);
+	hci_cmd_sync_queue(hdev, set_discoverable_sync, NULL, NULL);
 
 	mgmt_new_settings(hdev);