Bluetooth adapter reset when discovering & connecting at the same time

Open
#3,330 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
c, linux

Research direction

The report points to Linux Bluetooth HCI handling and the le_conn_complete_evt path, especially HCI_OP_LE_READ_REMOTE_FEATURES; begin by tracing that command's timeout alongside the discovery and connection schedule, using the supplied bt_logs.zip. Done means identifying and fixing the cause so concurrent discovery and connection no longer produce the hardware error or reset the adapter.

Written by the indexing model from the issue text.

Description

When performing bluetooth device discovery & connecting to a device at the same time, the bluetooth adapter oftentimes reports an HCI event "Hardware Error", which then results in the kernel resetting the adapter (power off/on)

From my tests, I am periodically performing discovery for 15s every 30s. I then attempt to connect to each device and perform service discovery. Eventually, one of these connection attempts will trigger the "Hardware Error". These always occur after the same HCI command HCI_OP_LE_READ_REMOTE_FEATURES (sent in le_conn_complete_evt) times out:

Nov 12 10:36:10 scott-pi4 kernel: Bluetooth: hci1: command 0x2016 tx timeout
Nov 12 10:36:11 scott-pi4 kernel: Bluetooth: hci1: hardware error 0x03
Nov 12 10:40:26 scott-pi4 kernel: Bluetooth: hci1: command 0x2016 tx timeout
Nov 12 10:40:28 scott-pi4 kernel: Bluetooth: hci1: command 0x200c tx timeout
Nov 12 10:40:28 scott-pi4 kernel: Bluetooth: hci1: hardware error 0x03
Nov 12 10:42:40 scott-pi4 kernel: Bluetooth: hci1: command 0x2016 tx timeout
Nov 12 10:42:41 scott-pi4 kernel: Bluetooth: hci1: hardware error 0x03
Nov 12 10:42:51 scott-pi4 kernel: Bluetooth: hci1: command 0x2016 tx timeout
Nov 12 10:42:52 scott-pi4 kernel: Bluetooth: hci1: hardware error 0x03

Raspberry Pi 4 Model B Rev 1.1

pi@scott-pi4:~ $ cat /etc/rpi-issue
Raspberry Pi reference 2019-10-11
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 4a37f04e974e1806551dda69afe0c3306360342d, stage2

pi@scott-pi4:~ $ vcgencmd version
Sep 24 2019 17:34:30
Copyright (c) 2012 Broadcom
version cd3add54955f8fa065b414d8fc07c525e7ddffc8 (clean) (release) (start)

pi@scott-pi4:~ $ uname -a
Linux scott-pi4 4.19.83-v7l+ #2 SMP Mon Nov 11 11:54:39 PST 2019 armv7l GNU/Linux
kernel rev: 3c235dcfe

I have attempted to use the latest firmware (7.45.189) for the 43455 from cypress, but no change.

bt_logs.zip

Dominant language
C
Stars
13.2k
Forks
5.5k
Avg merge
2d 21h
Merged PRs (30d)
21

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from raspberrypi/linux

All issues in raspberrypi/linux

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.