2022-06-23 00:22:53

by John Klug

[permalink] [raw]
Subject: Unexplained calls to hci_conn_add_sysfs()

Kernel v5.4.199, Bluez 5.64.

We are using btattach.? We are not seeing btattach going away, nor are we seeing a new one added (we would not expect this to happen).

But we are seeing periodic messages:

Jun 22 18:26:14 ecc8 user.err kernel: debugfs: Directory '0' with parent 'hci0' already present!
Jun 22 18:26:14 ecc8 user.warn kernel: sysfs: cannot create duplicate filename '/devices/platform/ahb/700000.ehci/usb1/1-2/1-2.4/1-2.4:1.0/tty/ttyACM0/hci0/hci0:0'
Jun 22 18:26:14 ecc8 user.warn kernel: CPU: 0 PID: 67 Comm: kworker/u3:0 Tainted: G O 5.4.199 #1
Jun 22 18:26:14 ecc8 user.warn kernel: Hardware name: Atmel AT91SAM9
Jun 22 18:26:14 ecc8 user.warn kernel: Workqueue: hci0 hci_rx_work [bluetooth]
Jun 22 18:26:14 ecc8 user.warn kernel: [<c000f9e4>] (unwind_backtrace) from [<c000d3a0>] (show_stack+0x10/0x14)
Jun 22 18:26:14 ecc8 user.warn kernel: [<c000d3a0>] (show_stack) from [<c014132c>] (sysfs_warn_dup+0x4c/0x60)
Jun 22 18:26:14 ecc8 user.warn kernel: [<c014132c>] (sysfs_warn_dup) from [<c0141430>] (sysfs_create_dir_ns+0xb4/0xc4)
Jun 22 18:26:14 ecc8 user.warn kernel: [<c0141430>] (sysfs_create_dir_ns) from [<c058d790>] (kobject_add_internal+0x148/0x338)
Jun 22 18:26:14 ecc8 user.warn kernel: [<c058d790>] (kobject_add_internal) from [<c058d9fc>] (kobject_add+0x7c/0x8c)
Jun 22 18:26:14 ecc8 user.warn kernel: [<c058d9fc>] (kobject_add) from [<c0334630>] (device_add+0x140/0x590)
Jun 22 18:26:14 ecc8 user.warn kernel: [<c0334630>] (device_add) from [<bf103178>] (hci_conn_add_sysfs+0x50/0xb0 [bluetooth])
Jun 22 18:26:14 ecc8 user.warn kernel: [<bf103178>] (hci_conn_add_sysfs [bluetooth]) from [<bf0edf94>] (le_conn_complete_evt+0x33c/0x3fc [bluetooth])
Jun 22 18:26:14 ecc8 user.warn kernel: [<bf0edf94>] (le_conn_complete_evt [bluetooth]) from [<bf0f158c>] (hci_le_meta_evt+0x118/0xb10 [bluetooth])
Jun 22 18:26:14 ecc8 user.warn kernel: [<bf0f158c>] (hci_le_meta_evt [bluetooth]) from [<bf0f41b0>] (hci_event_packet+0x222c/0x2854 [bluetooth])
Jun 22 18:26:14 ecc8 user.warn kernel: [<bf0f41b0>] (hci_event_packet [bluetooth]) from [<bf0e4d94>] (hci_rx_work+0x1bc/0x348 [bluetooth])
Jun 22 18:26:14 ecc8 user.warn kernel: [<bf0e4d94>] (hci_rx_work [bluetooth]) from [<c002c024>] (process_one_work+0x180/0x220)
Jun 22 18:26:14 ecc8 user.warn kernel: [<c002c024>] (process_one_work) from [<c002ca58>] (worker_thread+0x27c/0x348)
Jun 22 18:26:14 ecc8 user.warn kernel: [<c002ca58>] (worker_thread) from [<c0031acc>] (kthread+0x130/0x13c)
Jun 22 18:26:14 ecc8 user.warn kernel: [<c0031acc>] (kthread) from [<c00090e0>] (ret_from_fork+0x14/0x34)
Jun 22 18:26:14 ecc8 user.warn kernel: Exception stack(0xc6075fb0 to 0xc6075ff8)
Jun 22 18:26:14 ecc8 user.warn kernel: 5fa0: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 00000000 00000000 00000000 00000000
Jun 22 18:26:14 ecc8 user.warn kernel: 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
Jun 22 18:26:14 ecc8 user.warn kernel: 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000

