Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI

on: [pull_request]

jobs:
ci:
runs-on: ubuntu-latest
name: CI for Pull Request
steps:
- name: Checkout the source code
uses: actions/checkout@v3
with:
path: src/src

- name: CI
uses: tedd-an/bzcafe@main
with:
task: ci
base_folder: src
space: kernel
github_token: ${{ secrets.GITHUB_TOKEN }}
email_token: ${{ secrets.EMAIL_TOKEN }}
patchwork_token: ${{ secrets.PATCHWORK_TOKEN }}
patchwork_user: ${{ secrets.PATCHWORK_USER }}

43 changes: 43 additions & 0 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Sync

on:
schedule:
- cron: "*/30 * * * *"

jobs:
sync_repo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: master

- name: Sync Repo
uses: tedd-an/bzcafe@main
with:
task: sync
upstream_repo: 'https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git'
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Cleanup PR
uses: tedd-an/bzcafe@main
with:
task: cleanup
github_token: ${{ secrets.ACTION_TOKEN }}

sync_patchwork:
needs: sync_repo
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Sync Patchwork
uses: tedd-an/bzcafe@main
with:
task: patchwork
space: kernel
github_token: ${{ secrets.ACTION_TOKEN }}
email_token: ${{ secrets.EMAIL_TOKEN }}
patchwork_token: ${{ secrets.PATCHWORK_TOKEN }}
patchwork_user: ${{ secrets.PATCHWORK_USER }}

20 changes: 15 additions & 5 deletions net/bluetooth/hci_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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)
{
Expand All @@ -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);

Expand Down Expand Up @@ -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) {
Expand Down