2023-10-03 18:20:55

by Kirill A. Shutemov

[permalink] [raw]
Subject: Regression: devcoredump patch broke Realtek usb bluetooth adapter

Hi,

Commit 044014ce85a1 ("Bluetooth: btrtl: Add Realtek devcoredump support")
broke Realtek-based ASUS USB-BT500, ID 0b05:190e.

Devices failed to connect. hciconfig showed a controller with all-zero BD
address.

I reverted the commit as well as bd003fb338af that depends on the commit.
It made the problem go away.

I know virtually nothing about bluetooth. Let me know what info you need
to debug the issue.

--
Kiryl Shutsemau / Kirill A. Shutemov


2023-10-03 23:56:48

by Bagas Sanjaya

[permalink] [raw]
Subject: Re: Regression: devcoredump patch broke Realtek usb bluetooth adapter

On Tue, Oct 03, 2023 at 09:20:38PM +0300, Kirill A. Shutemov wrote:
> Hi,
>
> Commit 044014ce85a1 ("Bluetooth: btrtl: Add Realtek devcoredump support")
> broke Realtek-based ASUS USB-BT500, ID 0b05:190e.
>
> Devices failed to connect. hciconfig showed a controller with all-zero BD
> address.

What is its output then? And dmesg log?

>
> I reverted the commit as well as bd003fb338af that depends on the commit.
> It made the problem go away.
>
> I know virtually nothing about bluetooth. Let me know what info you need
> to debug the issue.
>

Hilda, it looks like this regression is caused by a commit of yours. Would
you like to take a look on it?

Regardless, thanks for the regression report. I'm adding it to regzbot:

#regzbot ^introduced: 044014ce85a17c

--
An old man doll... just what I always wanted! - Clara


Attachments:
(No filename) (855.00 B)
signature.asc (235.00 B)
Download all attachments

2023-10-04 04:50:33

by Kirill A. Shutemov

[permalink] [raw]
Subject: Re: Regression: devcoredump patch broke Realtek usb bluetooth adapter

On Wed, Oct 04, 2023 at 03:07:24AM +0000, Max Chou wrote:
> Hi! Kirill,
> I based on Kernel v6.5.5 and updated drivers/bluetooth to the last version of bluetooth-next tree for a test with RTL8761BUV.
> The dmesg log and "hciconfig -a" are correct.
> Could you share the dmesg for your failure case?
>
> [56133.563293] usb 3-1: new full-speed USB device number 28 using xhci_hcd
> [56133.712559] usb 3-1: New USB device found, idVendor=0bda, idProduct=8771, bcdDevice= 2.00
> [56133.712577] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> [56133.712582] usb 3-1: Product: Bluetooth Radio
> [56133.712585] usb 3-1: Manufacturer: Realtek
> [56133.712588] usb 3-1: SerialNumber: 00E04C239987
> [56133.737812] usbcore: registered new interface driver btusb
> [56133.742126] Bluetooth: hci0: RTL: examining hci_ver=0a hci_rev=000b lmp_ver=0a lmp_subver=8761
> [56133.743115] Bluetooth: hci0: RTL: rom_version status=0 version=1
> [56133.743124] Bluetooth: hci0: RTL: loading rtl_bt/rtl8761bu_fw.bin
> [56133.743754] Bluetooth: hci0: RTL: loading rtl_bt/rtl8761bu_config.bin
> [56133.743829] Bluetooth: hci0: RTL: cfg_sz 6, total sz 30210
> [56133.913311] Bluetooth: hci0: RTL: fw version 0xdfc6d922
> [56133.980299] Bluetooth: MGMT ver 1.22
>
> hci0: Type: Primary Bus: USB
> BD Address: 98:A2:35:85:56:F1 ACL MTU: 1021:6 SCO MTU: 255:12
> UP RUNNING
> RX bytes:1670 acl:0 sco:0 events:184 errors:0
> TX bytes:33917 acl:0 sco:0 commands:184 errors:0
> Features: 0xff 0xff 0xff 0xfe 0xdb 0xfd 0x7b 0x87
> Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
> Link policy: RSWITCH HOLD SNIFF PARK
> Link mode: PERIPHERAL ACCEPT
> Name: 'max-ThinkPad-X230'
> Class: 0x6c010c
> Service Classes: Rendering, Capturing, Audio, Telephony
> Device Class: Computer, Laptop
> HCI Version: 5.1 (0xa) Revision: 0xdfc6
> LMP Version: 5.1 (0xa) Subversion: 0xd922
> Manufacturer: Realtek Semiconductor Corporation (93)

