Dear Shuai,
Thank you for your patch. Some minor comments.
It’d be great if you made the summary/title a statement about the action
of the patch and not about the issue. Maybe:
Prohibit establishing of ACL links during poweroff
Am 08.04.25 um 04:46 schrieb Shuai Zhang:
If turning off BT during pairing, "hci_acl_create_conn_sync" has chances
to be left in cmd_sync_work_list. Then the driver will try to send
the HCI command of creating connection but failed.
s/failed/fails/
When establishing ACL link, add judgment for BT power off.
Maybe:
Check if the device is *not* starting up, that means powering off, when
establishing the ACL link, and cancel early in this case.
It’d be great if you documented how to reproduce the bug and test the patch.
Change-Id: I9844a1ce1f207453e4fadeded3da1738eb4660c9
Signed-off-by: Shuai Zhang <quic_shuaz@xxxxxxxxxxx>
---
net/bluetooth/hci_sync.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index aeeadb45e..fdd57132e 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -6761,7 +6761,7 @@ static int hci_acl_create_conn_sync(struct hci_dev *hdev, void *data)
struct hci_cp_create_conn cp;
int err;
- if (!hci_conn_valid(hdev, conn))
+ if (!hci_conn_valid(hdev, conn) || !test_bit(HCI_UP, &hdev->flags))
return -ECANCELED;
/* Many controllers disallow HCI Create Connection while it is doing
--
2.34.1
The diff looks reasonable.
Kind regards,
Paul