Bluetooth: btintel_pcie: DBGC flush doorbell and dump rate-limit

DBGC data in SMEM may not be up to date when a dump is collected. Make
btintel_pcie_coredump() arm USER_TRIGGERED_DUMP and ring the
IPC_CONTROL.COLLECT_DUMP_REQ doorbell first, so the firmware flushes
the SMEM contents to DRAM and the dump holds valid data. The resulting
fwTriggerDump interrupt queues the coredump with
TRIGGER_REASON_USER_TRIGGER and skips the firmware trigger event, as
there is none for a host-initiated flush. Firmware-initiated triggers
emit the diagnostic frame with TRIGGER_REASON_FW_ASSERT, except while a
doorbell reply is pending, as both raise the same interrupt.

The doorbell only concerns Bluetooth DBGC. When traces are routed to
the WiFi DBGC there is no host buffer to flush into, so skip the
request. When the core is halted the firmware cannot answer, so queue
the dump directly. If the firmware does not answer within 1 second,
treat the doorbell as missed and collect the dump directly.

Quiesce the doorbell path before entering D3: mask the firmware trigger
interrupt, drop a pending request, and wait for an in-flight timeout or
dump to finish. Unmask it again on resume or if suspend fails; firmware
triggers latched while it was masked are dropped.

Allow one user or firmware triggered dump per second, measured from the
end of the last dump, and reject concurrent dumps. A rate-limited
firmware trigger still emits the diagnostic frame; only the dump is
skipped.

Signed-off-by: Sai Teja Aluvala <aluvala.sai.teja@intel.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2 files changed