When trying to connect a Lenovo Active Pen 2, it connects (via bluetooth) for a few seconds, then disconnects. dmesg has: [Sat Nov 18 12:22:39 2017] ============================================ [Sat Nov 18 12:22:39 2017] WARNING: possible recursive locking detected [Sat Nov 18 12:22:39 2017] 4.15.0-0.rc0.git5.1.fc28.x86_64 #1 Not tainted [Sat Nov 18 12:22:39 2017] -------------------------------------------- [Sat Nov 18 12:22:39 2017] kworker/u17:2/681 is trying to acquire lock: [Sat Nov 18 12:22:39 2017] (sk_lock-AF_BLUETOOTH-BTPROTO_L2CAP){+.+.}, at: [<ffffffffc05de23c>] bt_accept_enqueue+0x3c/0xb0 [bluetooth] [Sat Nov 18 12:22:39 2017] but task is already holding lock: [Sat Nov 18 12:22:39 2017] (sk_lock-AF_BLUETOOTH-BTPROTO_L2CAP){+.+.}, at: [<ffffffffc061aa08>] l2cap_sock_new_connection_cb+0x18/0xa0 [bluetooth] [Sat Nov 18 12:22:39 2017] other info that might help us debug this: [Sat Nov 18 12:22:39 2017] Possible unsafe locking scenario: [Sat Nov 18 12:22:39 2017] CPU0 [Sat Nov 18 12:22:39 2017] ---- [Sat Nov 18 12:22:39 2017] lock(sk_lock-AF_BLUETOOTH-BTPROTO_L2CAP); [Sat Nov 18 12:22:39 2017] lock(sk_lock-AF_BLUETOOTH-BTPROTO_L2CAP); [Sat Nov 18 12:22:39 2017] *** DEADLOCK *** [Sat Nov 18 12:22:39 2017] May be due to missing lock nesting notation [Sat Nov 18 12:22:39 2017] 6 locks held by kworker/u17:2/681: [Sat Nov 18 12:22:39 2017] #0: ((wq_completion)"%s"hdev->name#2){+.+.}, at: [<ffffffffab0d19f4>] process_one_work+0x1d4/0x6c0 [Sat Nov 18 12:22:39 2017] #1: ((work_completion)(&hdev->rx_work)){+.+.}, at: [<ffffffffab0d19f4>] process_one_work+0x1d4/0x6c0 [Sat Nov 18 12:22:39 2017] #2: (&hdev->lock){+.+.}, at: [<ffffffffc05ef734>] hci_le_meta_evt+0x554/0x1590 [bluetooth] [Sat Nov 18 12:22:39 2017] #3: (hci_cb_list_lock){+.+.}, at: [<ffffffffc05efd9d>] hci_le_meta_evt+0xbbd/0x1590 [bluetooth] [Sat Nov 18 12:22:39 2017] #4: (&chan->lock/2){+.+.}, at: [<ffffffffc061459c>] l2cap_connect_cfm+0x25c/0x3e0 [bluetooth] [Sat Nov 18 12:22:39 2017] #5: (sk_lock-AF_BLUETOOTH-BTPROTO_L2CAP){+.+.}, at: [<ffffffffc061aa08>] l2cap_sock_new_connection_cb+0x18/0xa0 [bluetooth] [Sat Nov 18 12:22:39 2017] stack backtrace: [Sat Nov 18 12:22:39 2017] CPU: 0 PID: 681 Comm: kworker/u17:2 Not tainted 4.15.0-0.rc0.git5.1.fc28.x86_64 #1 [Sat Nov 18 12:22:39 2017] Hardware name: LENOVO 80Y7/LNVNB161216, BIOS 5NCN29WW 09/05/2017 [Sat Nov 18 12:22:39 2017] Workqueue: hci0 hci_rx_work [bluetooth] [Sat Nov 18 12:22:39 2017] Call Trace: [Sat Nov 18 12:22:39 2017] dump_stack+0x85/0xbf [Sat Nov 18 12:22:39 2017] __lock_acquire+0x6ba/0x11f0 [Sat Nov 18 12:22:39 2017] lock_acquire+0x9f/0x1f0 [Sat Nov 18 12:22:39 2017] ? bt_accept_enqueue+0x3c/0xb0 [bluetooth] [Sat Nov 18 12:22:39 2017] lock_sock_nested+0x72/0xa0 [Sat Nov 18 12:22:39 2017] ? bt_accept_enqueue+0x3c/0xb0 [bluetooth] [Sat Nov 18 12:22:39 2017] bt_accept_enqueue+0x3c/0xb0 [bluetooth] [Sat Nov 18 12:22:39 2017] l2cap_sock_new_connection_cb+0x5d/0xa0 [bluetooth] [Sat Nov 18 12:22:39 2017] l2cap_connect_cfm+0x269/0x3e0 [bluetooth] [Sat Nov 18 12:22:39 2017] hci_le_meta_evt+0xbe0/0x1590 [bluetooth] [Sat Nov 18 12:22:39 2017] ? __lock_acquire+0x2c2/0x11f0 [Sat Nov 18 12:22:39 2017] hci_event_packet+0x3cf/0x28b0 [bluetooth] [Sat Nov 18 12:22:39 2017] ? hci_rx_work+0x1db/0x5d0 [bluetooth] [Sat Nov 18 12:22:39 2017] hci_rx_work+0x1db/0x5d0 [bluetooth] [Sat Nov 18 12:22:39 2017] process_one_work+0x25e/0x6c0 [Sat Nov 18 12:22:39 2017] worker_thread+0x3a/0x390 [Sat Nov 18 12:22:39 2017] ? process_one_work+0x6c0/0x6c0 [Sat Nov 18 12:22:39 2017] kthread+0x15d/0x180 [Sat Nov 18 12:22:39 2017] ? kthread_create_worker_on_cpu+0x70/0x70 [Sat Nov 18 12:22:39 2017] ret_from_fork+0x24/0x30 [Sat Nov 18 12:22:42 2017] input: Lenovo Active Pen2 as /devices/virtual/misc/uhid/0005:17EF:60A8.0006/input/input23 [Sat Nov 18 12:22:42 2017] hid-generic 0005:17EF:60A8.0006: input,hidraw4: BLUETOOTH HID v0.02 Keyboard [Lenovo Active Pen2] on 64:6E:69:D1:A0:48 [Sat Nov 18 12:22:47 2017] Bluetooth: hci0: last event is not cmd complete (0x0f) [Sat Nov 18 12:23:03 2017] Bluetooth: hci0: last event is not cmd complete (0x0f) [Sat Nov 18 12:23:19 2017] Bluetooth: hci0: last event is not cmd complete (0x0f)
Also, (and possibly related)... the tablet device doesn't connect: [Fri Nov 24 21:47:01 2017] input: Wacom HID 5110 Pen as /devices/pci0000:00/0000:00:15.0/i2c_designware.0/i2c-6/i2c-WCOM5110:00/0018:056A:5110.0003/input/input26 [Fri Nov 24 21:47:01 2017] input: Wacom HID 5110 Finger as /devices/pci0000:00/0000:00:15.0/i2c_designware.0/i2c-6/i2c-WCOM5110:00/0018:056A:5110.0003/input/input27 [Fri Nov 24 21:47:01 2017] wacom 0018:056A:5110.0003: hidraw3: I2C HID v1.00 Mouse [WCOM5110:00 056A:5110] on i2c-WCOM5110:00 [Fri Nov 24 21:47:02 2017] i2c_hid i2c-WCOM5110:00: failed to set a report to device. [Fri Nov 24 21:47:02 2017] wacom 0018:056A:5110.0003: wacom_set_report: ran out of retries (last error = -121) [Fri Nov 24 21:47:02 2017] i2c_hid i2c-WCOM5110:00: failed to set a report to device.
I am also seeing Feb 17 06:35:48 idefix kernel: Bluetooth: hci0: last event is not cmd complete (0x0f) Feb 17 06:36:04 idefix kernel: Bluetooth: hci0: last event is not cmd complete (0x0f) errors when I try to connect to this pen. It appears that the pen has a peculiar bluetooth interface. There is a button on the top of the pen that causes the bluetooth radio in it to turn on, send a message of some sort, and then turn off. I don't know if there is any way to get Linux to respond to this kind of a bluetooth interaction.
The pen's Bluetooth interface does indeed work as described: the radio powers on momentarily after pressing the button, sends a message, and then turns off. As shown in your logs, the Bluetooth device appears to the system as a keyboard. If I recall correctly, the message sent is just a key combo. The key combo should be the same as used by Surface pens. According to Google, that would be Win+F20 when pressed once, and (for those pens that support it) Win+F19 when pressed twice. Of course, it would be good to double-check... It looks like the kernel input device is being created, so you'd want to see if the key combo is being passed along to userspace and X11. The tablet issue (should be) completely unrelated. The Bluetooth and AES hardware may both be in the pen, but they're otherwise seperate devices. There's work being done on that particular bug at https://github.com/linuxwacom/input-wacom/issues/25 (and possibly https://github.com/linuxwacom/input-wacom/issues/28)