linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/3] Bluetooth: btandroid: Support Android Bluetooth Quality Report
@ 2021-09-08 11:19 Joseph Hwang
  2021-09-08 11:19 ` [PATCH v2 2/3] Bluetooth: hci_qca: Set up Qualcomm WCN399x for Android BQR commands Joseph Hwang
  2021-09-08 11:19 ` [PATCH v2 3/3] Bluetooth: btrtl: Set up Realtek 8822CE " Joseph Hwang
  0 siblings, 2 replies; 7+ messages in thread
From: Joseph Hwang @ 2021-09-08 11:19 UTC (permalink / raw)
  To: linux-bluetooth, marcel, luiz.dentz, pali
  Cc: chromeos-bluetooth-upstreaming, josephsih, Joseph Hwang,
	Miao-chen Chou, Johan Hedberg, linux-kernel

Add the btandroid.c file to support Android BQR commands.

This module may be referenced by btusb, btrtl, and hci_qca when a
Bluetooth controller supports the Android Bluetooth Quality Report.

Reviewed-by: Miao-chen Chou <mcchou@chromium.org>
Signed-off-by: Joseph Hwang <josephsih@chromium.org>
---

Changes in v2:
- Fix the titles of patches 2/3 and 3/3 and reduce their lengths.

 drivers/bluetooth/Makefile    |   1 +
 drivers/bluetooth/btandroid.c | 106 ++++++++++++++++++++++++++++++++++
 drivers/bluetooth/btandroid.h |  10 ++++
 3 files changed, 117 insertions(+)
 create mode 100644 drivers/bluetooth/btandroid.c
 create mode 100644 drivers/bluetooth/btandroid.h

diff --git a/drivers/bluetooth/Makefile b/drivers/bluetooth/Makefile
index 16286ea2655d..4d5d010bb947 100644
--- a/drivers/bluetooth/Makefile
+++ b/drivers/bluetooth/Makefile
@@ -13,6 +13,7 @@ obj-$(CONFIG_BT_HCIBT3C)	+= bt3c_cs.o
 obj-$(CONFIG_BT_HCIBLUECARD)	+= bluecard_cs.o
 
 obj-$(CONFIG_BT_HCIBTUSB)	+= btusb.o
+obj-$(CONFIG_BT_HCIBTUSB)	+= btandroid.o
 obj-$(CONFIG_BT_HCIBTSDIO)	+= btsdio.o
 
 obj-$(CONFIG_BT_INTEL)		+= btintel.o