I don't see anything obviously wrong in dmesg. Attached hciconfig and
dmesg for both functional and broken cases.

--
Kiryl Shutsemau / Kirill A. Shutemov


Attachments:
(No filename) (2.19 kB)
dmesg.bad (73.17 kB)
dmesg.good (73.60 kB)
hciconfig.bad (327.00 B)
hciconfig.good (687.00 B)
Download all attachments

2023-10-04 05:56:11

by Max Chou

[permalink] [raw]
Subject: RE: Regression: devcoredump patch broke Realtek usb bluetooth adapter

Hi! Kirill,
As your mentions, there's not obvious wrong from the dmesg.
Could you capture btmon log with raw data? (btmon -w xxx.log)
In additional, did you build the last version of bluetooth-next?
By my understanding, you can just duplicate the issue by the commit "044014ce85a1 Bluetooth: btrtl: Add Realtek devcoredump support"?
Unfortunately, I can not duplicate this issue sofar.


BRs,
Max


> -----Original Message-----
> From: Kirill A. Shutemov <[email protected]>
> Sent: Wednesday, October 4, 2023 12:50 PM
> To: Max Chou <[email protected]>
> Cc: Bagas Sanjaya <[email protected]>; Hilda Wu
> <[email protected]>; [email protected]; Luiz Augusto von Dentz
> <[email protected]>; Marcel Holtmann <[email protected]>;
> Johan Hedberg <[email protected]>; Juerg Haefliger
> <[email protected]>; Linux Bluetooth
> <[email protected]>; Thorsten Leemhuis <[email protected]>;
> Linux Regressions <[email protected]>; Linux Kernel Mailing List
> <[email protected]>
> Subject: Re: Regression: devcoredump patch broke Realtek usb bluetooth
> adapter
>
>
> External mail.
>
>
>
> On Wed, Oct 04, 2023 at 03:07:24AM +0000, Max Chou wrote:
> > Hi! Kirill,
> > I based on Kernel v6.5.5 and updated drivers/bluetooth to the last version of
> bluetooth-next tree for a test with RTL8761BUV.
> > The dmesg log and "hciconfig -a" are correct.
> > Could you share the dmesg for your failure case?
> >
> > [56133.563293] usb 3-1: new full-speed USB device number 28 using
> > xhci_hcd [56133.712559] usb 3-1: New USB device found, idVendor=0bda,
> > idProduct=8771, bcdDevice= 2.00 [56133.712577] usb 3-1: New USB device
> > strings: Mfr=1, Product=2, SerialNumber=3 [56133.712582] usb 3-1:
> > Product: Bluetooth Radio [56133.712585] usb 3-1: Manufacturer: Realtek
> > [56133.712588] usb 3-1: SerialNumber: 00E04C239987 [56133.737812]
> > usbcore: registered new interface driver btusb [56133.742126]
> > Bluetooth: hci0: RTL: examining hci_ver=0a hci_rev=000b lmp_ver=0a
> > lmp_subver=8761 [56133.743115] Bluetooth: hci0: RTL: rom_version
> > status=0 version=1 [56133.743124] Bluetooth: hci0: RTL: loading
> > rtl_bt/rtl8761bu_fw.bin [56133.743754] Bluetooth: hci0: RTL: loading
> > rtl_bt/rtl8761bu_config.bin [56133.743829] Bluetooth: hci0: RTL:
> > cfg_sz 6, total sz 30210 [56133.913311] Bluetooth: hci0: RTL: fw
> > version 0xdfc6d922 [56133.980299] Bluetooth: MGMT ver 1.22
> >
> > hci0: Type: Primary Bus: USB
> > BD Address: 98:A2:35:85:56:F1 ACL MTU: 1021:6 SCO MTU:
> 255:12
> > UP RUNNING
> > RX bytes:1670 acl:0 sco:0 events:184 errors:0
> > TX bytes:33917 acl:0 sco:0 commands:184 errors:0
> > Features: 0xff 0xff 0xff 0xfe 0xdb 0xfd 0x7b 0x87
> > Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
> > Link policy: RSWITCH HOLD SNIFF PARK
> > Link mode: PERIPHERAL ACCEPT
> > Name: 'max-ThinkPad-X230'
> > Class: 0x6c010c
> > Service Classes: Rendering, Capturing, Audio, Telephony
> > Device Class: Computer, Laptop
> > HCI Version: 5.1 (0xa) Revision: 0xdfc6
> > LMP Version: 5.1 (0xa) Subversion: 0xd922
> > Manufacturer: Realtek Semiconductor Corporation (93)
>
> I don't see anything obviously wrong in dmesg. Attached hciconfig and dmesg
> for both functional and broken cases.
>
> --
> Kiryl Shutsemau / Kirill A. Shutemov

