Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluetooth Adaptor not found Atheros AR3011 #37

Open
dmbreton opened this issue Jan 22, 2016 · 3 comments
Open

Bluetooth Adaptor not found Atheros AR3011 #37

dmbreton opened this issue Jan 22, 2016 · 3 comments
Assignees

Comments

@dmbreton
Copy link

I did a fresh install of steam os and the bluetooth adapter is not found.

I did some research I and it looks like similar issues were found by other users, but after reviewing the code it looks like this should be patched.
https://bbs.archlinux.org/viewtopic.php?id=126487

Any help would be appreciated.

uname -a

desktop@steamos:~$ uname -a
Linux steamos 4.1.0-0.steamos.3-amd64 #1 SMP Debian 4.1.6-2+steamos3 (2015-10-22) x86_64 GNU/Linux

lsusb

desktop@steamos:~$ lsusb
Bus 009 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 008 Device 002: ID 28de:1142
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 003: ID 0cf3:9271 Atheros Communications, Inc. AR9271 802.11n
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 003: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 007 Device 004: ID 0cf3:3002 Atheros Communications, Inc. AR3011 Bluetooth
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

dmesg | grep ath

desktop@steamos:~$ dmesg | grep ath
[    2.073278] usb 7-3: firmware: direct-loading firmware ath3k-1.fw
[    2.099890] usb 1-4: ath9k_htc: Firmware htc_9271.fw requested
[    2.100147] usbcore: registered new interface driver ath9k_htc
[    2.384093] usb 1-4: ath9k_htc: Transferred FW: htc_9271.fw, size: 50980
[    2.438854] usbcore: registered new interface driver ath3k
[    2.623930] ath9k_htc 1-4:1.0: ath9k_htc: HTC initialized with 33 credits
[    3.850998] ath9k_htc 1-4:1.0: ath9k_htc: FW Version: 1.3
[    3.851004] ath9k_htc 1-4:1.0: FW RMW support: Off
[    3.851008] ath: EEPROM regdomain: 0x60
[    3.851011] ath: EEPROM indicates we should expect a direct regpair map
[    3.851015] ath: Country alpha2 being used: 00
[    3.851016] ath: Regpair used: 0x60
[    4.078937] usb 7-3: firmware: direct-loading firmware ath3k-1.fw
[    9.073645] ath3k: probe of 7-3:1.0 failed with error -110

lsmod

