All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: [v1] Bluetooth: hci_sync: Fix not clearing cmd_sync_work_list on power off
  2025-04-09 13:54 Luiz Augusto von Dentz
@ 2025-04-09 14:34 ` bluez.test.bot
  0 siblings, 0 replies; 5+ messages in thread
From: bluez.test.bot @ 2025-04-09 14:34 UTC (permalink / raw)
  To: linux-bluetooth, luiz.dentz

[-- Attachment #1: Type: text/plain, Size: 2109 bytes --]

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=951571

---Test result---

Test Summary:
CheckPatch                    PENDING   0.29 seconds
GitLint                       PENDING   0.24 seconds
SubjectPrefix                 PASS      0.13 seconds
BuildKernel                   PASS      34.02 seconds
CheckAllWarning               PASS      45.11 seconds
CheckSparse                   PASS      32.33 seconds
BuildKernel32                 PASS      24.56 seconds
TestRunnerSetup               PASS      463.45 seconds
TestRunner_l2cap-tester       PASS      24.52 seconds
TestRunner_iso-tester         PASS      30.95 seconds
TestRunner_bnep-tester        PASS      4.79 seconds
TestRunner_mgmt-tester        FAIL      120.96 seconds
TestRunner_rfcomm-tester      PASS      7.90 seconds
TestRunner_sco-tester         PASS      12.65 seconds
TestRunner_ioctl-tester       PASS      8.48 seconds
TestRunner_mesh-tester        PASS      6.08 seconds
TestRunner_smp-tester         PASS      7.17 seconds
TestRunner_userchan-tester    PASS      5.03 seconds
IncrementalBuild              PENDING   0.77 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: TestRunner_mgmt-tester - FAIL
Desc: Run mgmt-tester with test-runner
Output:
Total: 490, Passed: 483 (98.6%), Failed: 3, Not Run: 4

Failed Test Cases
LL Privacy - Add Device 2 (2 Devices to AL)          Failed       0.178 seconds
LL Privacy - Set Flags 1 (Add to RL)                 Failed       0.150 seconds
LL Privacy - Set Flags 3 (2 Devices to RL)           Failed       0.181 seconds
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



---
Regards,
Linux Bluetooth


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

* [PATCH v1] Bluetooth: hci_sync: Fix not clearing cmd_sync_work_list on power off
@ 2025-12-09 14:03 Shuai Zhang
  2025-12-09 14:40 ` [v1] " bluez.test.bot
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Shuai Zhang @ 2025-12-09 14:03 UTC (permalink / raw)
  To: Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz
  Cc: linux-bluetooth, linux-kernel, linux-arm-msm, cheng.jiang,
	quic_chezhou, wei.deng, shuai.zhang

When powering off the cmd_sync_work_list may contain items which shall
be cleared during power off as they shouldn't be run during power off
sequence.

Signed-off-by: Shuai Zhang <shuai.zhang@oss.qualcomm.com>
---
 net/bluetooth/hci_sync.c | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index a9f5b1a68..45b593ec7 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -648,16 +648,22 @@ static void _hci_cmd_sync_cancel_entry(struct hci_dev *hdev,
 	kfree(entry);
 }
 
-void hci_cmd_sync_clear(struct hci_dev *hdev)
+/* Clear remaining entries in cmd_sync_work_list */
+static void hci_cmd_sync_list_clear(struct hci_dev *hdev)
 {
 	struct hci_cmd_sync_work_entry *entry, *tmp;
 
+	list_for_each_entry_safe(entry, tmp, &hdev->cmd_sync_work_list, list)
+		_hci_cmd_sync_cancel_entry(hdev, entry, -ECANCELED);
+}
+
+void hci_cmd_sync_clear(struct hci_dev *hdev)
+{
 	cancel_work_sync(&hdev->cmd_sync_work);
 	cancel_work_sync(&hdev->reenable_adv_work);
 
 	mutex_lock(&hdev->cmd_sync_work_lock);
-	list_for_each_entry_safe(entry, tmp, &hdev->cmd_sync_work_list, list)
-		_hci_cmd_sync_cancel_entry(hdev, entry, -ECANCELED);
+	hci_cmd_sync_list_clear(hdev);
 	mutex_unlock(&hdev->cmd_sync_work_lock);
 }
 
@@ -678,6 +684,7 @@ EXPORT_SYMBOL(hci_cmd_sync_cancel);
  *
  * - Set result and mark status to HCI_REQ_CANCELED
  * - Wakeup command sync thread
+ * - Clear cmd_sync_work_list if the interface is down
  */
 void hci_cmd_sync_cancel_sync(struct hci_dev *hdev, int err)
 {
@@ -692,6 +699,9 @@ void hci_cmd_sync_cancel_sync(struct hci_dev *hdev, int err)
 
 		wake_up_interruptible(&hdev->req_wait_q);
 	}
