2023-05-14 07:49:59

by Rudi Heitbaum

[permalink] [raw]
Subject: [PATCH 0/3] Bluetooth: btrtl: Add support for RTL8822BS

With the recent support of the RTL8822BS SDIO WiFi and the
BROKEN_LOCAL_EXT_FEATURES_PAGE_2 quirk complete the enablement by
adding Bluetooth support on the RTL8822BS UART with hci_ver = 0x07.

The RTL8822BS requires the BROKEN_LOCAL_EXT_FEATURES_PAGE_2 quirk.

Test results:

[ 10.029959] Bluetooth: hci0: RTL: examining hci_ver=07 hci_rev=000b lmp_ver=07 lmp_subver=8822
[ 10.047194] Bluetooth: hci0: RTL: rom_version status=0 version=2
[ 10.047250] Bluetooth: hci0: RTL: loading rtl_bt/rtl8822bs_fw.bin
[ 10.114730] Bluetooth: hci0: RTL: loading rtl_bt/rtl8822bs_config.bin
[ 10.237433] Bluetooth: hci0: RTL: cfg_sz 75, total sz 24543
[ 11.244540] Bluetooth: hci0: RTL: fw version 0xaa89f793
[ 11.279285] Bluetooth: hci0: broken local ext features page 2

Rudi Heitbaum (3):
dt-bindings: net: realtek-bluetooth: Add RTL8822BS
Bluetooth: btrtl: Add support for RTL8822BS UART
arm64: dts: allwinner: h6: tanix-tx6: Add compatible bluetooth

.../devicetree/bindings/net/realtek-bluetooth.yaml | 13 ++++++++-----
.../boot/dts/allwinner/sun50i-h6-tanix-tx6.dts | 2 +-
drivers/bluetooth/btrtl.c | 12 +++++++++++-
drivers/bluetooth/hci_h5.c | 6 ++++++
4 files changed, 26 insertions(+), 7 deletions(-)


base-commit: bb7c241fae6228e89c0286ffd6f249b3b0dea225
--
2.25.1



2023-05-14 07:51:32

by Rudi Heitbaum

[permalink] [raw]
Subject: [PATCH 1/3] dt-bindings: net: realtek-bluetooth: Add RTL8822BS

Add compatible string for RTL8822BS for existing Realtek Bluetooth
driver.

Signed-off-by: Rudi Heitbaum <[email protected]>
---
.../devicetree/bindings/net/realtek-bluetooth.yaml | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/realtek-bluetooth.yaml b/Documentation/devicetree/bindings/net/realtek-bluetooth.yaml
index 8cc2b9924680..d2103931fc1c 100644
--- a/Documentation/devicetree/bindings/net/realtek-bluetooth.yaml
+++ b/Documentation/devicetree/bindings/net/realtek-bluetooth.yaml
@@ -4,16 +4,16 @@
$id: http://devicetree.org/schemas/net/realtek-bluetooth.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

-title: RTL8723BS/RTL8723CS/RTL8821CS/RTL8822CS Bluetooth
+title: RTL8723BS/RTL8723CS/RTL8821CS/RTL8822BS/RTL8822CS Bluetooth

maintainers:
- Vasily Khoruzhick <[email protected]>
- Alistair Francis <[email protected]>

description:
- RTL8723CS/RTL8723CS/RTL8821CS/RTL8822CS is a WiFi + BT chip. WiFi part
- is connected over SDIO, while BT is connected over serial. It speaks
- H5 protocol with few extra commands to upload firmware and change
+ RTL8723CS/RTL8723CS/RTL8821CS/RTL8822BS/RTL8822CS is a WiFi + BT chip.
+ WiFi part is connected over SDIO, while BT is connected over serial. It
+ speaks H5 protocol with few extra commands to upload firmware and change
module speed.

properties:
@@ -23,11 +23,14 @@ properties:
- realtek,rtl8723bs-bt
- realtek,rtl8723cs-bt
- realtek,rtl8723ds-bt
+ - realtek,rtl8822bs-bt
- realtek,rtl8822cs-bt
- items:
- enum:
- realtek,rtl8821cs-bt
- - const: realtek,rtl8822cs-bt
+ - const:
+ - realtek,rtl8822bs-bt
+ - realtek,rtl8822cs-bt