diff --git a/drivers/bluetooth/btandroid.c b/drivers/bluetooth/btandroid.c
new file mode 100644
index 000000000000..fffacc8d67cc
--- /dev/null
+++ b/drivers/bluetooth/btandroid.c
@@ -0,0 +1,106 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ *  Support for Android Bluetooth Quality Report (BQR) specifications
+ *      https://source.android.com/devices/bluetooth/hci_requirements
+ *
+ *  Copyright (C) 2021 Google Corporation
+ */
+
+#include <linux/module.h>
+
+#include <net/bluetooth/bluetooth.h>
+#include <net/bluetooth/hci.h>
+
+#include "btandroid.h"
+
+#define VERSION "0.1"
+
+/*
+ * Reference for the command op codes and parameters below:
+ *   https://source.android.com/devices/bluetooth/hci_requirements#bluetooth-quality-report-command
+ */
+#define BQR_COMMAND_OCF			0x015e
+#define BQR_OPCODE			hci_opcode_pack(0x3f, BQR_COMMAND_OCF)
+
+/* report action */
+#define REPORT_ACTION_ADD		0x00
+#define REPORT_ACTION_DELETE		0x01
+#define REPORT_ACTION_CLEAR		0x02
+
+/* BQR event masks */
+#define QUALITY_MONITORING		(1 << 0)
+#define APPRAOCHING_LSTO		(1 << 1)
+#define A2DP_AUDIO_CHOPPY		(1 << 2)
+#define SCO_VOICE_CHOPPY		(1 << 3)
+
+#define DEFAULT_BQR_EVENT_MASK	(QUALITY_MONITORING | APPRAOCHING_LSTO | \
+				 A2DP_AUDIO_CHOPPY | SCO_VOICE_CHOPPY)
+
+/*
+ * Reporting at seconds so as not to stress the controller too much.
+ * Range: 0 ~ 65535 ms
+ */
+#define DEFALUT_REPORT_INTERVAL_MS	5000
+
+struct android_bqr_cp {
+	__u8	report_action;
+	__u32	event_mask;
+	__u16	min_report_interval;
+} __packed;
+
+static int enable_quality_report(struct hci_dev *hdev)
+{
+	struct sk_buff *skb;
+	struct android_bqr_cp cp;
+
+	cp.report_action = REPORT_ACTION_ADD;
+	cp.event_mask = DEFAULT_BQR_EVENT_MASK;
+	cp.min_report_interval = DEFALUT_REPORT_INTERVAL_MS;
+
+	skb = __hci_cmd_sync(hdev, BQR_OPCODE, sizeof(cp), &cp,
+							HCI_CMD_TIMEOUT);
+	if (IS_ERR(skb)) {
+		bt_dev_err(hdev, "Enabling Android BQR failed (%ld)",
+			   PTR_ERR(skb));
+		return PTR_ERR(skb);
+	}
+
+	kfree_skb(skb);
+	return 0;
+}
+
+static int disable_quality_report(struct hci_dev *hdev)
+{
+	struct sk_buff *skb;
+	struct android_bqr_cp cp = { 0 };
+
+	cp.report_action = REPORT_ACTION_CLEAR;
+
+	skb = __hci_cmd_sync(hdev, BQR_OPCODE, sizeof(cp), &cp,
+							HCI_CMD_TIMEOUT);
+	if (IS_ERR(skb)) {
+		bt_dev_err(hdev, "Disabling Android BQR failed (%ld)",
+			   PTR_ERR(skb));
+		return PTR_ERR(skb);
+	}
+
+	kfree_skb(skb);
+	return 0;
+}
+
+int btandroid_set_quality_report(struct hci_dev *hdev, bool enable)
+{
+	bt_dev_info(hdev, "quality report enable %d", enable);
+
+	/* Enable or disable the quality report feature. */
+	if (enable)
+		return enable_quality_report(hdev);
+	else
+		return disable_quality_report(hdev);
+}
+EXPORT_SYMBOL_GPL(btandroid_set_quality_report);
+
+MODULE_AUTHOR("Google");
+MODULE_DESCRIPTION("Support for Android Bluetooth Specification " VERSION);
+MODULE_VERSION(VERSION);
+MODULE_LICENSE("GPL");
diff --git a/drivers/bluetooth/btandroid.h b/drivers/bluetooth/btandroid.h
new file mode 100644
index 000000000000..6abc9e8e0838
--- /dev/null
+++ b/drivers/bluetooth/btandroid.h
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ *  Bluetooth support for Android specifications
+ *
+ *  Copyright (C) 2021 Google Corporation
+ */
+
+#include <net/bluetooth/hci_core.h>
+
+int btandroid_set_quality_report(struct hci_dev *hdev, bool enable);
-- 
2.33.0.153.gba50c8fa24-goog


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

* [PATCH v2 2/3] Bluetooth: hci_qca: Set up Qualcomm WCN399x for Android BQR commands
  2021-09-08 11:19 [PATCH v2 1/3] Bluetooth: btandroid: Support Android Bluetooth Quality Report Joseph Hwang
@ 2021-09-08 11:19 ` Joseph Hwang
  2021-09-09  2:27   ` kernel test robot
                     ` (2 more replies)
  2021-09-08 11:19 ` [PATCH v2 3/3] Bluetooth: btrtl: Set up Realtek 8822CE " Joseph Hwang
  1 sibling, 3 replies; 7+ messages in thread
From: Joseph Hwang @ 2021-09-08 11:19 UTC (permalink / raw)
  To: linux-bluetooth, marcel, luiz.dentz, pali
  Cc: chromeos-bluetooth-upstreaming, josephsih, Joseph Hwang,
	Miao-chen Chou, Johan Hedberg, linux-kernel

This patch sets up Qualcomm WCN399x to support the Android BQR commands.

Reviewed-by: Miao-chen Chou <mcchou@chromium.org>
Signed-off-by: Joseph Hwang <josephsih@chromium.org>
---

Changes in v2:
- Fix the title

 drivers/bluetooth/hci_qca.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
index 53deea2eb7b4..bf576046681d 100644
--- a/drivers/bluetooth/hci_qca.c
+++ b/drivers/bluetooth/hci_qca.c
@@ -38,6 +38,7 @@
 
 #include "hci_uart.h"
 #include "btqca.h"
+#include "btandroid.h"
 
 /* HCI_IBS protocol messages */
 #define HCI_IBS_SLEEP_IND	0xFE
@@ -1730,6 +1731,7 @@ static int qca_setup(struct hci_uart *hu)
 	if (qca_is_wcn399x(soc_type) ||
 	    qca_is_wcn6750(soc_type)) {
 		set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks);
+		hdev->set_quality_report = btandroid_set_quality_report;
 
 		ret = qca_read_soc_version(hdev, &ver, soc_type);
 		if (ret)
-- 
2.33.0.153.gba50c8fa24-goog


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

* [PATCH v2 3/3] Bluetooth: btrtl: Set up Realtek 8822CE for Android BQR commands
  2021-09-08 11:19 [PATCH v2 1/3] Bluetooth: btandroid: Support Android Bluetooth Quality Report Joseph Hwang
  2021-09-08 11:19 ` [PATCH v2 2/3] Bluetooth: hci_qca: Set up Qualcomm WCN399x for Android BQR commands Joseph Hwang
@ 2021-09-08 11:19 ` Joseph Hwang
  2021-09-09  9:40   ` kernel test robot
  1 sibling, 1 reply; 7+ messages in thread
From: Joseph Hwang @ 2021-09-08 11:19 UTC (permalink / raw)
  To: linux-bluetooth, marcel, luiz.dentz, pali
  Cc: chromeos-bluetooth-upstreaming, josephsih, Joseph Hwang,
	Miao-chen Chou, Johan Hedberg, linux-kernel

This patch sets up Realtek 8822CE to support the Android BQR commands.

Reviewed-by: Miao-chen Chou <mcchou@chromium.org>
Signed-off-by: Joseph Hwang <josephsih@chromium.org>
---

Changes in v2:
- Fix the title

 drivers/bluetooth/btrtl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c
index 1f8afa0244d8..e0bcdbe03eca 100644
--- a/drivers/bluetooth/btrtl.c
+++ b/drivers/bluetooth/btrtl.c
@@ -14,6 +14,7 @@
 #include <net/bluetooth/hci_core.h>
 
 #include "btrtl.h"
+#include "btandroid.h"
 
 #define VERSION "0.1"
 
@@ -740,12 +741,13 @@ void btrtl_set_quirks(struct hci_dev *hdev, struct btrtl_device_info *btrtl_dev)
 	/* Enable central-peripheral role (able to create new connections with
 	 * an existing connection in slave role).
 	 */
-	/* Enable WBS supported for the specific Realtek devices. */
+	/* Enable WBS and quality report supported by the specific devices. */
 	switch (btrtl_dev->project_id) {
 	case CHIP_ID_8822C:
 	case CHIP_ID_8852A:
 		set_bit(HCI_QUIRK_VALID_LE_STATES, &hdev->quirks);
 		set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks);
+		hdev->set_quality_report = btandroid_set_quality_report;
 		break;
 	default:
 		rtl_dev_dbg(hdev, "Central-peripheral role not enabled.");
-- 
2.33.0.153.gba50c8fa24-goog


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

* Re: [PATCH v2 2/3] Bluetooth: hci_qca: Set up Qualcomm WCN399x for Android BQR commands
  2021-09-08 11:19 ` [PATCH v2 2/3] Bluetooth: hci_qca: Set up Qualcomm WCN399x for Android BQR commands Joseph Hwang
@ 2021-09-09  2:27   ` kernel test robot
  2021-09-09  4:20   ` kernel test robot
  2021-09-09  6:14   ` kernel test robot
  2 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2021-09-09  2:27 UTC (permalink / raw)
  To: Joseph Hwang, linux-bluetooth, marcel, luiz.dentz, pali
  Cc: kbuild-all, chromeos-bluetooth-upstreaming, josephsih,
	Joseph Hwang, Miao-chen Chou, Johan Hedberg, linux-kernel

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

Hi Joseph,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on bluetooth-next/master]
[also build test ERROR on next-20210908]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Joseph-Hwang/Bluetooth-btandroid-Support-Android-Bluetooth-Quality-Report/20210908-192118
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master
config: x86_64-randconfig-s021-20210908 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.4-dirty
        # https://github.com/0day-ci/linux/commit/0d4d42904b8f0e73fef4d95c76688c57fc7ed7d0
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Joseph-Hwang/Bluetooth-btandroid-Support-Android-Bluetooth-Quality-Report/20210908-192118
        git checkout 0d4d42904b8f0e73fef4d95c76688c57fc7ed7d0
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>, old ones prefixed by <<):

>> ERROR: modpost: "btandroid_set_quality_report" [drivers/bluetooth/hci_uart.ko] undefined!

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 30005 bytes --]

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

* Re: [PATCH v2 2/3] Bluetooth: hci_qca: Set up Qualcomm WCN399x for Android BQR commands
  2021-09-08 11:19 ` [PATCH v2 2/3] Bluetooth: hci_qca: Set up Qualcomm WCN399x for Android BQR commands Joseph Hwang
  2021-09-09  2:27   ` kernel test robot
@ 2021-09-09  4:20   ` kernel test robot
  2021-09-09  6:14   ` kernel test robot
  2 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2021-09-09  4:20 UTC (permalink / raw)
  To: Joseph Hwang, linux-bluetooth, marcel, luiz.dentz, pali
  Cc: kbuild-all, chromeos-bluetooth-upstreaming, josephsih,
	Joseph Hwang, Miao-chen Chou, Johan Hedberg, linux-kernel

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

Hi Joseph,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on bluetooth-next/master]
[also build test ERROR on next-20210908]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Joseph-Hwang/Bluetooth-btandroid-Support-Android-Bluetooth-Quality-Report/20210908-192118
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master
config: hexagon-buildonly-randconfig-r004-20210908 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 9c476172b93367d2cb88d7d3f4b1b5b456fa6020)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/0d4d42904b8f0e73fef4d95c76688c57fc7ed7d0
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Joseph-Hwang/Bluetooth-btandroid-Support-Android-Bluetooth-Quality-Report/20210908-192118
        git checkout 0d4d42904b8f0e73fef4d95c76688c57fc7ed7d0
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross O=build_dir ARCH=hexagon SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> ld.lld: error: undefined symbol: btandroid_set_quality_report
   >>> referenced by hci_qca.c
   >>>               bluetooth/hci_qca.o:(qca_setup) in archive drivers/built-in.a
   >>> referenced by hci_qca.c
   >>>               bluetooth/hci_qca.o:(qca_setup) in archive drivers/built-in.a

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 29330 bytes --]

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

* Re: [PATCH v2 2/3] Bluetooth: hci_qca: Set up Qualcomm WCN399x for Android BQR commands
  2021-09-08 11:19 ` [PATCH v2 2/3] Bluetooth: hci_qca: Set up Qualcomm WCN399x for Android BQR commands Joseph Hwang
  2021-09-09  2:27   ` kernel test robot
  2021-09-09  4:20   ` kernel test robot
@ 2021-09-09  6:14   ` kernel test robot
  2 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2021-09-09  6:14 UTC (permalink / raw)
  To: Joseph Hwang, linux-bluetooth, marcel, luiz.dentz, pali
  Cc: kbuild-all, chromeos-bluetooth-upstreaming, josephsih,
	Joseph Hwang, Miao-chen Chou, Johan Hedberg, linux-kernel

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

Hi Joseph,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on bluetooth-next/master]
[also build test ERROR on next-20210908]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Joseph-Hwang/Bluetooth-btandroid-Support-Android-Bluetooth-Quality-Report/20210908-192118
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master
config: i386-randconfig-f003-20200320 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/0d4d42904b8f0e73fef4d95c76688c57fc7ed7d0
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Joseph-Hwang/Bluetooth-btandroid-Support-Android-Bluetooth-Quality-Report/20210908-192118
        git checkout 0d4d42904b8f0e73fef4d95c76688c57fc7ed7d0
        # save the attached .config to linux build tree
        mkdir build_dir
        make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   ld: drivers/bluetooth/hci_qca.o: in function `qca_setup':