Is this to be expected?? If not, how can I track this one down?


2022-06-23 07:06:51

by Soenke Huster

[permalink] [raw]
Subject: Re: Unexplained calls to hci_conn_add_sysfs()

Hi John,

On 23.06.22 01:39, John Klug wrote:
> Kernel v5.4.199, Bluez 5.64.
>
> We are using btattach.  We are not seeing btattach going away, nor are we seeing a new one added (we would not expect this to happen).
>
> But we are seeing periodic messages:
>
> Jun 22 18:26:14 ecc8 user.err kernel: debugfs: Directory '0' with parent 'hci0' already present!
> Jun 22 18:26:14 ecc8 user.warn kernel: sysfs: cannot create duplicate filename '/devices/platform/ahb/700000.ehci/usb1/1-2/1-2.4/1-2.4:1.0/tty/ttyACM0/hci0/hci0:0'
> Jun 22 18:26:14 ecc8 user.warn kernel: CPU: 0 PID: 67 Comm: kworker/u3:0 Tainted: G O 5.4.199 #1
> Jun 22 18:26:14 ecc8 user.warn kernel: Hardware name: Atmel AT91SAM9
> Jun 22 18:26:14 ecc8 user.warn kernel: Workqueue: hci0 hci_rx_work [bluetooth]
> Jun 22 18:26:14 ecc8 user.warn kernel: [<c000f9e4>] (unwind_backtrace) from [<c000d3a0>] (show_stack+0x10/0x14)
> Jun 22 18:26:14 ecc8 user.warn kernel: [<c000d3a0>] (show_stack) from [<c014132c>] (sysfs_warn_dup+0x4c/0x60)
> Jun 22 18:26:14 ecc8 user.warn kernel: [<c014132c>] (sysfs_warn_dup) from [<c0141430>] (sysfs_create_dir_ns+0xb4/0xc4)
> Jun 22 18:26:14 ecc8 user.warn kernel: [<c0141430>] (sysfs_create_dir_ns) from [<c058d790>] (kobject_add_internal+0x148/0x338)
> Jun 22 18:26:14 ecc8 user.warn kernel: [<c058d790>] (kobject_add_internal) from [<c058d9fc>] (kobject_add+0x7c/0x8c)
> Jun 22 18:26:14 ecc8 user.warn kernel: [<c058d9fc>] (kobject_add) from [<c0334630>] (device_add+0x140/0x590)
> Jun 22 18:26:14 ecc8 user.warn kernel: [<c0334630>] (device_add) from [<bf103178>] (hci_conn_add_sysfs+0x50/0xb0 [bluetooth])
> Jun 22 18:26:14 ecc8 user.warn kernel: [<bf103178>] (hci_conn_add_sysfs [bluetooth]) from [<bf0edf94>] (le_conn_complete_evt+0x33c/0x3fc [bluetooth])
> Jun 22 18:26:14 ecc8 user.warn kernel: [<bf0edf94>] (le_conn_complete_evt [bluetooth]) from [<bf0f158c>] (hci_le_meta_evt+0x118/0xb10 [bluetooth])
> Jun 22 18:26:14 ecc8 user.warn kernel: [<bf0f158c>] (hci_le_meta_evt [bluetooth]) from [<bf0f41b0>] (hci_event_packet+0x222c/0x2854 [bluetooth])
> Jun 22 18:26:14 ecc8 user.warn kernel: [<bf0f41b0>] (hci_event_packet [bluetooth]) from [<bf0e4d94>] (hci_rx_work+0x1bc/0x348 [bluetooth])
> Jun 22 18:26:14 ecc8 user.warn kernel: [<bf0e4d94>] (hci_rx_work [bluetooth]) from [<c002c024>] (process_one_work+0x180/0x220)
> Jun 22 18:26:14 ecc8 user.warn kernel: [<c002c024>] (process_one_work) from [<c002ca58>] (worker_thread+0x27c/0x348)
> Jun 22 18:26:14 ecc8 user.warn kernel: [<c002ca58>] (worker_thread) from [<c0031acc>] (kthread+0x130/0x13c)
> Jun 22 18:26:14 ecc8 user.warn kernel: [<c0031acc>] (kthread) from [<c00090e0>] (ret_from_fork+0x14/0x34)
> Jun 22 18:26:14 ecc8 user.warn kernel: Exception stack(0xc6075fb0 to 0xc6075ff8)
> Jun 22 18:26:14 ecc8 user.warn kernel: 5fa0:                                     00000000 00000000 00000000 00000000
> Jun 22 18:26:14 ecc8 user.warn kernel: 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
> Jun 22 18:26:14 ecc8 user.warn kernel: 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000
>
> Is this to be expected?  If not, how can I track this one down?

