Bug 194759

Summary: iwlwifi: 8260: Microsoft Surface Ergonomic Keyboard crashes bluetooth when WiFi is used - WIFILNX-693
Product: Drivers Reporter: Gurenko Alex (agurenko)
Component: BluetoothAssignee: DO NOT USE - assign "network-wireless-intel" component instead (linuxwifi)
Status: CLOSED WILL_NOT_FIX    
Severity: normal CC: agurenko, ahxcker, bugzilla, juliusvonkohout, kanru.kernel, linux-bluetooth, linuxwifi, zmingee
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 4.9.12 Subsystem:
Regression: No Bisected commit-id:
Attachments: dmesg log and iwl-dump
Core24 with BT Coex probes enabled
dmesgs
All dumps

Description Gurenko Alex 2017-03-02 07:16:41 UTC
Created attachment 255043 [details]
dmesg log and iwl-dump

I'm having problem with Microsoft Surface Ergonomic Keyboard which uses BT 4 LE as far as I can tell.

 The problem is that once keyboard is connected and no keys are pressed for a few second, connection hangs and bluetooth becomes unresponsive.
 Turning bluetooth off/on or running "hciconfig hci0 reset" restores bluetooth operations, but if keyboards connects again, cycle repeats.

 If I turn off Wi-Fi, keyboard works fine indefinitely. If I connect keyboard and will type without pauses, it will also works, e.g. the problem occurs when devices goes to LE mode. This also used to work on old firmware (fresh Fedora (as of 1.5 months ago) installation without updates to latest), although now I don't know what version was used in Fedora since they've rebased it recently.

I'm running Fedora 25 on Lenovo T460p.

[agurenko@machine]$ ethtool -i wlp3s0 | grep firmware
firmware-version: 27.469073.0

Please find dmesg and dump attached
Comment 1 Emmanuel Grumbach 2017-03-02 13:43:14 UTC
The data has been sent to the firmware team for analysis.
Comment 2 Gurenko Alex 2017-03-12 07:27:52 UTC
 Any progress on the analysis? Any other data I can provide that will help you guys?
Comment 3 Emmanuel Grumbach 2017-03-28 11:40:44 UTC
Created attachment 255593 [details]
Core24 with BT Coex probes enabled

Hello,

the firmware asked me to send you this new firmware for reproduction. It has new debug probes that will help to better understand the issue.

Please send a new dump with this firmware.