>> drivers/bluetooth/hci_qca.c:1734: undefined reference to `btandroid_set_quality_report'


vim +1734 drivers/bluetooth/hci_qca.c

  1693	
  1694	static int qca_setup(struct hci_uart *hu)
  1695	{
  1696		struct hci_dev *hdev = hu->hdev;
  1697		struct qca_data *qca = hu->priv;
  1698		unsigned int speed, qca_baudrate = QCA_BAUDRATE_115200;
  1699		unsigned int retries = 0;
  1700		enum qca_btsoc_type soc_type = qca_soc_type(hu);
  1701		const char *firmware_name = qca_get_firmware_name(hu);
  1702		int ret;
  1703		struct qca_btsoc_version ver;
  1704	
  1705		ret = qca_check_speeds(hu);
  1706		if (ret)
  1707			return ret;
  1708	
  1709		clear_bit(QCA_ROM_FW, &qca->flags);
  1710		/* Patch downloading has to be done without IBS mode */
  1711		set_bit(QCA_IBS_DISABLED, &qca->flags);
  1712	
  1713		/* Enable controller to do both LE scan and BR/EDR inquiry
  1714		 * simultaneously.
  1715		 */
  1716		set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks);
  1717	
  1718		bt_dev_info(hdev, "setting up %s",
  1719			qca_is_wcn399x(soc_type) ? "wcn399x" :
  1720			(soc_type == QCA_WCN6750) ? "wcn6750" : "ROME/QCA6390");
  1721	
  1722		qca->memdump_state = QCA_MEMDUMP_IDLE;
  1723	
  1724	retry:
  1725		ret = qca_power_on(hdev);
  1726		if (ret)
  1727			goto out;
  1728	
  1729		clear_bit(QCA_SSR_TRIGGERED, &qca->flags);
  1730	
  1731		if (qca_is_wcn399x(soc_type) ||
  1732		    qca_is_wcn6750(soc_type)) {
  1733			set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks);
> 1734			hdev->set_quality_report = btandroid_set_quality_report;
  1735	
  1736			ret = qca_read_soc_version(hdev, &ver, soc_type);
  1737			if (ret)
  1738				goto out;
  1739		} else {
  1740			qca_set_speed(hu, QCA_INIT_SPEED);
  1741		}
  1742	
  1743		/* Setup user speed if needed */
  1744		speed = qca_get_speed(hu, QCA_OPER_SPEED);
  1745		if (speed) {
  1746			ret = qca_set_speed(hu, QCA_OPER_SPEED);
  1747			if (ret)
  1748				goto out;
  1749	
  1750			qca_baudrate = qca_get_baudrate_value(speed);
  1751		}
  1752	
  1753		if (!(qca_is_wcn399x(soc_type) ||
  1754		     qca_is_wcn6750(soc_type))) {
  1755			/* Get QCA version information */
  1756			ret = qca_read_soc_version(hdev, &ver, soc_type);
  1757			if (ret)
  1758				goto out;
  1759		}
  1760	
  1761		/* Setup patch / NVM configurations */
  1762		ret = qca_uart_setup(hdev, qca_baudrate, soc_type, ver,
  1763				firmware_name);
  1764		if (!ret) {
  1765			clear_bit(QCA_IBS_DISABLED, &qca->flags);
  1766			qca_debugfs_init(hdev);
  1767			hu->hdev->hw_error = qca_hw_error;
  1768			hu->hdev->cmd_timeout = qca_cmd_timeout;
  1769			hu->hdev->prevent_wake = qca_prevent_wake;
  1770		} else if (ret == -ENOENT) {
  1771			/* No patch/nvm-config found, run with original fw/config */
  1772			set_bit(QCA_ROM_FW, &qca->flags);
  1773			ret = 0;
  1774		} else if (ret == -EAGAIN) {
  1775			/*
  1776			 * Userspace firmware loader will return -EAGAIN in case no
  1777			 * patch/nvm-config is found, so run with original fw/config.
  1778			 */
  1779			set_bit(QCA_ROM_FW, &qca->flags);
  1780			ret = 0;
  1781		}
  1782	
  1783	out:
  1784		if (ret && retries < MAX_INIT_RETRIES) {
  1785			bt_dev_warn(hdev, "Retry BT power ON:%d", retries);
  1786			qca_power_shutdown(hu);
  1787			if (hu->serdev) {
  1788				serdev_device_close(hu->serdev);
  1789				ret = serdev_device_open(hu->serdev);
  1790				if (ret) {
  1791					bt_dev_err(hdev, "failed to open port");
  1792					return ret;
  1793				}
  1794			}
  1795			retries++;
  1796			goto retry;
  1797		}
  1798	
  1799		/* Setup bdaddr */
  1800		if (soc_type == QCA_ROME)
  1801			hu->hdev->set_bdaddr = qca_set_bdaddr_rome;
  1802		else
  1803			hu->hdev->set_bdaddr = qca_set_bdaddr;
  1804	
  1805		return ret;
  1806	}
  1807	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 38754 bytes --]

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

* Re: [PATCH v2 3/3] Bluetooth: btrtl: Set up Realtek 8822CE for Android BQR commands
  2021-09-08 11:19 ` [PATCH v2 3/3] Bluetooth: btrtl: Set up Realtek 8822CE " Joseph Hwang
