New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 904323 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Nov 21
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

Bluetooth: scanning stopped due to controller reset during pause

Project Member Reported by josephsih@chromium.org, Nov 12

Issue description

If a controller happened to power off due to any hardware error during the discovery-suspended period initiated by pause_discovery() in bluez, the system was possible to get locked in discovery_suspended_by_system state. No more device discovery was possible if that happened.


In user_chrome.log, un-pause discovery failed as

[1424:1424:1111/205822.767326:VERBOSE1:device_event_log_impl.cc(161)] [20:58:22.767] Bluetooth: EVENT: bluetooth_device_bluez.cc:522 Successfully paused discovery           
[1424:1424:1111/205824.633723:VERBOSE1:device_event_log_impl.cc(161)] [20:58:24.633] Bluetooth: EVENT: bluetooth_device_bluez.cc:1129 Failed to un-pause discovery

This was caused by controller reset due to some hardware error which could be seen in btsnoop.log as

> HCI Event: Hardware Error (0x10) plen 1   [hci0] 2018-11-11 20:58:24.553422
    Code: 0x08

Checking the system log (/var/log/messages), it showed that unpause_discovery() happened to fall between the period between the time instatnts that the adapter was disabled and enabled.

2018-11-11T20:58:24.629566+08:00 INFO bluetoothd[3169]: adapter /org/bluez/hci0 has been disabled
2018-11-11T20:58:24.629664+08:00 DEBUG bluetoothd[3169]: src/adapter.c:unpause_discovery() sender :1.17
2018-11-11T20:58:24.660943+08:00 INFO bluetoothd[3169]: adapter /org/bluez/hci0 has been enabled

Although start_discovery() and stop_discovery() requests were received after, they were all blocked by the discovery_suspended_by_system state.
2018-11-11T20:58:29.978290+08:00 DEBUG bluetoothd[3169]: src/adapter.c:start_discovery() sender :1.17
2018-11-11T20:58:30.113944+08:00 DEBUG bluetoothd[3169]: src/adapter.c:stop_discovery() sender :1.17

To provide a more fault-tolerant service by bluez to upper layers, it is desirable to unset the discovery_suspended_by_system state during such an exception.
 
The log tarball is larger than 1GB and could be accessed in google drive: https://drive.google.com/open?id=1KTVlA2RZGDmeqbfkud3ZkmwmOC4J7-bj

Project Member

Comment 2 by bugdroid1@chromium.org, Nov 15

Labels: merge-merged-chromeos-5.44
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/bluez/+/118c94169d03b5c9d1ae3d007ee73c78b4f046c6

commit 118c94169d03b5c9d1ae3d007ee73c78b4f046c6
Author: Joseph Hwang <josephsih@chromium.org>
Date: Thu Nov 15 16:11:31 2018

CHROMIUM: reset discovery_suspended_by_system even if controller is off

If a controller happens to power off due to any hardware error during
the discovery-suspended period initiated by pause_discovery() in bluez,
the system is possible to get locked in discovery_suspended_by_system
state. No more device discovery is possible if that happens.

To provide a more fault-tolerant service by bluez to upper layers, it
is desirable to unset the discovery_suspended_by_system state during
such an exception.

BUG= chromium:904323 
TEST=None

Change-Id: I4467d04859bc587debcaf6fc7ebb3b7cf64facf3
Reviewed-on: https://chromium-review.googlesource.com/1331114
Commit-Ready: Shyh-In Hwang <josephsih@chromium.org>
Tested-by: Shyh-In Hwang <josephsih@chromium.org>
Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org>

[modify] https://crrev.com/118c94169d03b5c9d1ae3d007ee73c78b4f046c6/src/adapter.c

Status: Fixed (was: Untriaged)

Sign in to add a comment