Thank you.
Comment 4 Gurenko Alex 2017-04-01 11:56:41 UTC
(In reply to Emmanuel Grumbach from comment #3)
> Created attachment 255593 [details]
> Core24 with BT Coex probes enabled
> 
> Hello,
> 
> the firmware asked me to send you this new firmware for reproduction. It has
> new debug probes that will help to better understand the issue.
> 
> Please send a new dump with this firmware.
> 
> Thank you.

For some reasons can't load this firmware and even more it only loads 22 now, here is what I get in dmesg:

Apr 01 14:47:36 Wasp-T460p.tlv kernel: iwlwifi 0000:03:00.0: enabling device (0000 -> 0002)
Apr 01 14:47:36 Wasp-T460p.tlv kernel: iwlwifi 0000:03:00.0: Direct firmware load for iwlwifi-8000C-26.ucode failed with error -2
Apr 01 14:47:36 Wasp-T460p.tlv kernel: iwlwifi 0000:03:00.0: Direct firmware load for iwlwifi-8000C-25.ucode failed with error -2
Apr 01 14:47:36 Wasp-T460p.tlv kernel: iwlwifi 0000:03:00.0: Direct firmware load for iwlwifi-8000C-24.ucode failed with error -2
Apr 01 14:47:36 Wasp-T460p.tlv kernel: iwlwifi 0000:03:00.0: Direct firmware load for iwlwifi-8000C-23.ucode failed with error -2
Apr 01 14:47:36 Wasp-T460p.tlv kernel: iwlwifi 0000:03:00.0: loaded firmware version 22.361476.0 op_mode iwlmvm
Apr 01 14:47:36 Wasp-T460p.tlv kernel: iwlwifi 0000:03:00.0: Detected Intel(R) Dual Band Wireless AC 8260, REV=0x208

[agurenko@Wasp-T460p firmware]$ ethtool -i wlp3s0 | grep firmware
firmware-version: 22.361476.0

Anything I'm missing? Probably worth mentioning that since our last actions Fedora kernel was upgraded from 4.9.x to 4.10.6 (currently)
Comment 5 Gurenko Alex 2017-04-01 12:01:52 UTC
(In reply to Emmanuel Grumbach from comment #3)
> Created attachment 255593 [details]
> Core24 with BT Coex probes enabled
> 
> Hello,
> 
> the firmware asked me to send you this new firmware for reproduction. It has
> new debug probes that will help to better understand the issue.
> 
> Please send a new dump with this firmware.
> 
> Thank you.

Found it in a previous thread that you asked to use a backport driver in that case, but I would assume it won't have debug probes?!
Comment 6 Emmanuel Grumbach 2017-04-01 18:20:17 UTC
Backport is unrelated to debug probes. You can use backport with the firmware attached.
Comment 7 Gurenko Alex 2017-04-01 19:25:57 UTC
Created attachment 255695 [details]
dmesgs

(In reply to Emmanuel Grumbach from comment #6)
> Backport is unrelated to debug probes. You can use backport with the
> firmware attached.

Hm, I've installed it the same way I did last time, now upon pairing it worked as it used to: once I've stopped typing it died, but no log creation were triggered, nor I saw anything in dmesg.

 I've plugged batteries from the keyboard and cycled BT and now it works...
 
 Did a few reboots and also had an idea that previously I didn't have tlp installed and now I do have it, so I've removed it and rebooted again, same results, it works... Anything I can grab to help you figure it out?

[agurenko@Wasp-T460p ~]$ ethtool -i wlp3s0 | grep firmware
firmware-version: 27.455470.0
Comment 8 Emmanuel Grumbach 2017-04-01 20:25:43 UTC
(In reply to Gurenko Alex from comment #7)
> Created attachment 255695 [details]
> dmesgs
> 
> (In reply to Emmanuel Grumbach from comment #6)
> > Backport is unrelated to debug probes. You can use backport with the
> > firmware attached.
> 
> Hm, I've installed it the same way I did last time, now upon pairing it
> worked as it used to: once I've stopped typing it died, but no log creation
> were triggered, nor I saw anything in dmesg.

you need to create the dump manually with the:
echo 1 > /sys/kernel/debug/iwlwifi/0000\:0X\:00.0/iwlmvm/fw_dbg_collect
debugfs hook. Remember to replace X by the right number on your system.

> 
>  I've plugged batteries from the keyboard and cycled BT and now it works...
>  
>  Did a few reboots and also had an idea that previously I didn't have tlp
> installed and now I do have it, so I've removed it and rebooted again, same
> results, it works... Anything I can grab to help you figure it out?
> 
> [agurenko@Wasp-T460p ~]$ ethtool -i wlp3s0 | grep firmware
> firmware-version: 27.455470.0

This is the firmware included in linux-firmware.git, not the one I attached to this bug. Are you saying that 455470 works, but not 469073 ?
Comment 9 Gurenko Alex 2017-04-02 07:03:29 UTC
Created attachment 255701 [details]
All dumps

(In reply to Emmanuel Grumbach from comment #8)
> (In reply to Gurenko Alex from comment #7)
> > Created attachment 255695 [details]
> > dmesgs
> > 
> > (In reply to Emmanuel Grumbach from comment #6)
> > > Backport is unrelated to debug probes. You can use backport with the
> > > firmware attached.
> > 
> > Hm, I've installed it the same way I did last time, now upon pairing it
> > worked as it used to: once I've stopped typing it died, but no log creation
> > were triggered, nor I saw anything in dmesg.
> 
> you need to create the dump manually with the:
> echo 1 > /sys/kernel/debug/iwlwifi/0000\:0X\:00.0/iwlmvm/fw_dbg_collect
> debugfs hook. Remember to replace X by the right number on your system.

 That's what I did, but I don't remember where dump should be located, the udev rule from the instruction you've provided does not work for some reason.
 
> > 
> >  I've plugged batteries from the keyboard and cycled BT and now it works...
> >  
> >  Did a few reboots and also had an idea that previously I didn't have tlp
> > installed and now I do have it, so I've removed it and rebooted again, same
> > results, it works... Anything I can grab to help you figure it out?
> > 
> > [agurenko@Wasp-T460p ~]$ ethtool -i wlp3s0 | grep firmware
> > firmware-version: 27.455470.0
> 
> This is the firmware included in linux-firmware.git, not the one I attached
> to this bug. Are you saying that 455470 works, but not 469073 ?

 That's good point, it overwrote 469073, but I've replaced it again and it still works, at least I'm typing with my keyboard right now. Maybe because it was paired successfully?

 I've attached all the dumps collected, I'm not sure whether it will help, so please let me know.
Comment 10 Emmanuel Grumbach 2017-04-02 14:37:58 UTC
Dumps with 455470 won't help. Dumps when things are working won't help either.
Comment 11 Emmanuel Grumbach 2017-04-18 12:06:13 UTC
I understand that we are not able to make progress here. Closing the bug. You can always re-open if you think we can make progress.
Comment 12 Gurenko Alex 2017-04-18 12:27:15 UTC
(In reply to Emmanuel Grumbach from comment #11)
> I understand that we are not able to make progress here. Closing the bug.
> You can always re-open if you think we can make progress.

Yes, I'm afraid I cannot reproduce the problem anymore. I will open again, should the problem come back. Thank you for your help anyway!
Comment 13 Zane Mingee 2020-01-23 16:33:04 UTC
I'm experiencing this issue as well, affecting my Microsoft Surface Ergonomic Keyboard. I've tried just about everything I've found on the web for a potential fix, and nothing has worked.

The keyboard will randomly disconnect, then reconnect with the following logs:

Jan 23 11:22:38 gaius bluetoothd[331815]: bt_uhid_send: Invalid argument (22)
Jan 23 11:22:38 gaius bluetoothd[331815]: bt_uhid_send: Invalid argument (22)
Jan 23 11:22:59 gaius bluetoothd[331815]: bt_uhid_send: Invalid argument (22)
Jan 23 11:22:59 gaius bluetoothd[331815]: bt_uhid_send: Invalid argument (22)
Jan 23 11:22:59 gaius bluetoothd[331815]: bt_uhid_send: Invalid argument (22)
Jan 23 11:22:59 gaius bluetoothd[331815]: bt_uhid_send: Invalid argument (22)
Jan 23 11:24:16 gaius bluetoothd[331815]: bt_uhid_send: Invalid argument (22)
Jan 23 11:24:16 gaius bluetoothd[331815]: bt_uhid_send: Invalid argument (22)
Jan 23 11:24:16 gaius bluetoothd[331815]: bt_uhid_send: Invalid argument (22)
Jan 23 11:24:16 gaius bluetoothd[331815]: bt_uhid_send: Invalid argument (22)
Jan 23 11:26:36 gaius bluetoothd[331815]: bt_uhid_send: Invalid argument (22)
Jan 23 11:26:36 gaius bluetoothd[331815]: bt_uhid_send: Invalid argument (22)
Jan 23 11:26:36 gaius bluetoothd[331815]: bt_uhid_send: Invalid argument (22)
Jan 23 11:27:51 gaius bluetoothd[331815]: bt_uhid_send: Invalid argument (22)
Jan 23 11:27:51 gaius bluetoothd[331815]: bt_uhid_send: Invalid argument (22)
Jan 23 11:28:39 gaius bluetoothd[331815]: bt_uhid_send: Invalid argument (22)
Jan 23 11:28:39 gaius bluetoothd[331815]: bt_uhid_send: Invalid argument (22)
Jan 23 11:28:39 gaius bluetoothd[331815]: bt_uhid_send: Invalid argument (22)
Jan 23 11:28:39 gaius bluetoothd[331815]: bt_uhid_send: Invalid argument (22)
Jan 23 11:28:39 gaius bluetoothd[331815]: bt_uhid_send: Invalid argument (22)


[gaius:~]$ ethtool -i wifi0 | grep firmware
firmware-version: 29.163394017.0

Linux gaius 5.4.11-arch1-1 #1 SMP PREEMPT Sun, 12 Jan 2020 12:15:27 +0000 x86_64 GNU/Linux