Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 03ce5517 authored by Hsin-chen Chuang's avatar Hsin-chen Chuang
Browse files

floss: Skip on_hci_timeout

The DumpStopWatchLog call (more specifically the lock guard) generates
many crash records for Floss. Since it's unuseful in Floss, this CL
simply skips it.

Bug: 362366319
Tag: #floss
Test: mmm packages/modules/Bluetooth
Test: bluetooth_AdapterSRHealth.all_floss on RTL8822
Flag: EXEMPT, Floss-only change
Change-Id: I60c8dc9e6593576b5d65337c75194d5fa07871c7
parent e9c1990b
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -294,6 +294,16 @@ struct HciLayer::impl {
  }

  void on_hci_timeout(OpCode op_code) {
#ifdef TARGET_FLOSS
    log::warn("Ignoring the timeouted HCI command {}.", OpCodeText(op_code));
    // Terminate the process to trigger controller reset, also mark the controller
    // is broken to prevent further error while terminating.
    auto hal = module_.GetDependency<hal::HciHal>();
    hal->markControllerBroken();
    kill(getpid(), SIGTERM);
    return;
#endif

    common::StopWatch::DumpStopWatchLog();
    log::error("Timed out waiting for {} for {}ms", OpCodeText(op_code), getHciTimeoutMs().count());

@@ -305,16 +315,6 @@ struct HciLayer::impl {
    command_credits_ = 1;
    waiting_command_ = OpCode::NONE;

#ifdef TARGET_FLOSS
    log::warn("Ignoring the timeouted HCI command {}.", OpCodeText(op_code));
    // Terminate the process to trigger controller reset, also mark the controller
    // is broken to prevent further error while terminating.
    auto hal = module_.GetDependency<hal::HciHal>();
    hal->markControllerBroken();
    kill(getpid(), SIGTERM);
    return;
#endif

    // Ignore the response, since we don't know what might come back.
    enqueue_command(ControllerDebugInfoBuilder::Create(),
                    module_.GetHandler()->BindOnce([](CommandCompleteView) {}));