Other Parts Discussed in Thread: WL1837
Hi,
I am having a custom board with imx6 SoC. Running Android 8.0. For bluetooth HAL using the linaro hikey HAL.
Facing an issue that sometimes the "Bluetooth stopped" message popup comes. On analysing the bluetooth stack logs it seen that command_timed_out expiry is hitting as a response is not received for the android bluetooth stack for 2 seconds for the command send.
On analysing further at driver level it is seen that whenever this issue happens when st_int_enqueue is called its in ST_LL_ASLEEP_TO_AWAKE state and its queued in tx_waitq. But this never gets written to the uart line. Sharing below a dump of driver logs. Please help in understanding the issue.
(hci_tty): inside hci_tty_write (d13656c0, ae3650a4, 3, d0ccff80)
(hci_tty): start data..
<out<03 0c 00
(hci_tty):
..end data
(stc): 3 to be written
(stc): st_int_enqueue
(stll) : returning state 2
(stc): ST LL is AWAKE, sending normally
(stc): done st_int_enqueue
(stc): st_tx_wakeup
(stc): st_int_dequeue
(stc): st_int_write: count 3
(stc): st_int_dequeue
(stc): st_tty_wakeup
(stc): st_tx_wakeup
(stc): st_int_dequeue
configfs-gadget gadget: high-speed config #1: b
(stc): count 7 rx_state 0rx_count 0
(stc): len 4 room 1846(stc): st_send_frame(prot:4)
(hci_tty): @ st_receive(hci_tty): rx list que !empty
(stc): done st_int_recv
(stc): done st_tty_receive
(hci_tty): inside hci_tty_ioctl (d13656c0, 21531, ae36484c)
(hci_tty): returning 7
(hci_tty): inside hci_tty_read (d13656c0, ae184000, 7, d1c5bf80)
(hci_tty): total size read= 7
(hci_tty): inside hci_tty_write (d13656c0, beeff57b, 1, d0ccff80)
(hci_tty): start data..<out<01
(hci_tty):
..end data(stc): 1 to be written
(stc): st_int_enqueue(stll) : returning state 2
(stc): ST LL is AWAKE, sending normally(stc): done st_int_enqueue
(stc): st_tx_wakeup(stc): st_int_dequeue
(stc): st_int_write: count 1
(stc): st_tty_wakeup (stc): st_tx_wakeup
(stc): ST already sending(stc): st_int_dequeue
(stc): st_int_dequeue(stc): count 1 rx_state 0rx_count 0
(stll) :sleep indication recvd
(stll) :ll_device_want_to_sleep
(stll) :send_ll_cmd: writing 31
(stc): st_int_write: count 1
(stll) :use device tree data
(stll) : returning state 0
(stc): done st_int_recv
(stc): done st_tty_receive
(hci_tty): inside hci_tty_write (d13656c0, ae3650d4, 3, d0ccff80)
(hci_tty): start data..<out<05 10 00
(hci_tty):
..end data(stc): 3 to be written
(stc): st_int_enqueue(stll) : returning state 0
(stll) :send_ll_cmd: writing 32(stc): st_int_write: count 1
(stc): done st_int_enqueue(stc): st_tx_wakeup
(stc): st_int_dequeuehealthd: battery l=100 v=12205 t=26.5 h=2 st=5 c=0 fc=3865000 rc=3865000 cc=41 te=3932100 tf=3932100 chg=a
(hci_tty): inside hci_tty_write (d13656c0, beeff57b, 1, d0ccff80)
(hci_tty): start data..<out<01
(hci_tty):
..end data(stc): 1 to be written
(stc): st_int_enqueue(stll) : returning state 1
(stc): done st_int_enqueue(stc): st_tx_wakeup
(stc): st_int_dequeue(hci_tty): inside hci_tty_write (d13656c0, ae3650d4, 3, d0ccff80)
(hci_tty): start data..<out<5b fd 00 ------> this data is not written in uart line
(hci_tty):
..end data(stc): 3 to be written
(stc): st_int_enqueue(stll) : returning state 1
(stc): done st_int_enqueue(stc): st_tx_wakeup
(stc): st_int_dequeuelogd: logdr: UID=1002 GID=1002 PID=1047 n tail=5 logMask=8 pid=510 start=0ns timeout=0ns
logd: logdr: UID=1002 GID=1002 PID=1047 n tail=5 logMask=1 pid=510 start=0ns timeout=0ns
healthd: battery l=100 v=12205 t=26.5 h=2 st=5 c=0 fc=3865000 rc=3865000 cc=41 te=3932100 tf=3932100 chg=a
SYSWDG: active_prcs_cnt = 1, connectioncount = 2
logd: logdr: UID=1002 GID=1002 PID=1047 n tail=0 logMask=8 pid=510 start=0ns timeout=0ns
logd: logdr: UID=1002 GID=1002 PID=1047 n tail=0 logMask=1 pid=510 start=0ns timeout=0ns
init: Untracked pid 1047 exited with status 0
(hci_tty): inside hci_tty_release (d0b69ac0, d13656c0)
(stc): st_unregister: 4 (stc): remove_channel_from_table: id 4
(stc): st_unregister: 2 (stc): remove_channel_from_table: id 2
(stc): st_unregister: 3 (stc): remove_channel_from_table: id 3
(stc): all chnl_ids unregistered (stc): st_tty_flush_buffer
(stk) :use device tree data(stc): st_tty_flush_buffer
(stk) :ldisc_install = 0(stc): st_tty_flush_buffer
(stc): st_tty_flush_buffer (stc): st_tty_close
LOGCAT:
08-26 14:14:46.308 510 1043 I bt_core_module: module_start_up Starting module "controller_module"
08-26 14:14:46.308 265 265 I android.hardware.bluetooth@1.0.lotus: BluetoothHci::sendHciCommand
08-26 14:14:46.308 265 265 E android.hardware.bluetooth-hci-hci_protocol: WriteSafely length = 1
08-26 14:14:46.308 265 265 E android.hardware.bluetooth-hci-hci_protocol: 1
08-26 14:14:46.308 265 265 E android.hardware.bluetooth-hci-hci_protocol: WriteSafely transmitted_length = 1
08-26 14:14:46.308 265 265 E android.hardware.bluetooth-hci-hci_protocol: WriteSafely length = 3
08-26 14:14:46.308 265 265 E android.hardware.bluetooth-hci-hci_protocol: 3
08-26 14:14:46.308 265 265 E android.hardware.bluetooth-hci-hci_protocol: c
08-26 14:14:46.308 265 265 E android.hardware.bluetooth-hci-hci_protocol: 0
08-26 14:14:46.309 265 265 E android.hardware.bluetooth-hci-hci_protocol: WriteSafely transmitted_length = 3
08-26 14:14:46.415 265 1040 E : Read data from the notification FD
08-26 14:14:46.415 265 1040 E : Invoke the data ready callbacks if appropriate
08-26 14:14:46.415 265 1040 I android.hardware.bluetooth@1.0.lotus: BluetoothHci::initialize() IOCTL
08-26 14:14:46.426 265 1040 I android.hardware.bluetooth@1.0.lotus: BluetoothHci::initialize() READ
08-26 14:14:46.436 265 1040 I android.hardware.bluetooth@1.0.lotus: BluetoothHci::initialize() WRITE
08-26 14:14:46.436 265 1040 I : AsyncFdWatcher::ThreadRoutine select wait...
08-26 14:14:46.436 265 1040 E : Read data from the notification FD
08-26 14:14:46.436 265 1040 E : Invoke the data ready callbacks if appropriate
08-26 14:14:46.436 265 1040 I : AsyncFdWatcher::ThreadRoutine select wait...
08-26 14:14:46.436 265 1040 E : Read data from the notification FD
08-26 14:14:46.436 265 1040 E : Invoke the data ready callbacks if appropriate
08-26 14:14:46.436 265 1040 I : AsyncFdWatcher::ThreadRoutine select wait...
08-26 14:14:46.436 265 1040 E : Read data from the notification FD
08-26 14:14:46.436 265 1040 E : Invoke the data ready callbacks if appropriate
08-26 14:14:46.438 265 1040 I : AsyncFdWatcher::ThreadRoutine select wait...
08-26 14:14:46.438 265 265 I android.hardware.bluetooth@1.0.lotus: BluetoothHci::sendHciCommand
08-26 14:14:46.438 265 265 E android.hardware.bluetooth-hci-hci_protocol: WriteSafely length = 1
08-26 14:14:46.438 265 265 E android.hardware.bluetooth-hci-hci_protocol: 1
08-26 14:14:46.507 265 265 E android.hardware.bluetooth-hci-hci_protocol: WriteSafely transmitted_length = 1
08-26 14:14:46.507 265 265 E android.hardware.bluetooth-hci-hci_protocol: WriteSafely length = 3
08-26 14:14:46.507 265 265 E android.hardware.bluetooth-hci-hci_protocol: 5
08-26 14:14:46.507 265 265 E android.hardware.bluetooth-hci-hci_protocol: 10
08-26 14:14:46.508 265 265 E android.hardware.bluetooth-hci-hci_protocol: 0
08-26 14:14:46.513 839 1038 W MediaScanner: Error opening directory '/oem/media/', skipping: No such file or directory.
08-26 14:14:46.538 265 265 E android.hardware.bluetooth-hci-hci_protocol: WriteSafely transmitted_length = 3
08-26 14:14:46.538 265 265 E hw-IPCThreadState: binder thread pool (1 threads) starved for 101 ms
08-26 14:14:46.586 839 1038 V MediaScanner: pruneDeadThumbnailFiles... android.content.ContentProviderClient$CursorWrapperInner@2575a2f
08-26 14:14:46.587 839 1038 V MediaScanner: /pruneDeadThumbnailFiles... android.content.ContentProviderClient$CursorWrapperInner@2575a2f
08-26 14:14:48.540 510 579 E bt_hci : command_timed_out: 1 commands pending response
08-26 14:14:48.540 510 579 E bt_hci : command_timed_out: Waited 2102 ms for a response to opcode: 0x1005 *matches timer*
08-26 14:14:48.540 510 579 E bt_hci : command_timed_out: Size 3 Hex 05 10 00
08-26 14:14:48.540 510 579 E bt_hci : command_timed_out: requesting a firmware dump.
08-26 14:14:48.541 265 265 I android.hardware.bluetooth@1.0.lotus: BluetoothHci::sendHciCommand
08-26 14:14:48.541 265 265 E android.hardware.bluetooth-hci-hci_protocol: WriteSafely length = 1
08-26 14:14:48.541 265 265 E android.hardware.bluetooth-hci-hci_protocol: 1
08-26 14:14:48.567 265 265 E android.hardware.bluetooth-hci-hci_protocol: WriteSafely transmitted_length = 1
08-26 14:14:48.567 265 265 E android.hardware.bluetooth-hci-hci_protocol: WriteSafely length = 3
08-26 14:14:48.567 265 265 E android.hardware.bluetooth-hci-hci_protocol: 5b
08-26 14:14:48.567 265 265 E android.hardware.bluetooth-hci-hci_protocol: fd
08-26 14:14:48.567 265 265 E android.hardware.bluetooth-hci-hci_protocol: 0
08-26 14:14:48.592 265 265 E android.hardware.bluetooth-hci-hci_protocol: WriteSafely transmitted_length = 3
08-26 14:14:48.592 510 579 E bt_hci : command_timed_out restarting the Bluetooth process.
08-26 14:14:48.863 510 575 V BluetoothAdapterState: PendingCommand - transient state(s): isBleTurningOn
08-26 14:14:48.863 510 575 D BluetoothAdapterState: Current state: PENDING_COMMAND, message: 101
08-26 14:14:48.863 510 575 E BluetoothAdapterState: Error enabling Bluetooth (enable timeout)
Regards,
Sreejith