I submitted a patch to fix this (?) and similar issues some months ago, can you check whether applying it helps?
It seems it is currently not in the stable 5.4 release.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d5ebaa7c5f6f688959e8d40840b2249ede63b8ed

2022-06-23 15:54:18

by John Klug

[permalink] [raw]
Subject: Re: Unexplained calls to hci_conn_add_sysfs()

Unfortunately this fix is now out of date.

I will fix it, but hci_event.c has apparently changed.

BT_DBG replaced bt_dev_dbg

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/net/bluetooth/hci_event.c?h=v5.4#n2474

and

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/net/bluetooth/hci_event.c?h=v5.4#n4684


From: S?nke Huster <[email protected]>
Sent: Thursday, June 23, 2022 2:03 AM
To: John Klug <[email protected]>; Linux-Bluetooth MailingList <[email protected]>
Subject: Re: Unexplained calls to hci_conn_add_sysfs()
?
Hi John,

On 23.06.22 01:39, John Klug wrote:
> Kernel v5.4.199, Bluez 5.64.
>
> We are using btattach.? We are not seeing btattach going away, nor are we seeing a new one added (we would not expect this to happen).
>
> But we are seeing periodic messages:
>
> Jun 22 18:26:14 ecc8 user.err kernel: debugfs: Directory '0' with parent 'hci0' already present!
> Jun 22 18:26:14 ecc8 user.warn kernel: sysfs: cannot create duplicate filename '/devices/platform/ahb/700000.ehci/usb1/1-2/1-2.4/1-2.4:1.0/tty/ttyACM0/hci0/hci0:0'
> Jun 22 18:26:14 ecc8 user.warn kernel: CPU: 0 PID: 67 Comm: kworker/u3:0 Tainted: G?????????? O????? 5.4.199 #1
> Jun 22 18:26:14 ecc8 user.warn kernel: Hardware name: Atmel AT91SAM9
> Jun 22 18:26:14 ecc8 user.warn kernel: Workqueue: hci0 hci_rx_work [bluetooth]
> Jun 22 18:26:14 ecc8 user.warn kernel: [<c000f9e4>] (unwind_backtrace) from [<c000d3a0>] (show_stack+0x10/0x14)
> Jun 22 18:26:14 ecc8 user.warn kernel: [<c000d3a0>] (show_stack) from [<c014132c>] (sysfs_warn_dup+0x4c/0x60)
> Jun 22 18:26:14 ecc8 user.warn kernel: [<c014132c>] (sysfs_warn_dup) from [<c0141430>] (sysfs_create_dir_ns+0xb4/0xc4)
> Jun 22 18:26:14 ecc8 user.warn kernel: [<c0141430>] (sysfs_create_dir_ns) from [<c058d790>] (kobject_add_internal+0x148/0x338)
> Jun 22 18:26:14 ecc8 user.warn kernel: [<c058d790>] (kobject_add_internal) from [<c058d9fc>] (kobject_add+0x7c/0x8c)
> Jun 22 18:26:14 ecc8 user.warn kernel: [<c058d9fc>] (kobject_add) from [<c0334630>] (device_add+0x140/0x590)
> Jun 22 18:26:14 ecc8 user.warn kernel: [<c0334630>] (device_add) from [<bf103178>] (hci_conn_add_sysfs+0x50/0xb0 [bluetooth])
> Jun 22 18:26:14 ecc8 user.warn kernel: [<bf103178>] (hci_conn_add_sysfs [bluetooth]) from [<bf0edf94>] (le_conn_complete_evt+0x33c/0x3fc [bluetooth])
> Jun 22 18:26:14 ecc8 user.warn kernel: [<bf0edf94>] (le_conn_complete_evt [bluetooth]) from [<bf0f158c>] (hci_le_meta_evt+0x118/0xb10 [bluetooth])
> Jun 22 18:26:14 ecc8 user.warn kernel: [<bf0f158c>] (hci_le_meta_evt [bluetooth]) from [<bf0f41b0>] (hci_event_packet+0x222c/0x2854 [bluetooth])
> Jun 22 18:26:14 ecc8 user.warn kernel: [<bf0f41b0>] (hci_event_packet [bluetooth]) from [<bf0e4d94>] (hci_rx_work+0x1bc/0x348 [bluetooth])
> Jun 22 18:26:14 ecc8 user.warn kernel: [<bf0e4d94>] (hci_rx_work [bluetooth]) from [<c002c024>] (process_one_work+0x180/0x220)
> Jun 22 18:26:14 ecc8 user.warn kernel: [<c002c024>] (process_one_work) from [<c002ca58>] (worker_thread+0x27c/0x348)
> Jun 22 18:26:14 ecc8 user.warn kernel: [<c002ca58>] (worker_thread) from [<c0031acc>] (kthread+0x130/0x13c)
> Jun 22 18:26:14 ecc8 user.warn kernel: [<c0031acc>] (kthread) from [<c00090e0>] (ret_from_fork+0x14/0x34)
> Jun 22 18:26:14 ecc8 user.warn kernel: Exception stack(0xc6075fb0 to 0xc6075ff8)
> Jun 22 18:26:14 ecc8 user.warn kernel: 5fa0: ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 00000000 00000000 00000000 00000000
> Jun 22 18:26:14 ecc8 user.warn kernel: 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
> Jun 22 18:26:14 ecc8 user.warn kernel: 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000
>
> Is this to be expected?? If not, how can I track this one down?

I submitted a patch to fix this (?) and similar issues some months ago, can you check whether applying it helps?
It seems it is currently not in the stable 5.4 release.
http://mail2.multitech.com:32224/?dmVyPTEuMDAxJiZmMmQ5YmI5ODM2ODk2YWY5Zj02MkI0MTA1MV8yMDQ2OV8xNDU2N18xJiZjZDBiZjA2NzZiMGQ5Mzc9MjMzMyYmdXJsPWh0dHBzJTNBJTJGJTJGZ2l0JTJFa2VybmVsJTJFb3JnJTJGcHViJTJGc2NtJTJGbGludXglMkZrZXJuZWwlMkZnaXQlMkZ0b3J2YWxkcyUyRmxpbnV4JTJFZ2l0JTJGY29tbWl0JTJGJTNGaWQlM0RkNWViYWE3YzVmNmY2ODg5NTllOGQ0MDg0MGIyMjQ5ZWRlNjNiOGVk