@ 2021-09-09  9:40   ` kernel test robot
  0 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2021-09-09  9:40 UTC (permalink / raw)
  To: Joseph Hwang, linux-bluetooth, marcel, luiz.dentz, pali
  Cc: kbuild-all, chromeos-bluetooth-upstreaming, josephsih,
	Joseph Hwang, Miao-chen Chou, Johan Hedberg, linux-kernel

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

Hi Joseph,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on bluetooth-next/master]
[also build test ERROR on next-20210909]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Joseph-Hwang/Bluetooth-btandroid-Support-Android-Bluetooth-Quality-Report/20210908-192118
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master
config: i386-randconfig-f003-20200320 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/3723e13da0251e3fbea4781ce1e4f917301b0bb5
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Joseph-Hwang/Bluetooth-btandroid-Support-Android-Bluetooth-Quality-Report/20210908-192118
        git checkout 3723e13da0251e3fbea4781ce1e4f917301b0bb5
        # save the attached .config to linux build tree
        mkdir build_dir
        make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   ld: drivers/bluetooth/hci_qca.o: in function `qca_setup':
   drivers/bluetooth/hci_qca.c:1734: undefined reference to `btandroid_set_quality_report'
   ld: drivers/bluetooth/btrtl.o: in function `btrtl_set_quirks':
>> drivers/bluetooth/btrtl.c:750: undefined reference to `btandroid_set_quality_report'


vim +750 drivers/bluetooth/btrtl.c

   733	
   734	void btrtl_set_quirks(struct hci_dev *hdev, struct btrtl_device_info *btrtl_dev)
   735	{
   736		/* Enable controller to do both LE scan and BR/EDR inquiry
   737		 * simultaneously.
   738		 */
   739		set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks);
   740	
   741		/* Enable central-peripheral role (able to create new connections with
   742		 * an existing connection in slave role).
   743		 */
   744		/* Enable WBS and quality report supported by the specific devices. */
   745		switch (btrtl_dev->project_id) {
   746		case CHIP_ID_8822C:
   747		case CHIP_ID_8852A:
   748			set_bit(HCI_QUIRK_VALID_LE_STATES, &hdev->quirks);
   749			set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks);
 > 750			hdev->set_quality_report = btandroid_set_quality_report;
   751			break;
   752		default:
   753			rtl_dev_dbg(hdev, "Central-peripheral role not enabled.");
   754			rtl_dev_dbg(hdev, "WBS supported not enabled.");
   755			break;
   756		}
   757	}
   758	EXPORT_SYMBOL_GPL(btrtl_set_quirks);
   759	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 38754 bytes --]

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

end of thread, other threads:[~2021-09-09  9:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-08 11:19 [PATCH v2 1/3] Bluetooth: btandroid: Support Android Bluetooth Quality Report Joseph Hwang
2021-09-08 11:19 ` [PATCH v2 2/3] Bluetooth: hci_qca: Set up Qualcomm WCN399x for Android BQR commands Joseph Hwang
2021-09-09  2:27   ` kernel test robot
2021-09-09  4:20   ` kernel test robot
2021-09-09  6:14   ` kernel test robot
2021-09-08 11:19 ` [PATCH v2 3/3] Bluetooth: btrtl: Set up Realtek 8822CE " Joseph Hwang
2021-09-09  9:40   ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).