Bug 93911 - toshiba_bluetooth reenables every 5 secs even though bluetooth is set to off
Summary: toshiba_bluetooth reenables every 5 secs even though bluetooth is set to off
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Platform (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: linux-bluetooth@vger.kernel.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-26 15:49 UTC by juukemb
Modified: 2016-05-18 06:46 UTC (History)
3 users (show)

See Also:
Kernel Version: 3.18.6
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description juukemb 2015-02-26 15:49:16 UTC
Once switched off, bluetooth on Toshiba laptops repeatedly switches on and off. My /var/log/syslog is filled with:

[   72.533314] usb 2-8: USB disconnect, device number 23
[   72.580890] toshiba_bluetooth: Re-enabling Toshiba Bluetooth
[   72.904018] usb 2-8: new full-speed USB device number 24 using xhci_hcd
[   73.092397] Bluetooth: hci0: read Intel version: 370710010002030d00
[   73.092427] Bluetooth: hci0: Intel Bluetooth firmware file: intel/ibt-hw-37.7.10-fw-1.0.2.3.d.bseq
[   73.248481] Bluetooth: hci0: Intel Bluetooth firmware patch completed and activated
[   77.550516] usb 2-8: USB disconnect, device number 24
[   77.597338] toshiba_bluetooth: Re-enabling Toshiba Bluetooth
[   77.920538] usb 2-8: new full-speed USB device number 25 using xhci_hcd
[   78.112257] Bluetooth: hci0: read Intel version: 370710010002030d00
[   78.112289] Bluetooth: hci0: Intel Bluetooth firmware file: intel/ibt-hw-37.7.10-fw-1.0.2.3.d.bseq
[   78.253567] Bluetooth: hci0: Intel Bluetooth firmware patch completed and activated
...

and it keeps growing by the minute.

I'm using Arch Linux kernel 3.18.6-1 with Xfce on a Portege Z30-A (i7-4510U) at the moment, but I've been experiencing this issue on my Toshiba notebooks for months now, regardless of the Desktop Environment, kernel version or Linux distribution.

Here's one of the other reports I've seen on the net: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/750428 (there's something similar at Redhat: https://bugzilla.redhat.com/show_bug.cgi?id=1165108)
Comment 1 Andrea Momesso 2015-02-26 17:35:27 UTC
I can confirm the same problem on a Portege Z10t.

As a workaround you have to blacklist the toshiba_acpi module, which is causing the issue. At least on my hardware the toshiba_acpi module was anyway quite useless.
Comment 2 Azael Avalos 2015-02-26 23:45:56 UTC
Hi there,

Please download the files in the pastebin links provided and simply do (under the extracted folder):

make
sudo make install
sudo make load

Once done, repeat the steps to trigger the endless enable/disable of bluetooth, the toshiba_bluetooth.c provided is a modified one with more verbose output, that way we may be able to corner, or at least see where it is failing.

http://pastebin.com/7rE64SXs
http://pastebin.com/15yUSc9u


Cheers
Azael
Comment 3 juukemb 2015-02-27 15:53:02 UTC
Installing the modified module seems to have stopped log spamming.

I've checked again after rebooting and the result was consistent. Then reenabled bluetooth, it was working fine. Then disabled it again, these are the only lines related to bluetooth in my log file:

[   40.090746] usb 2-8: new full-speed USB device number 9 using xhci_hcd
[   40.279448] usbcore: registered new interface driver btusb
[   40.293226] Bluetooth: hci0: read Intel version: 370710010002030d00
[   40.293635] Bluetooth: hci0: Intel Bluetooth firmware file: intel/ibt-hw-37.7.10-fw-1.0.2.3.d.bseq
[   40.469351] Bluetooth: hci0: Intel Bluetooth firmware patch completed and activated
[   75.402146] toshiba_bluetooth: Received event 90
[   75.454085] toshiba_bluetooth: Bluetooth status 65
[   75.454090] toshiba_bluetooth: RFKill switch status 0
[   75.457889] usb 2-8: USB disconnect, device number 9
[  211.284239] toshiba_acpi: Unknown key 14b

The last line (unknown key) appeared later though.
Comment 4 Azael Avalos 2015-02-27 16:55:13 UTC
(In reply to juukemb from comment #3)

Good to know that it worked for you, the BT device receives two events (0x80 and 0x90) and we need to act accordingly with the RFKill switch and BT status.

Please point to this bug report downstream (on your distro bug report) so we can have more people test these changes, and whenever we have something solid, I can push the changes and hopefully this will land in 4.1.

Oh, and by the way, this is a platform issue, if you can, change the assignment to platform instead of bluetooth :-)


Cheers
Azael
Comment 5 juukemb 2015-02-27 18:12:41 UTC
@Azael: just changed the assignment to platform, and reported the bug downstream at https://bugs.archlinux.org/task/43977

Thank you for your help.
Comment 6 HLJonker 2015-03-11 11:19:40 UTC
I had this same problem and tested this (not as thoroughly as juukemb though).

Successes:
I can confirm the logfile is no longer spammed with disabling/re-enabling messages.
I can reconnect to my phone.
I can unpair and re-pair phone-laptop (from phone).
I can send a file from laptop to phone.
Visibility seems to work (unpair, turn off Bluetooth on phone, turn off visibility, turn on Bluetooth on phone, scan: no devices found. Turn on visibility: laptop found)

Failures:
I cannot send a file from phone to laptop.
  My phone reports "Failure reason: connection failed".
  I've never tried to do that before, so likely it's not this patch.
Comment 7 Azael Avalos 2015-03-11 15:13:17 UTC
(In reply to HLJonker from comment #6)
> I had this same problem and tested this (not as thoroughly as juukemb
> though).
> 
> Successes:
> I can confirm the logfile is no longer spammed with disabling/re-enabling
> messages.
> I can reconnect to my phone.
> I can unpair and re-pair phone-laptop (from phone).
> I can send a file from laptop to phone.
> Visibility seems to work (unpair, turn off Bluetooth on phone, turn off
> visibility, turn on Bluetooth on phone, scan: no devices found. Turn on
> visibility: laptop found)

Good to know, I'll start working on the patches to send to mainline.

> 
> Failures:
> I cannot send a file from phone to laptop.
>   My phone reports "Failure reason: connection failed".
>   I've never tried to do that before, so likely it's not this patch.

Right, toshiba_bluetooth only takes care of exposing (and enabling/disabling) the bluetooth device to the system, all the bluetooth functionality is done via the bluetooth stack bluez and the DE.


Cheers
Azael
Comment 8 Azael Avalos 2015-05-26 20:17:44 UTC
Hi there,

Please check if commit 5d3fc1d54e5a020c087002dd8590ee21c17e3182
or commit d85b11b1a4bee3146540111ef15b5ca1eeb71645 fixes this bug for you guys, so we can close this bug :-)


Cheers
Azael
Comment 9 HLJonker 2015-05-27 14:42:33 UTC
I'd love to check!
I'm sorry to say that I am more than a little green behind the ears when it comes to kernel hacking though: no clue where to find the commits, no clue how to test them.

I'm guessing I'd somehow need to 1) acquire a kernel built with these commits, and then 2) install the kernel; 3) reboot into the modified kernel and 4) check if the problem has gone away (and if bluetooth other than that works).