desktop@steamos:~$ lsmod
Module                  Size  Used by
btusb                  45056  0
btbcm                  16384  1 btusb
btintel                16384  1 btusb
ctr                    16384  2
ccm                    20480  2
arc4                   16384  2
bnep                   20480  2
snd_hda_codec_hdmi     53248  1
joydev                 20480  0
hid_logitech_hidpp     20480  0
nls_utf8               16384  1
nls_cp437              20480  1
vfat                   20480  1
fat                    65536  1 vfat
ath9k_htc              61440  0
ath9k_common           28672  1 ath9k_htc
ath9k_hw              425984  2 ath9k_common,ath9k_htc
ath                    28672  3 ath9k_common,ath9k_htc,ath9k_hw
mac80211              569344  1 ath9k_htc
hid_logitech_dj        20480  0
cfg80211              458752  4 ath,ath9k_common,mac80211,ath9k_htc
ath3k                  20480  0
bluetooth             442368  9 bnep,ath3k,btbcm,btusb,btintel
kvm_amd                61440  0
rfkill                 20480  5 cfg80211,bluetooth
kvm                   425984  1 kvm_amd
crct10dif_pclmul       16384  0
crc32_pclmul           16384  0
snd_hda_codec_realtek    73728  1
snd_hda_codec_generic    65536  1 snd_hda_codec_realtek
ghash_clmulni_intel    16384  0
snd_hda_intel          28672  5
aesni_intel           172032  4
efi_pstore             16384  1
snd_hda_controller     28672  1 snd_hda_intel
aes_x86_64             20480  1 aesni_intel
lrw                    16384  1 aesni_intel
snd_hda_codec          94208  5 snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_intel,snd_hda_controller
gf128mul               16384  1 lrw
snd_hda_core           24576  5 snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_codec,snd_hda_controller
glue_helper            16384  1 aesni_intel
ablk_helper            16384  1 aesni_intel
snd_hwdep              16384  1 snd_hda_codec
cryptd                 20480  3 ghash_clmulni_intel,aesni_intel,ablk_helper
psmouse               114688  0
snd_pcm                90112  4 snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel,snd_hda_controller
pcspkr                 16384  0
snd_timer              28672  1 snd_pcm
serio_raw              16384  0
efivars                20480  1 efi_pstore
k10temp                16384  0
i2c_piix4              24576  0
snd                    69632  18 snd_hda_codec_realtek,snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_pcm,snd_hda_codec_generic,snd_hda_codec,snd_hda_intel
soundcore              16384  1 snd
8250_fintek            16384  0
tpm_infineon           20480  0
tpm_tis                20480  0
shpchp                 32768  0
acpi_cpufreq           20480  0
tpm                    32768  2 tpm_tis,tpm_infineon
processor              28672  5 acpi_cpufreq
evdev                  24576  16
thermal_sys            36864  1 processor
nvidia               8593408  100
drm                   278528  4 nvidia
fuse                   90112  3
autofs4                36864  2
hid_generic            16384  0
usbhid                 49152  0
hid                   110592  4 hid_generic,usbhid,hid_logitech_dj,hid_logitech_hidpp
ext4                  499712  3
crc16                  16384  2 ext4,bluetooth
mbcache                20480  1 ext4
jbd2                   90112  1 ext4
sg                     32768  0
sd_mod                 40960  6
ohci_pci               16384  0
mxm_wmi                16384  0
ahci                   36864  5
libahci                28672  1 ahci
crc32c_intel           24576  0
libata                200704  2 ahci,libahci
scsi_mod              200704  3 sg,libata,sd_mod
xhci_pci               16384  0
ohci_hcd               45056  1 ohci_pci
ehci_pci               16384  0
xhci_hcd              155648  1 xhci_pci
ehci_hcd               77824  1 ehci_pci
usbcore               200704  14 ath3k,btusb,ohci_hcd,ohci_pci,ehci_hcd,ehci_pci,usbhid,ath9k_htc,xhci_hcd,xhci_pci
r8169                  77824  0
mii                    16384  1 r8169
usb_common             16384  1 usbcore
wmi                    20480  1 mxm_wmi
button                 16384  0

@Plagman Plagman self-assigned this Jan 23, 2016
@Plagman
Copy link
Member

Plagman commented Jan 25, 2016

If you're able to confirm that the single-line patch fixes the issue with our kernel, we'd gladly merge a pull request.

@dmbreton
Copy link
Author

I did a quick code review and it looked like the patch is already included.

from the other thread