device-wake-gpios:
maxItems: 1
--
2.25.1


2023-05-14 08:07:44

by Rudi Heitbaum

[permalink] [raw]
Subject: [PATCH 2/3] Bluetooth: btrtl: Add support for RTL8822BS UART

Add a RTL8822BS UART with hci_ver = 0x07. This is similar to RTL8822CS
observed on the Tanix TX6 Android set-top box. But the previous
generation of chip. The RTL8822BS requires the
BROKEN_LOCAL_EXT_FEATURES_PAGE_2 quirk.

Signed-off-by: Rudi Heitbaum <[email protected]>
---
drivers/bluetooth/btrtl.c | 12 +++++++++++-
drivers/bluetooth/hci_h5.c | 6 ++++++
2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c
index 2915c82d719d..b53a4ef88550 100644
--- a/drivers/bluetooth/btrtl.c
+++ b/drivers/bluetooth/btrtl.c
@@ -234,7 +234,15 @@ static const struct id_table ic_id_table[] = {
.fw_name = "rtl_bt/rtl8822cu_fw.bin",
.cfg_name = "rtl_bt/rtl8822cu_config" },

- /* 8822B */
+ /* 8822BS with UART interface */
+ { IC_INFO(RTL_ROM_LMP_8822B, 0xb, 0x7, HCI_UART),
+ .config_needed = true,
+ .has_rom_version = true,
+ .has_msft_ext = true,
+ .fw_name = "rtl_bt/rtl8822bs_fw.bin",
+ .cfg_name = "rtl_bt/rtl8822bs_config" },
+
+ /* 8822BU with USB interface */
{ IC_INFO(RTL_ROM_LMP_8822B, 0xb, 0x7, HCI_USB),
.config_needed = true,
.has_rom_version = true,
@@ -1182,6 +1190,8 @@ void btrtl_set_quirks(struct hci_dev *hdev, struct btrtl_device_info *btrtl_dev)

hci_set_aosp_capable(hdev);
break;
+ case CHIP_ID_8822B:
+ set_bit(HCI_QUIRK_BROKEN_LOCAL_EXT_FEATURES_PAGE_2, &hdev->quirks);
default:
rtl_dev_dbg(hdev, "Central-peripheral role not enabled.");
rtl_dev_dbg(hdev, "WBS supported not enabled.");
diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c
index fefc37b98b4a..726b6c7e28b8 100644
--- a/drivers/bluetooth/hci_h5.c
+++ b/drivers/bluetooth/hci_h5.c
@@ -1072,6 +1072,10 @@ static struct h5_vnd rtl_vnd = {
.acpi_gpio_map = acpi_btrtl_gpios,
};

+static const struct h5_device_data h5_data_rtl8822bs = {
+ .vnd = &rtl_vnd,
+};
+
static const struct h5_device_data h5_data_rtl8822cs = {
.vnd = &rtl_vnd,
};
@@ -1100,6 +1104,8 @@ static const struct dev_pm_ops h5_serdev_pm_ops = {

static const struct of_device_id rtl_bluetooth_of_match[] = {
#ifdef CONFIG_BT_HCIUART_RTL
+ { .compatible = "realtek,rtl8822bs-bt",
+ .data = (const void *)&h5_data_rtl8822bs },
{ .compatible = "realtek,rtl8822cs-bt",
.data = (const void *)&h5_data_rtl8822cs },
{ .compatible = "realtek,rtl8723bs-bt",
--
2.25.1


2023-05-14 08:51:26

by Christophe JAILLET

[permalink] [raw]
Subject: Re: [PATCH 2/3] Bluetooth: btrtl: Add support for RTL8822BS UART

Le 14/05/2023 à 09:47, Rudi Heitbaum a écrit :
> Add a RTL8822BS UART with hci_ver = 0x07. This is similar to RTL8822CS
> observed on the Tanix TX6 Android set-top box. But the previous
> generation of chip. The RTL8822BS requires the
> BROKEN_LOCAL_EXT_FEATURES_PAGE_2 quirk.
>
> Signed-off-by: Rudi Heitbaum <rudi-8t6dWLoy+3lWk0Htik3J/[email protected]>
> ---
> drivers/bluetooth/btrtl.c | 12 +++++++++++-
> drivers/bluetooth/hci_h5.c | 6 ++++++
> 2 files changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c
> index 2915c82d719d..b53a4ef88550 100644
> --- a/drivers/bluetooth/btrtl.c
> +++ b/drivers/bluetooth/btrtl.c
> @@ -234,7 +234,15 @@ static const struct id_table ic_id_table[] = {
> .fw_name = "rtl_bt/rtl8822cu_fw.bin",
> .cfg_name = "rtl_bt/rtl8822cu_config" },
>
> - /* 8822B */
> + /* 8822BS with UART interface */
> + { IC_INFO(RTL_ROM_LMP_8822B, 0xb, 0x7, HCI_UART),
> + .config_needed = true,
> + .has_rom_version = true,
> + .has_msft_ext = true,
> + .fw_name = "rtl_bt/rtl8822bs_fw.bin",
> + .cfg_name = "rtl_bt/rtl8822bs_config" },
> +
> + /* 8822BU with USB interface */
> { IC_INFO(RTL_ROM_LMP_8822B, 0xb, 0x7, HCI_USB),
> .config_needed = true,
> .has_rom_version = true,
> @@ -1182,6 +1190,8 @@ void btrtl_set_quirks(struct hci_dev *hdev, struct btrtl_device_info *btrtl_dev)
>
> hci_set_aosp_capable(hdev);
> break;
> + case CHIP_ID_8822B:
> + set_bit(HCI_QUIRK_BROKEN_LOCAL_EXT_FEATURES_PAGE_2, &hdev->quirks);

break missing?
If it is intentinal, a "fallthrough;" would be more explicit.

just my 2c,

CJ

> default:
> rtl_dev_dbg(hdev, "Central-peripheral role not enabled.");
> rtl_dev_dbg(hdev, "WBS supported not enabled.");
> diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c
> index fefc37b98b4a..726b6c7e28b8 100644
> --- a/drivers/bluetooth/hci_h5.c
> +++ b/drivers/bluetooth/hci_h5.c
> @@ -1072,6 +1072,10 @@ static struct h5_vnd rtl_vnd = {
> .acpi_gpio_map = acpi_btrtl_gpios,
> };
>
> +static const struct h5_device_data h5_data_rtl8822bs = {
> + .vnd = &rtl_vnd,
> +};
> +
> static const struct h5_device_data h5_data_rtl8822cs = {
> .vnd = &rtl_vnd,
> };
> @@ -1100,6 +1104,8 @@ static const struct dev_pm_ops h5_serdev_pm_ops = {
>
> static const struct of_device_id rtl_bluetooth_of_match[] = {
> #ifdef CONFIG_BT_HCIUART_RTL
> + { .compatible = "realtek,rtl8822bs-bt",
> + .data = (const void *)&h5_data_rtl8822bs },
> { .compatible = "realtek,rtl8822cs-bt",
> .data = (const void *)&h5_data_rtl8822cs },
> { .compatible = "realtek,rtl8723bs-bt",


2023-05-14 09:17:43

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH 2/3] Bluetooth: btrtl: Add support for RTL8822BS UART

Hi Rudi,

kernel test robot noticed the following build warnings:

[auto build test WARNING on bb7c241fae6228e89c0286ffd6f249b3b0dea225]

url: https://github.com/intel-lab-lkp/linux/commits/Rudi-Heitbaum/dt-bindings-net-realtek-bluetooth-Add-RTL8822BS/20230514-155000
base: bb7c241fae6228e89c0286ffd6f249b3b0dea225
patch link: https://lore.kernel.org/r/20230514074731.70614-3-rudi%40heitbaum.com
patch subject: [PATCH 2/3] Bluetooth: btrtl: Add support for RTL8822BS UART
config: arm-randconfig-r004-20230514
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project b0fb98227c90adf2536c9ad644a74d5e92961111)
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
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://github.com/intel-lab-lkp/linux/commit/2f68c37a4fd8f66ba45a8ff74d845954644401e0
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Rudi-Heitbaum/dt-bindings-net-realtek-bluetooth-Add-RTL8822BS/20230514-155000
git checkout 2f68c37a4fd8f66ba45a8ff74d845954644401e0
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/bluetooth/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email protected]>
| Link: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

>> drivers/bluetooth/btrtl.c:1195:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
default:
^
drivers/bluetooth/btrtl.c:1195:2: note: insert '__attribute__((fallthrough));' to silence this warning
default:
^
__attribute__((fallthrough));
drivers/bluetooth/btrtl.c:1195:2: note: insert 'break;' to avoid fall-through
default:
^
break;
1 warning generated.


vim +1195 drivers/bluetooth/btrtl.c

26503ad25de8c7c Martin Blumenstingl 2018-08-02 1164
3011faa29bc6f45 Archie Pusaka 2021-05-27 1165 void btrtl_set_quirks(struct hci_dev *hdev, struct btrtl_device_info *btrtl_dev)
26503ad25de8c7c Martin Blumenstingl 2018-08-02 1166 {
65251e2e0ad379d Alex Lu 2019-08-30 1167 /* Enable controller to do both LE scan and BR/EDR inquiry
65251e2e0ad379d Alex Lu 2019-08-30 1168 * simultaneously.
65251e2e0ad379d Alex Lu 2019-08-30 1169 */
65251e2e0ad379d Alex Lu 2019-08-30 1170 set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks);
65251e2e0ad379d Alex Lu 2019-08-30 1171
05672a2c14a4ea2 Abhishek Pandit-Subedi 2020-12-22 1172 /* Enable central-peripheral role (able to create new connections with
05672a2c14a4ea2 Abhishek Pandit-Subedi 2020-12-22 1173 * an existing connection in slave role).
05672a2c14a4ea2 Abhishek Pandit-Subedi 2020-12-22 1174 */
9ab9235fe5cf7f8 Max Chou 2021-01-27 1175 /* Enable WBS supported for the specific Realtek devices. */
9ab9235fe5cf7f8 Max Chou 2021-01-27 1176 switch (btrtl_dev->project_id) {
9ab9235fe5cf7f8 Max Chou 2021-01-27 1177 case CHIP_ID_8822C:
9ab9235fe5cf7f8 Max Chou 2021-01-27 1178 case CHIP_ID_8852A:
18e8055c88142d8 Max Chou 2022-03-14 1179 case CHIP_ID_8852B:
8b1d66b50437b65 Max Chou 2022-04-11 1180 case CHIP_ID_8852C:
7948fe1c92d9231 Max Chou 2023-04-18 1181 case CHIP_ID_8851B:
05672a2c14a4ea2 Abhishek Pandit-Subedi 2020-12-22 1182 set_bit(HCI_QUIRK_VALID_LE_STATES, &hdev->quirks);
9ab9235fe5cf7f8 Max Chou 2021-01-27 1183 set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks);
a479e71322ced3e Hilda Wu 2022-10-05 1184
a479e71322ced3e Hilda Wu 2022-10-05 1185 /* RTL8852C needs to transmit mSBC data continuously without
a479e71322ced3e Hilda Wu 2022-10-05 1186 * the zero length of USB packets for the ALT 6 supported chips
a479e71322ced3e Hilda Wu 2022-10-05 1187 */
a479e71322ced3e Hilda Wu 2022-10-05 1188 if (btrtl_dev->project_id == CHIP_ID_8852C)
a479e71322ced3e Hilda Wu 2022-10-05 1189 btrealtek_set_flag(hdev, REALTEK_ALT6_CONTINUOUS_TX_CHIP);
a479e71322ced3e Hilda Wu 2022-10-05 1190
099c6d31764b97d Joseph Hwang 2021-09-26 1191 hci_set_aosp_capable(hdev);
05672a2c14a4ea2 Abhishek Pandit-Subedi 2020-12-22 1192 break;
2f68c37a4fd8f66 Rudi Heitbaum 2023-05-14 1193 case CHIP_ID_8822B:
2f68c37a4fd8f66 Rudi Heitbaum 2023-05-14 1194 set_bit(HCI_QUIRK_BROKEN_LOCAL_EXT_FEATURES_PAGE_2, &hdev->quirks);
05672a2c14a4ea2 Abhishek Pandit-Subedi 2020-12-22 @1195 default:
05672a2c14a4ea2 Abhishek Pandit-Subedi 2020-12-22 1196 rtl_dev_dbg(hdev, "Central-peripheral role not enabled.");
9ab9235fe5cf7f8 Max Chou 2021-01-27 1197 rtl_dev_dbg(hdev, "WBS supported not enabled.");
05672a2c14a4ea2 Abhishek Pandit-Subedi 2020-12-22 1198 break;
05672a2c14a4ea2 Abhishek Pandit-Subedi 2020-12-22 1199 }
c0123cb6c4c7fc2 Vasily Khoruzhick 2023-03-07 1200
253cf30e8d3d001 Max Chou 2023-03-21 1201 if (!btrtl_dev->ic_info)
253cf30e8d3d001 Max Chou 2023-03-21 1202 return;
253cf30e8d3d001 Max Chou 2023-03-21 1203
c0123cb6c4c7fc2 Vasily Khoruzhick 2023-03-07 1204 switch (btrtl_dev->ic_info->lmp_subver) {
c0123cb6c4c7fc2 Vasily Khoruzhick 2023-03-07 1205 case RTL_ROM_LMP_8703B:
c0123cb6c4c7fc2 Vasily Khoruzhick 2023-03-07 1206 /* 8723CS reports two pages for local ext features,
c0123cb6c4c7fc2 Vasily Khoruzhick 2023-03-07 1207 * but it doesn't support any features from page 2 -
c0123cb6c4c7fc2 Vasily Khoruzhick 2023-03-07 1208 * it either responds with garbage or with error status
c0123cb6c4c7fc2 Vasily Khoruzhick 2023-03-07 1209 */
c0123cb6c4c7fc2 Vasily Khoruzhick 2023-03-07 1210 set_bit(HCI_QUIRK_BROKEN_LOCAL_EXT_FEATURES_PAGE_2,
c0123cb6c4c7fc2 Vasily Khoruzhick 2023-03-07 1211 &hdev->quirks);
c0123cb6c4c7fc2 Vasily Khoruzhick 2023-03-07 1212 break;
c0123cb6c4c7fc2 Vasily Khoruzhick 2023-03-07 1213 default:
c0123cb6c4c7fc2 Vasily Khoruzhick 2023-03-07 1214 break;
c0123cb6c4c7fc2 Vasily Khoruzhick 2023-03-07 1215 }
3011faa29bc6f45 Archie Pusaka 2021-05-27 1216 }
3011faa29bc6f45 Archie Pusaka 2021-05-27 1217 EXPORT_SYMBOL_GPL(btrtl_set_quirks);
3011faa29bc6f45 Archie Pusaka 2021-05-27 1218

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests


Attachments:
(No filename) (7.09 kB)
config (150.69 kB)
Download all attachments

2023-05-14 09:18:30

by bluez.test.bot

[permalink] [raw]
Subject: RE: Bluetooth: btrtl: Add support for RTL8822BS

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

---Test result---

Test Summary:
CheckPatch PASS 2.04 seconds
GitLint PASS 0.89 seconds
SubjectPrefix FAIL 0.60 seconds
BuildKernel PASS 32.50 seconds
CheckAllWarning WARNING 35.62 seconds
CheckSparse WARNING 40.87 seconds
CheckSmatch WARNING 110.27 seconds
BuildKernel32 PASS 31.83 seconds
TestRunnerSetup PASS 457.47 seconds
TestRunner_l2cap-tester PASS 17.22 seconds
TestRunner_iso-tester PASS 21.84 seconds
TestRunner_bnep-tester PASS 5.67 seconds
TestRunner_mgmt-tester PASS 117.57 seconds
TestRunner_rfcomm-tester PASS 9.11 seconds
TestRunner_sco-tester PASS 8.41 seconds
TestRunner_ioctl-tester PASS 9.88 seconds
TestRunner_mesh-tester PASS 7.20 seconds
TestRunner_smp-tester PASS 8.31 seconds
TestRunner_userchan-tester PASS 6.02 seconds
IncrementalBuild PASS 39.59 seconds

Details
##############################
Test: SubjectPrefix - FAIL
Desc: Check subject contains "Bluetooth" prefix
Output:
"Bluetooth: " prefix is not specified in the subject
"Bluetooth: " prefix is not specified in the subject
##############################
Test: CheckAllWarning - WARNING
Desc: Run linux kernel with all warning enabled
Output:
drivers/bluetooth/btrtl.c: In function ‘btrtl_set_quirks’:drivers/bluetooth/btrtl.c:1194:3: warning: this statement may fall through [-Wimplicit-fallthrough=] 1194 | set_bit(HCI_QUIRK_BROKEN_LOCAL_EXT_FEATURES_PAGE_2, &hdev->quirks); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~drivers/bluetooth/btrtl.c:1195:2: note: here 1195 | default: | ^~~~~~~
##############################
Test: CheckSparse - WARNING
Desc: Run sparse tool with linux kernel
Output:
drivers/bluetooth/btrtl.c: In function ‘btrtl_set_quirks’:drivers/bluetooth/btrtl.c:1194:3: warning: this statement may fall through [-Wimplicit-fallthrough=]drivers/bluetooth/btrtl.c:1195:2: note: here
##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
drivers/bluetooth/btrtl.c: In function ‘btrtl_set_quirks’:drivers/bluetooth/btrtl.c:1194:3: warning: this statement may fall through [-Wimplicit-fallthrough=]drivers/bluetooth/btrtl.c:1195:2: note: here


---
Regards,
Linux Bluetooth

2023-05-14 09:52:10

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH 2/3] Bluetooth: btrtl: Add support for RTL8822BS UART

Hi Rudi,

kernel test robot noticed the following build warnings:

[auto build test WARNING on bb7c241fae6228e89c0286ffd6f249b3b0dea225]

url: https://github.com/intel-lab-lkp/linux/commits/Rudi-Heitbaum/dt-bindings-net-realtek-bluetooth-Add-RTL8822BS/20230514-155000
base: bb7c241fae6228e89c0286ffd6f249b3b0dea225
patch link: https://lore.kernel.org/r/20230514074731.70614-3-rudi%40heitbaum.com
patch subject: [PATCH 2/3] Bluetooth: btrtl: Add support for RTL8822BS UART
config: csky-randconfig-r035-20230514
compiler: csky-linux-gcc (GCC) 12.1.0
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/intel-lab-lkp/linux/commit/2f68c37a4fd8f66ba45a8ff74d845954644401e0
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Rudi-Heitbaum/dt-bindings-net-realtek-bluetooth-Add-RTL8822BS/20230514-155000
git checkout 2f68c37a4fd8f66ba45a8ff74d845954644401e0
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=csky olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=csky SHELL=/bin/bash drivers/bluetooth/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email protected]>
| Link: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

drivers/bluetooth/btrtl.c: In function 'btrtl_set_quirks':
>> drivers/bluetooth/btrtl.c:1194:17: warning: this statement may fall through [-Wimplicit-fallthrough=]
1194 | set_bit(HCI_QUIRK_BROKEN_LOCAL_EXT_FEATURES_PAGE_2, &hdev->quirks);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/bluetooth/btrtl.c:1195:9: note: here
1195 | default:
| ^~~~~~~


vim +1194 drivers/bluetooth/btrtl.c

1164
1165 void btrtl_set_quirks(struct hci_dev *hdev, struct btrtl_device_info *btrtl_dev)
1166 {
1167 /* Enable controller to do both LE scan and BR/EDR inquiry
1168 * simultaneously.
1169 */
1170 set_bit(HCI_QUIRK_SIMULTANEOUS_DISCOVERY, &hdev->quirks);
1171
1172 /* Enable central-peripheral role (able to create new connections with
1173 * an existing connection in slave role).
1174 */
1175 /* Enable WBS supported for the specific Realtek devices. */
1176 switch (btrtl_dev->project_id) {
1177 case CHIP_ID_8822C:
1178 case CHIP_ID_8852A:
1179 case CHIP_ID_8852B:
1180 case CHIP_ID_8852C:
1181 case CHIP_ID_8851B:
1182 set_bit(HCI_QUIRK_VALID_LE_STATES, &hdev->quirks);
1183 set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks);
1184
1185 /* RTL8852C needs to transmit mSBC data continuously without
1186 * the zero length of USB packets for the ALT 6 supported chips
1187 */
1188 if (btrtl_dev->project_id == CHIP_ID_8852C)
1189 btrealtek_set_flag(hdev, REALTEK_ALT6_CONTINUOUS_TX_CHIP);
1190
1191 hci_set_aosp_capable(hdev);
1192 break;
1193 case CHIP_ID_8822B:
> 1194 set_bit(HCI_QUIRK_BROKEN_LOCAL_EXT_FEATURES_PAGE_2, &hdev->quirks);
1195 default:
1196 rtl_dev_dbg(hdev, "Central-peripheral role not enabled.");
1197 rtl_dev_dbg(hdev, "WBS supported not enabled.");
1198 break;
1199 }
1200
1201 if (!btrtl_dev->ic_info)
1202 return;
1203
1204 switch (btrtl_dev->ic_info->lmp_subver) {
1205 case RTL_ROM_LMP_8703B:
1206 /* 8723CS reports two pages for local ext features,
1207 * but it doesn't support any features from page 2 -
1208 * it either responds with garbage or with error status
1209 */
1210 set_bit(HCI_QUIRK_BROKEN_LOCAL_EXT_FEATURES_PAGE_2,
1211 &hdev->quirks);
1212 break;
1213 default:
1214 break;
1215 }
1216 }
1217 EXPORT_SYMBOL_GPL(btrtl_set_quirks);
1218

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests


Attachments:
(No filename) (4.20 kB)
config (180.00 kB)
Download all attachments

2023-05-14 10:42:21

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 1/3] dt-bindings: net: realtek-bluetooth: Add RTL8822BS

On Sun, 14 May 2023 07:47:29 +0000, Rudi Heitbaum wrote:
> Add compatible string for RTL8822BS for existing Realtek Bluetooth
> driver.
>
> Signed-off-by: Rudi Heitbaum <[email protected]>
> ---
> .../devicetree/bindings/net/realtek-bluetooth.yaml | 13 ++++++++-----
> 1 file changed, 8 insertions(+), 5 deletions(-)
>

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/realtek-bluetooth.yaml: properties:compatible:oneOf:1:items: 'oneOf' conditional failed, one must be fixed:
[{'enum': ['realtek,rtl8821cs-bt']}, {'const': ['realtek,rtl8822bs-bt', 'realtek,rtl8822cs-bt']}] is not of type 'object'
['realtek,rtl8822bs-bt', 'realtek,rtl8822cs-bt'] is not of type 'integer', 'string'
from schema $id: http://devicetree.org/meta-schemas/keywords.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/realtek-bluetooth.yaml: properties:compatible:oneOf:1:items: 'oneOf' conditional failed, one must be fixed:
[{'enum': ['realtek,rtl8821cs-bt']}, {'const': ['realtek,rtl8822bs-bt', 'realtek,rtl8822cs-bt']}] is not of type 'object'
['realtek,rtl8822bs-bt', 'realtek,rtl8822cs-bt'] is not of type 'string'
from schema $id: http://devicetree.org/meta-schemas/string-array.yaml#
Traceback (most recent call last):
File "/usr/local/bin/dt-validate", line 167, in <module>
sg.check_trees(filename, testtree)
...
File "/usr/lib/python3.10/sre_parse.py", line 599, in _parse
raise source.error(msg, len(this) + 1 + len(that))
re.error: bad character range s-b at position 18

Note: You even broke the dtschema :)

See https://patchwork.ozlabs.org/patch/1781021

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.

2023-05-14 11:15:12

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH 2/3] Bluetooth: btrtl: Add support for RTL8822BS UART

Hi Rudi,

kernel test robot noticed the following build warnings:

[auto build test WARNING on bb7c241fae6228e89c0286ffd6f249b3b0dea225]

url: https://github.com/intel-lab-lkp/linux/commits/Rudi-Heitbaum/dt-bindings-net-realtek-bluetooth-Add-RTL8822BS/20230514-155000
base: bb7c241fae6228e89c0286ffd6f249b3b0dea225
patch link: https://lore.kernel.org/r/20230514074731.70614-3-rudi%40heitbaum.com
patch subject: [PATCH 2/3] Bluetooth: btrtl: Add support for RTL8822BS UART
config: arm-allyesconfig
compiler: arm-linux-gnueabi-gcc (GCC) 12.1.0
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/intel-lab-lkp/linux/commit/2f68c37a4fd8f66ba45a8ff74d845954644401e0
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Rudi-Heitbaum/dt-bindings-net-realtek-bluetooth-Add-RTL8822BS/20230514-155000
git checkout 2f68c37a4fd8f66ba45a8ff74d845954644401e0
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/bluetooth/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email protected]>
| Link: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

In file included from include/linux/bitops.h:68,
from include/linux/log2.h:12,
from include/asm-generic/div64.h:55,
from arch/arm/include/asm/div64.h:107,
from include/linux/math.h:6,
from include/linux/math64.h:6,
from include/linux/time.h:6,
from include/linux/stat.h:19,
from include/linux/module.h:13,
from drivers/bluetooth/btrtl.c:8:
drivers/bluetooth/btrtl.c: In function 'btrtl_set_quirks':
>> arch/arm/include/asm/bitops.h:185:41: warning: this statement may fall through [-Wimplicit-fallthrough=]
185 | #define ATOMIC_BITOP(name,nr,p) _##name(nr,p)
| ^~~~~~~~~~~~~
arch/arm/include/asm/bitops.h:191:41: note: in expansion of macro 'ATOMIC_BITOP'
191 | #define set_bit(nr,p) ATOMIC_BITOP(set_bit,nr,p)
| ^~~~~~~~~~~~
drivers/bluetooth/btrtl.c:1194:17: note: in expansion of macro 'set_bit'
1194 | set_bit(HCI_QUIRK_BROKEN_LOCAL_EXT_FEATURES_PAGE_2, &hdev->quirks);
| ^~~~~~~
drivers/bluetooth/btrtl.c:1195:9: note: here
1195 | default:
| ^~~~~~~


vim +185 arch/arm/include/asm/bitops.h

^1da177e4c3f41 include/asm-arm/bitops.h Linus Torvalds 2005-04-16 177
e7ec02938dbe8c include/asm-arm/bitops.h Russell King 2005-07-28 178 #ifndef CONFIG_SMP
^1da177e4c3f41 include/asm-arm/bitops.h Linus Torvalds 2005-04-16 179 /*
^1da177e4c3f41 include/asm-arm/bitops.h Linus Torvalds 2005-04-16 180 * The __* form of bitops are non-atomic and may be reordered.
^1da177e4c3f41 include/asm-arm/bitops.h Linus Torvalds 2005-04-16 181 */
6323f0ccedf756 arch/arm/include/asm/bitops.h Russell King 2011-01-16 182 #define ATOMIC_BITOP(name,nr,p) \
6323f0ccedf756 arch/arm/include/asm/bitops.h Russell King 2011-01-16 183 (__builtin_constant_p(nr) ? ____atomic_##name(nr, p) : _##name(nr,p))
e7ec02938dbe8c include/asm-arm/bitops.h Russell King 2005-07-28 184 #else
6323f0ccedf756 arch/arm/include/asm/bitops.h Russell King 2011-01-16 @185 #define ATOMIC_BITOP(name,nr,p) _##name(nr,p)
e7ec02938dbe8c include/asm-arm/bitops.h Russell King 2005-07-28 186 #endif
^1da177e4c3f41 include/asm-arm/bitops.h Linus Torvalds 2005-04-16 187

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests


Attachments:
(No filename) (4.19 kB)
config (375.02 kB)
Download all attachments