2023-10-04 11:46:28

by Kirill A. Shutemov

[permalink] [raw]
Subject: Re: Regression: devcoredump patch broke Realtek usb bluetooth adapter

On Wed, Oct 04, 2023 at 07:28:45AM +0000, Max Chou wrote:
> Hi! Kirill,
> I guess the root cause is as below.
> ===
> static int btrtl_register_devcoredump_support(struct hci_dev *hdev)
> {
> int err;
>
> err = hci_devcd_register(hdev, btrtl_coredump, btrtl_dmp_hdr, NULL);
>
> return err;
> }
> ===
> If CONFIG_DEV_COREDUMP is not enabled, it would return -EOPNOTSUPP for hci_devcd_register().
> Unfortunately, btrtl_register_devcoredump_support() will return it.
> Finally, -EOPNOSTUPP will be returned for btrtl_setup_realtek().
>
> Could you have the following workaround for the root cause checked?
> Please share dmesg as well. Thanks,

Yes. It works and I see

[ 3.640539] Bluetooth: hci0: RTL: btrtl_register_devcoredump_support(): err = -95

in dmesg. -EOPNOTSUPP indeed.

--
Kiryl Shutsemau / Kirill A. Shutemov

Subject: Re: Regression: devcoredump patch broke Realtek usb bluetooth adapter

[TLDR: This mail in primarily relevant for Linux kernel regression
tracking. See link in footer if these mails annoy you.]

On 04.10.23 01:56, Bagas Sanjaya wrote:
> On Tue, Oct 03, 2023 at 09:20:38PM +0300, Kirill A. Shutemov wrote:
>>
>> Commit 044014ce85a1 ("Bluetooth: btrtl: Add Realtek devcoredump support")
>> broke Realtek-based ASUS USB-BT500, ID 0b05:190e.
>>
>> Devices failed to connect. hciconfig showed a controller with all-zero BD
>> address.

#regzbot fix: Bluetooth: btrtl: Ignore error return for hci_devcd_register()
#regzbot ignore-activity

Ciao, Thorsten (wearing his 'the Linux kernel's regression tracker' hat)
--
Everything you wanna know about Linux kernel regression tracking:
https://linux-regtracking.leemhuis.info/about/#tldr
That page also explains what to do if mails like this annoy you.