+
+	if (err == EHOSTDOWN || err == -EHOSTDOWN)
+		hci_cmd_sync_list_clear(hdev);
 }
 EXPORT_SYMBOL(hci_cmd_sync_cancel_sync);
 
@@ -5260,14 +5270,14 @@ int hci_dev_close_sync(struct hci_dev *hdev)
 		disable_delayed_work(&hdev->power_off);
 		disable_delayed_work(&hdev->ncmd_timer);
 		disable_delayed_work(&hdev->le_scan_disable);
+		hci_cmd_sync_cancel_sync(hdev, ENODEV);
 	} else {
 		cancel_delayed_work(&hdev->power_off);
 		cancel_delayed_work(&hdev->ncmd_timer);
 		cancel_delayed_work(&hdev->le_scan_disable);
+		hci_cmd_sync_cancel_sync(hdev, EHOSTDOWN);
 	}
 
-	hci_cmd_sync_cancel_sync(hdev, ENODEV);
-
 	cancel_interleave_scan(hdev);
 
 	if (hdev->adv_instance_timeout) {
-- 
2.34.1


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

* RE: [v1] Bluetooth: hci_sync: Fix not clearing cmd_sync_work_list on power off
  2025-12-09 14:03 [PATCH v1] Bluetooth: hci_sync: Fix not clearing cmd_sync_work_list on power off Shuai Zhang
@ 2025-12-09 14:40 ` bluez.test.bot
  2026-01-19 11:46 ` [PATCH v1] " Shuai Zhang
  2026-01-19 12:39 ` Dmitry Baryshkov
  2 siblings, 0 replies; 5+ messages in thread
From: bluez.test.bot @ 2025-12-09 14:40 UTC (permalink / raw)
  To: linux-bluetooth, shuai.zhang

[-- Attachment #1: Type: text/plain, Size: 2673 bytes --]

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=1031732

---Test result---

Test Summary:
CheckPatch                    PENDING   0.36 seconds
GitLint                       PENDING   1.04 seconds
SubjectPrefix                 PASS      0.11 seconds
BuildKernel                   PASS      25.36 seconds
CheckAllWarning               PASS      28.41 seconds
CheckSparse                   PASS      31.51 seconds
BuildKernel32                 PASS      25.07 seconds
TestRunnerSetup               PASS      551.16 seconds
TestRunner_l2cap-tester       PASS      23.72 seconds
TestRunner_iso-tester         PASS      87.69 seconds
TestRunner_bnep-tester        PASS      6.22 seconds
TestRunner_mgmt-tester        FAIL      130.79 seconds
TestRunner_rfcomm-tester      PASS      9.40 seconds
TestRunner_sco-tester         FAIL      14.54 seconds
TestRunner_ioctl-tester       PASS      10.19 seconds
TestRunner_mesh-tester        FAIL      11.50 seconds
TestRunner_smp-tester         PASS      8.66 seconds
TestRunner_userchan-tester    PASS      9.26 seconds
IncrementalBuild              PENDING   0.90 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: TestRunner_mgmt-tester - FAIL
Desc: Run mgmt-tester with test-runner
Output:
Total: 494, Passed: 488 (98.8%), Failed: 2, Not Run: 4

Failed Test Cases
Read Exp Feature - Success                           Failed       0.113 seconds
LL Privacy - Set Flags 2 (Enable RL)                 Failed       0.171 seconds
##############################
Test: TestRunner_sco-tester - FAIL
Desc: Run sco-tester with test-runner
Output:
WARNING: possible circular locking dependency detected
BUG: sleeping function called from invalid context at net/core/sock.c:3782
Total: 30, Passed: 30 (100.0%), Failed: 0, Not Run: 0
##############################
Test: TestRunner_mesh-tester - FAIL
Desc: Run mesh-tester with test-runner
Output:
Total: 10, Passed: 8 (80.0%), Failed: 2, Not Run: 0

Failed Test Cases
Mesh - Send cancel - 1                               Timed out    1.961 seconds
Mesh - Send cancel - 2                               Timed out    1.999 seconds
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



---
Regards,
Linux Bluetooth


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

* Re: [PATCH v1] Bluetooth: hci_sync: Fix not clearing cmd_sync_work_list on power off
  2025-12-09 14:03 [PATCH v1] Bluetooth: hci_sync: Fix not clearing cmd_sync_work_list on power off Shuai Zhang
  2025-12-09 14:40 ` [v1] " bluez.test.bot
@ 2026-01-19 11:46 ` Shuai Zhang
  2026-01-19 12:39 ` Dmitry Baryshkov
  2 siblings, 0 replies; 5+ messages in thread
From: Shuai Zhang @ 2026-01-19 11:46 UTC (permalink / raw)
  To: Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz
  Cc: linux-bluetooth, linux-kernel, linux-arm-msm, cheng.jiang,
	quic_chezhou, wei.deng

Hi

On 12/9/2025 10:03 PM, Shuai Zhang wrote:
> When powering off the cmd_sync_work_list may contain items which shall
> be cleared during power off as they shouldn't be run during power off
> sequence.
>
> Signed-off-by: Shuai Zhang <shuai.zhang@oss.qualcomm.com>
> ---
>   net/bluetooth/hci_sync.c | 20 +++++++++++++++-----
>   1 file changed, 15 insertions(+), 5 deletions(-)
>
> diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
> index a9f5b1a68..45b593ec7 100644
> --- a/net/bluetooth/hci_sync.c
> +++ b/net/bluetooth/hci_sync.c
> @@ -648,16 +648,22 @@ static void _hci_cmd_sync_cancel_entry(struct hci_dev *hdev,
>   	kfree(entry);
>   }
>   
> -void hci_cmd_sync_clear(struct hci_dev *hdev)
> +/* Clear remaining entries in cmd_sync_work_list */
> +static void hci_cmd_sync_list_clear(struct hci_dev *hdev)
>   {
>   	struct hci_cmd_sync_work_entry *entry, *tmp;
>   
> +	list_for_each_entry_safe(entry, tmp, &hdev->cmd_sync_work_list, list)
> +		_hci_cmd_sync_cancel_entry(hdev, entry, -ECANCELED);
> +}
> +
> +void hci_cmd_sync_clear(struct hci_dev *hdev)
> +{
>   	cancel_work_sync(&hdev->cmd_sync_work);
>   	cancel_work_sync(&hdev->reenable_adv_work);
>   
>   	mutex_lock(&hdev->cmd_sync_work_lock);
> -	list_for_each_entry_safe(entry, tmp, &hdev->cmd_sync_work_list, list)
> -		_hci_cmd_sync_cancel_entry(hdev, entry, -ECANCELED);
> +	hci_cmd_sync_list_clear(hdev);
>   	mutex_unlock(&hdev->cmd_sync_work_lock);
>   }
>   
> @@ -678,6 +684,7 @@ EXPORT_SYMBOL(hci_cmd_sync_cancel);
>    *
>    * - Set result and mark status to HCI_REQ_CANCELED
>    * - Wakeup command sync thread
> + * - Clear cmd_sync_work_list if the interface is down
>    */
>   void hci_cmd_sync_cancel_sync(struct hci_dev *hdev, int err)
>   {
> @@ -692,6 +699,9 @@ void hci_cmd_sync_cancel_sync(struct hci_dev *hdev, int err)
>   
>   		wake_up_interruptible(&hdev->req_wait_q);
>   	}
> +
> +	if (err == EHOSTDOWN || err == -EHOSTDOWN)
> +		hci_cmd_sync_list_clear(hdev);
>   }
>   EXPORT_SYMBOL(hci_cmd_sync_cancel_sync);
>   
> @@ -5260,14 +5270,14 @@ int hci_dev_close_sync(struct hci_dev *hdev)
>   		disable_delayed_work(&hdev->power_off);
>   		disable_delayed_work(&hdev->ncmd_timer);
>   		disable_delayed_work(&hdev->le_scan_disable);
> +		hci_cmd_sync_cancel_sync(hdev, ENODEV);
>   	} else {
>   		cancel_delayed_work(&hdev->power_off);
>   		cancel_delayed_work(&hdev->ncmd_timer);
>   		cancel_delayed_work(&hdev->le_scan_disable);
> +		hci_cmd_sync_cancel_sync(hdev, EHOSTDOWN);
>   	}
>   
> -	hci_cmd_sync_cancel_sync(hdev, ENODEV);
> -
>   	cancel_interleave_scan(hdev);
>   
>   	if (hdev->adv_instance_timeout) {
Kindly let me know if there are any updates.


Kindly, regard

Shuai




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

* Re: [PATCH v1] Bluetooth: hci_sync: Fix not clearing cmd_sync_work_list on power off
  2025-12-09 14:03 [PATCH v1] Bluetooth: hci_sync: Fix not clearing cmd_sync_work_list on power off Shuai Zhang
  2025-12-09 14:40 ` [v1] " bluez.test.bot
  2026-01-19 11:46 ` [PATCH v1] " Shuai Zhang
@ 2026-01-19 12:39 ` Dmitry Baryshkov
  2 siblings, 0 replies; 5+ messages in thread
From: Dmitry Baryshkov @ 2026-01-19 12:39 UTC (permalink / raw)
  To: Shuai Zhang
  Cc: Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz,
	linux-bluetooth, linux-kernel, linux-arm-msm, cheng.jiang,
	quic_chezhou, wei.deng

On Tue, Dec 09, 2025 at 10:03:47PM +0800, Shuai Zhang wrote:
> When powering off the cmd_sync_work_list may contain items which shall
> be cleared during power off as they shouldn't be run during power off
> sequence.
> 
> Signed-off-by: Shuai Zhang <shuai.zhang@oss.qualcomm.com>
> ---
>  net/bluetooth/hci_sync.c | 20 +++++++++++++++-----
>  1 file changed, 15 insertions(+), 5 deletions(-)
> 
> diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
> index a9f5b1a68..45b593ec7 100644
> --- a/net/bluetooth/hci_sync.c
> +++ b/net/bluetooth/hci_sync.c
> @@ -648,16 +648,22 @@ static void _hci_cmd_sync_cancel_entry(struct hci_dev *hdev,
>  	kfree(entry);
>  }
>  
> -void hci_cmd_sync_clear(struct hci_dev *hdev)
> +/* Clear remaining entries in cmd_sync_work_list */
> +static void hci_cmd_sync_list_clear(struct hci_dev *hdev)
>  {
>  	struct hci_cmd_sync_work_entry *entry, *tmp;
>  
> +	list_for_each_entry_safe(entry, tmp, &hdev->cmd_sync_work_list, list)
> +		_hci_cmd_sync_cancel_entry(hdev, entry, -ECANCELED);
> +}
> +
> +void hci_cmd_sync_clear(struct hci_dev *hdev)
> +{
>  	cancel_work_sync(&hdev->cmd_sync_work);
>  	cancel_work_sync(&hdev->reenable_adv_work);
>  
>  	mutex_lock(&hdev->cmd_sync_work_lock);
> -	list_for_each_entry_safe(entry, tmp, &hdev->cmd_sync_work_list, list)
> -		_hci_cmd_sync_cancel_entry(hdev, entry, -ECANCELED);
> +	hci_cmd_sync_list_clear(hdev);
>  	mutex_unlock(&hdev->cmd_sync_work_lock);
>  }
>  
> @@ -678,6 +684,7 @@ EXPORT_SYMBOL(hci_cmd_sync_cancel);
>   *
>   * - Set result and mark status to HCI_REQ_CANCELED
>   * - Wakeup command sync thread
> + * - Clear cmd_sync_work_list if the interface is down
>   */
>  void hci_cmd_sync_cancel_sync(struct hci_dev *hdev, int err)
>  {
> @@ -692,6 +699,9 @@ void hci_cmd_sync_cancel_sync(struct hci_dev *hdev, int err)
>  
>  		wake_up_interruptible(&hdev->req_wait_q);
>  	}
> +
> +	if (err == EHOSTDOWN || err == -EHOSTDOWN)

Which one? I suppose it can become only one of those.

> +		hci_cmd_sync_list_clear(hdev);

What will prevent ocncurrent modification of the cmd_sync_work_list?

>  }
>  EXPORT_SYMBOL(hci_cmd_sync_cancel_sync);
>  
> @@ -5260,14 +5270,14 @@ int hci_dev_close_sync(struct hci_dev *hdev)
>  		disable_delayed_work(&hdev->power_off);
>  		disable_delayed_work(&hdev->ncmd_timer);
>  		disable_delayed_work(&hdev->le_scan_disable);
> +		hci_cmd_sync_cancel_sync(hdev, ENODEV);
>  	} else {
>  		cancel_delayed_work(&hdev->power_off);
>  		cancel_delayed_work(&hdev->ncmd_timer);
>  		cancel_delayed_work(&hdev->le_scan_disable);
> +		hci_cmd_sync_cancel_sync(hdev, EHOSTDOWN);
>  	}
>  
> -	hci_cmd_sync_cancel_sync(hdev, ENODEV);
> -
>  	cancel_interleave_scan(hdev);
>  
>  	if (hdev->adv_instance_timeout) {
> -- 
> 2.34.1
> 

-- 
With best wishes
Dmitry

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

end of thread, other threads:[~2026-01-19 12:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-09 14:03 [PATCH v1] Bluetooth: hci_sync: Fix not clearing cmd_sync_work_list on power off Shuai Zhang
2025-12-09 14:40 ` [v1] " bluez.test.bot
2026-01-19 11:46 ` [PATCH v1] " Shuai Zhang
2026-01-19 12:39 ` Dmitry Baryshkov
  -- strict thread matches above, loose matches on Subject: below --
2025-04-09 13:54 Luiz Augusto von Dentz
2025-04-09 14:34 ` [v1] " bluez.test.bot

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.