Skip to content
Closed
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 }}

2 changes: 1 addition & 1 deletion Documentation/admin-guide/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ Kernel parameters
out hasn't expired, it'll be restarted by each
successful driver registration. This option will also
dump out devices still on the deferred probe list after
retrying.
retrying. Set to -1 to wait indefinitely.

delayacct [KNL] Enable per-task delay accounting

Expand Down
9 changes: 9 additions & 0 deletions drivers/base/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@ config DEVTMPFS_SAFE
with the PROT_EXEC flag. This can break, for example, non-KMS
video drivers.

config DRIVER_DEFERRED_PROBE_TIMEOUT
int "Default value for deferred_probe_timeout"
default 0 if !MODULES
default 10 if MODULES
help
Set the default value for the deferred_probe_timeout kernel parameter.
See Documentation/admin-guide/kernel-parameters.txt for a description
of the deferred_probe_timeout kernel parameter.

config STANDALONE
bool "Select only drivers that don't need compile-time external firmware"
default y
Expand Down
9 changes: 4 additions & 5 deletions drivers/base/dd.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,7 @@ static int deferred_devs_show(struct seq_file *s, void *data)
}
DEFINE_SHOW_ATTRIBUTE(deferred_devs);

#ifdef CONFIG_MODULES
static int driver_deferred_probe_timeout = 10;
#else
static int driver_deferred_probe_timeout;
#endif
static int driver_deferred_probe_timeout = CONFIG_DRIVER_DEFERRED_PROBE_TIMEOUT;

static int __init deferred_probe_timeout_setup(char *str)
{
Expand Down Expand Up @@ -323,6 +319,9 @@ static DECLARE_DELAYED_WORK(deferred_probe_timeout_work, deferred_probe_timeout_

void deferred_probe_extend_timeout(void)
{
if (driver_deferred_probe_timeout < 0)
return;

/*
* If the work hasn't been queued yet or if the work expired, don't
* start a new one.
Expand Down
10 changes: 4 additions & 6 deletions drivers/bluetooth/btbcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw)
err = PTR_ERR(skb);
bt_dev_err(hdev, "BCM: Download Minidrv command failed (%d)",
err);
goto done;
return err;
}
kfree_skb(skb);

Expand All @@ -242,8 +242,7 @@ int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw)

if (fw_size < cmd->plen) {
bt_dev_err(hdev, "BCM: Patch is corrupted");
err = -EINVAL;
goto done;
return -EINVAL;
}

cmd_param = fw_ptr;
Expand All @@ -258,16 +257,15 @@ int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw)
err = PTR_ERR(skb);
bt_dev_err(hdev, "BCM: Patch command %04x failed (%d)",
opcode, err);
goto done;
return err;
}
kfree_skb(skb);
}

/* 250 msec delay after Launch Ram completes */
msleep(250);

done:
return err;
return 0;
}
EXPORT_SYMBOL(btbcm_patchram);

Expand Down
22 changes: 20 additions & 2 deletions drivers/bluetooth/btmtk.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,14 @@ int btmtk_setup_firmware_79xx(struct hci_dev *hdev, const char *fwname,
}
}

/* If retry exhausted goto err_release_fw */
if (retry == 0) {
err = -EIO;
goto err_release_fw;
}

fw_ptr += section_offset;
wmt_params.op = BTMTK_WMT_PATCH_DWNLD;
wmt_params.status = NULL;

while (dl_size > 0) {
dlen = min_t(int, 250, dl_size);
Expand All @@ -225,7 +230,14 @@ int btmtk_setup_firmware_79xx(struct hci_dev *hdev, const char *fwname,
wmt_params.data = fw_ptr;

err = wmt_cmd_sync(hdev, &wmt_params);
if (err < 0) {
/* Status BTMTK_WMT_PATCH_PROGRESS indicates firmware is
* in process of being downloaded, which is not expected to
* occur here.
*/
if (status == BTMTK_WMT_PATCH_PROGRESS) {
err = -EIO;
goto err_release_fw;
} else if (err < 0) {
bt_dev_err(hdev, "Failed to send wmt patch dwnld (%d)",
err);
goto err_release_fw;
Expand Down Expand Up @@ -1332,6 +1344,9 @@ int btmtk_usb_setup(struct hci_dev *hdev)
err = btmtk_setup_firmware_79xx(hdev, fw_bin_name,
btmtk_usb_hci_wmt_sync);
if (err < 0) {
/* retry once if setup firmware error */
if (!test_and_set_bit(BTMTK_FIRMWARE_DL_RETRY, &btmtk_data->flags))
btmtk_reset_sync(hdev);
bt_dev_err(hdev, "Failed to set up firmware (%d)", err);
return err;
}
Expand Down Expand Up @@ -1359,6 +1374,9 @@ int btmtk_usb_setup(struct hci_dev *hdev)
hci_set_msft_opcode(hdev, 0xFD30);
hci_set_aosp_capable(hdev);

/* Clear BTMTK_FIRMWARE_DL_RETRY if setup successfully */
test_and_clear_bit(BTMTK_FIRMWARE_DL_RETRY, &btmtk_data->flags);

/* Set up ISO interface after protocol enabled */
if (test_bit(BTMTK_ISOPKT_OVER_INTR, &btmtk_data->flags)) {
if (!btmtk_usb_isointf_init(hdev))
Expand Down
1 change: 1 addition & 0 deletions drivers/bluetooth/btmtk.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ enum {
BTMTK_HW_RESET_ACTIVE,
BTMTK_ISOPKT_OVER_INTR,
BTMTK_ISOPKT_RUNNING,
BTMTK_FIRMWARE_DL_RETRY,
};

typedef int (*btmtk_reset_sync_func_t)(struct hci_dev *, void *);
Expand Down
37 changes: 19 additions & 18 deletions drivers/bluetooth/btqca.c
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,14 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
snprintf(config.fwname, sizeof(config.fwname), "qca/%s", rampatch_name);
} else {
switch (soc_type) {
case QCA_QCA2066:
snprintf(config.fwname, sizeof(config.fwname),
"qca/hpbtfw%02x.tlv", rom_ver);
break;
case QCA_QCA6390:
snprintf(config.fwname, sizeof(config.fwname),
"qca/htbtfw%02x.tlv", rom_ver);
break;
case QCA_WCN3950:
snprintf(config.fwname, sizeof(config.fwname),
"qca/cmbtfw%02x.tlv", rom_ver);
Expand All @@ -813,14 +821,6 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
snprintf(config.fwname, sizeof(config.fwname),
"qca/apbtfw%02x.tlv", rom_ver);
break;
case QCA_QCA2066:
snprintf(config.fwname, sizeof(config.fwname),
"qca/hpbtfw%02x.tlv", rom_ver);
break;
case QCA_QCA6390:
snprintf(config.fwname, sizeof(config.fwname),
"qca/htbtfw%02x.tlv", rom_ver);
break;
case QCA_WCN6750:
/* Choose mbn file by default.If mbn file is not found
* then choose tlv file
Expand Down Expand Up @@ -890,6 +890,16 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
}
} else {
switch (soc_type) {
case QCA_QCA2066:
qca_get_nvm_name_by_board(config.fwname,
sizeof(config.fwname),
"hpnv", soc_type, ver,
rom_ver, boardid);
break;
case QCA_QCA6390:
snprintf(config.fwname, sizeof(config.fwname),
"qca/htnv%02x.bin", rom_ver);
break;
case QCA_WCN3950:
if (le32_to_cpu(ver.soc_id) == QCA_WCN3950_SOC_ID_T)
variant = "t";
Expand All @@ -912,15 +922,6 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
snprintf(config.fwname, sizeof(config.fwname),
"qca/apnv%02x.bin", rom_ver);
break;
case QCA_QCA2066:
qca_get_nvm_name_by_board(config.fwname,
sizeof(config.fwname), "hpnv", soc_type, ver,
rom_ver, boardid);
break;
case QCA_QCA6390:
snprintf(config.fwname, sizeof(config.fwname),
"qca/htnv%02x.bin", rom_ver);
break;
case QCA_WCN6750:
snprintf(config.fwname, sizeof(config.fwname),
"qca/msnv%02x.bin", rom_ver);
Expand Down Expand Up @@ -954,9 +955,9 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
}

switch (soc_type) {
case QCA_WCN3991:
case QCA_QCA2066:
case QCA_QCA6390:
case QCA_WCN3991:
case QCA_WCN6750:
case QCA_WCN6855:
case QCA_WCN7850:
Expand Down
Loading