Could you give some pointers on how to do 1 / 2? I'm guessing that if I can get it installed as "TEST-KERNEL" and run an update-grub, I can find it on booting.
Comment 10 Azael Avalos 2015-05-27 15:08:12 UTC
(In reply to HLJonker from comment #9)
> I'd love to check!
> I'm sorry to say that I am more than a little green behind the ears when it
> comes to kernel hacking though: no clue where to find the commits, no clue
> how to test them.

NP, just follow the links I provided below :-)

commit 5d3fc1d54e5a020c087002dd8590ee21c17e3182:

https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/plain/drivers/platform/x86/toshiba_bluetooth.c?id=5d3fc1d54e5a020c087002dd8590ee21c17e3182

commit d85b11b1a4bee3146540111ef15b5ca1eeb71645:

https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/plain/drivers/platform/x86/toshiba_bluetooth.c?id=d85b11b1a4bee3146540111ef15b5ca1eeb71645

 
> I'm guessing I'd somehow need to 1) acquire a kernel built with these
> commits, and then 2) install the kernel; 3) reboot into the modified kernel
> and 4) check if the problem has gone away (and if bluetooth other than that
> works).
> 
> Could you give some pointers on how to do 1 / 2? I'm guessing that if I can
> get it installed as "TEST-KERNEL" and run an update-grub, I can find it on
> booting.

There's no need to recompile the whole kernel, just use the Makefile I provided earlier (comment #2), and replace the file with the ones from the links, each at a time of course.

Basically:
- Download the Makefile (comment #2) if not already downloaded
- Download the file from 1st link
- make clean
- make
- sudo make install
- sudo make load
- test ;-)
- Repeat for 2nd link


Cheers
Azael
Comment 11 juukemb 2015-05-31 14:02:09 UTC
Seems to work here! thanks
Comment 12 Azael Avalos 2015-06-01 16:04:06 UTC
(In reply to juukemb from comment #11)
> Seems to work here! thanks

Alright, then this can be closed now :-)

Either assign this bug to me so I can close it or close it yourself.


Cheers
Azael

Note You need to log in before you can comment on or make changes to this bug.