diff -uprN a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
--- a/drivers/bluetooth/ath3k.c 2013-01-23 20:45:24.946984407 -0600
+++ b/drivers/bluetooth/ath3k.c 2013-01-23 20:45:51.443693307 -0600
@@ -68,6 +68,7 @@ static struct usb_device_id ath3k_table[
        { USB_DEVICE(0x0930, 0x0215) },
        { USB_DEVICE(0x0489, 0xE03D) },
        { USB_DEVICE(0x0489, 0xE027) },
+        { USB_DEVICE(0x04f2, 0xaff1) },

        /* Atheros AR9285 Malbec with sflash firmware */
        { USB_DEVICE(0x03F0, 0x311D) },
diff -uprN a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
--- a/drivers/bluetooth/btusb.c 2013-01-23 20:45:24.946984407 -0600
+++ b/drivers/bluetooth/btusb.c 2013-01-23 20:45:51.443693307 -0600
@@ -125,6 +125,7 @@ static struct usb_device_id blacklist_ta
        { USB_DEVICE(0x0930, 0x0215), .driver_info = BTUSB_IGNORE },
        { USB_DEVICE(0x0489, 0xe03d), .driver_info = BTUSB_IGNORE },
        { USB_DEVICE(0x0489, 0xe027), .driver_info = BTUSB_IGNORE },
+        { USB_DEVICE(0x04f2, 0xaff1), .driver_info = BTUSB_IGNORE },

        /* Atheros AR9285 Malbec with sflash firmware */
        { USB_DEVICE(0x03f0, 0x311d), .driver_info = BTUSB_IGNORE },

What should I try next to troubleshoot?

Plagman pushed a commit that referenced this issue Aug 15, 2016
[ Upstream commit 3b65428 ]

Even though hid_hw_* checks that passed in data_len is less than
HID_MAX_BUFFER_SIZE it is not enough, as i2c-hid does not necessarily
allocate buffers of HID_MAX_BUFFER_SIZE but rather checks all device
reports and select largest size. In-kernel users normally just send as much
data as report needs, so there is no problem, but hidraw users can do
whatever they please:

BUG: KASAN: slab-out-of-bounds in memcpy+0x34/0x54 at addr ffffffc07135ea80
Write of size 4101 by task syz-executor/8747
CPU: 2 PID: 8747 Comm: syz-executor Tainted: G    BU         3.18.0 #37
Hardware name: Google Tegra210 Smaug Rev 1,3+ (DT)
Call trace:
[<ffffffc00020ebcc>] dump_backtrace+0x0/0x258 arch/arm64/kernel/traps.c:83
[<ffffffc00020ee40>] show_stack+0x1c/0x2c arch/arm64/kernel/traps.c:172
[<     inline     >] __dump_stack lib/dump_stack.c:15
[<ffffffc001958114>] dump_stack+0x90/0x140 lib/dump_stack.c:50
[<     inline     >] print_error_description mm/kasan/report.c:97
[<     inline     >] kasan_report_error mm/kasan/report.c:278
[<ffffffc0004597dc>] kasan_report+0x268/0x530 mm/kasan/report.c:305
[<ffffffc0004592e8>] __asan_storeN+0x20/0x150 mm/kasan/kasan.c:718
[<ffffffc0004594e0>] memcpy+0x30/0x54 mm/kasan/kasan.c:299
[<ffffffc001306354>] __i2c_hid_command+0x2b0/0x7b4 drivers/hid/i2c-hid/i2c-hid.c:178
[<     inline     >] i2c_hid_set_or_send_report drivers/hid/i2c-hid/i2c-hid.c:321
[<ffffffc0013079a0>] i2c_hid_output_raw_report.isra.2+0x3d4/0x4b8 drivers/hid/i2c-hid/i2c-hid.c:589
[<ffffffc001307ad8>] i2c_hid_output_report+0x54/0x68 drivers/hid/i2c-hid/i2c-hid.c:602
[<     inline     >] hid_hw_output_report include/linux/hid.h:1039
[<ffffffc0012cc7a0>] hidraw_send_report+0x400/0x414 drivers/hid/hidraw.c:154
[<ffffffc0012cc7f4>] hidraw_write+0x40/0x64 drivers/hid/hidraw.c:177
[<ffffffc0004681dc>] vfs_write+0x1d4/0x3cc fs/read_write.c:534
[<     inline     >] SYSC_pwrite64 fs/read_write.c:627
[<ffffffc000468984>] SyS_pwrite64+0xec/0x144 fs/read_write.c:614
Object at ffffffc07135ea80, in cache kmalloc-512
Object allocated with size 268 bytes.

Let's check data length against the buffer size before attempting to copy
data over.

Cc: stable@vger.kernel.org
Reported-by: Alexander Potapenko <glider@google.com>
Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Plagman pushed a commit that referenced this issue Aug 15, 2016
[ Upstream commit d246dcb ]

[   40.467381] =============================================
[   40.473013] [ INFO: possible recursive locking detected ]
[   40.478651] 4.6.0-08691-g7f3db9a #37 Not tainted
[   40.483466] ---------------------------------------------
[   40.489098] usb/733 is trying to acquire lock:
[   40.493734]  (&(&dev->lock)->rlock){-.....}, at: [<bf129288>] ep0_complete+0x18/0xdc [gadgetfs]
[   40.502882]
[   40.502882] but task is already holding lock:
[   40.508967]  (&(&dev->lock)->rlock){-.....}, at: [<bf12a420>] ep0_read+0x20/0x5e0 [gadgetfs]
[   40.517811]
[   40.517811] other info that might help us debug this:
[   40.524623]  Possible unsafe locking scenario:
[   40.524623]
[   40.530798]        CPU0
[   40.533346]        ----
[   40.535894]   lock(&(&dev->lock)->rlock);
[   40.540088]   lock(&(&dev->lock)->rlock);
[   40.544284]
[   40.544284]  *** DEADLOCK ***
[   40.544284]
[   40.550461]  May be due to missing lock nesting notation
[   40.550461]
[   40.557544] 2 locks held by usb/733:
[   40.561271]  #0:  (&f->f_pos_lock){+.+.+.}, at: [<c02a6114>] __fdget_pos+0x40/0x48
[   40.569219]  #1:  (&(&dev->lock)->rlock){-.....}, at: [<bf12a420>] ep0_read+0x20/0x5e0 [gadgetfs]
[   40.578523]
[   40.578523] stack backtrace:
[   40.583075] CPU: 0 PID: 733 Comm: usb Not tainted 4.6.0-08691-g7f3db9a #37
[   40.590246] Hardware name: Generic AM33XX (Flattened Device Tree)
[   40.596625] [<c010ffbc>] (unwind_backtrace) from [<c010c1bc>] (show_stack+0x10/0x14)
[   40.604718] [<c010c1bc>] (show_stack) from [<c04207fc>] (dump_stack+0xb0/0xe4)
[   40.612267] [<c04207fc>] (dump_stack) from [<c01886ec>] (__lock_acquire+0xf68/0x1994)
[   40.620440] [<c01886ec>] (__lock_acquire) from [<c0189528>] (lock_acquire+0xd8/0x238)
[   40.628621] [<c0189528>] (lock_acquire) from [<c06ad6b4>] (_raw_spin_lock_irqsave+0x38/0x4c)
[   40.637440] [<c06ad6b4>] (_raw_spin_lock_irqsave) from [<bf129288>] (ep0_complete+0x18/0xdc [gadgetfs])
[   40.647339] [<bf129288>] (ep0_complete [gadgetfs]) from [<bf10a728>] (musb_g_giveback+0x118/0x1b0 [musb_hdrc])
[   40.657842] [<bf10a728>] (musb_g_giveback [musb_hdrc]) from [<bf108768>] (musb_g_ep0_queue+0x16c/0x188 [musb_hdrc])
[   40.668772] [<bf108768>] (musb_g_ep0_queue [musb_hdrc]) from [<bf12a944>] (ep0_read+0x544/0x5e0 [gadgetfs])
[   40.678963] [<bf12a944>] (ep0_read [gadgetfs]) from [<c0284470>] (__vfs_read+0x20/0x110)
[   40.687414] [<c0284470>] (__vfs_read) from [<c0285324>] (vfs_read+0x88/0x114)
[   40.694864] [<c0285324>] (vfs_read) from [<c0286150>] (SyS_read+0x44/0x9c)
[   40.702051] [<c0286150>] (SyS_read) from [<c0107820>] (ret_fast_syscall+0x0/0x1c)

This is caused by the spinlock bug in ep0_read().
Fix the two other deadlock sources in gadgetfs_setup() too.

Cc: <stable@vger.kernel.org> # v3.16+
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
@sayak-brm
Copy link

Isn't this a sub-issue of #52.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants