diff options
author | Craig Dooley <dooleyc@google.com> | 2022-10-17 22:23:34 +0000 |
---|---|---|
committer | Craig Dooley <dooleyc@google.com> | 2022-10-18 05:34:37 +0000 |
commit | 92d07ce2649d387280b9962b3b3b76047cb08a40 (patch) | |
tree | 5f5fbe7e01655a76be766203d5ff81517cd6008b | |
parent | b1426f59b7504d4b51c213953b86f25899d61001 (diff) | |
download | aoc-92d07ce2649d387280b9962b3b3b76047cb08a40.tar.gz |
Update alsa timeout signature to better cluster crashes
Bug: 248350285
Change-Id: I9830ee9065e265ec9245dd2325c6ae1ac290ca27
Signed-off-by: Craig Dooley <dooleyc@google.com>
-rwxr-xr-x | alsa/aoc_alsa.h | 3 | ||||
-rwxr-xr-x | alsa/aoc_alsa_hw.c | 9 |
2 files changed, 7 insertions, 5 deletions
diff --git a/alsa/aoc_alsa.h b/alsa/aoc_alsa.h index 3c0fc5c..1ed41e1 100755 --- a/alsa/aoc_alsa.h +++ b/alsa/aoc_alsa.h @@ -110,9 +110,6 @@ enum uc_device_id { #define NULL_PATH -1 -/* Define trigger aoc watchdog reason */ -#define ALSA_CTL_TIMEOUT "alsa_ctl_timeout" - /* TODO: Copied from AoC repo and will be removed */ enum bluetooth_mode { AHS_BT_MODE_UNCONFIGURED = 0, diff --git a/alsa/aoc_alsa_hw.c b/alsa/aoc_alsa_hw.c index 75d4fc7..ed0e20b 100755 --- a/alsa/aoc_alsa_hw.c +++ b/alsa/aoc_alsa_hw.c @@ -268,11 +268,16 @@ static int aoc_audio_control(const char *cmd_channel, const uint8_t *cmd, #endif /* AOC_CMD_DEBUG_ENABLE */ if (err < 1) { + uint16_t cmd_id = ((struct CMD_HDR *)cmd)->id; + char reset_reason[40]; + + scnprintf(reset_reason, sizeof(reset_reason), "No response to ALSA command %#06x", + cmd_id); pr_err(ALSA_AOC_CMD " ERR:timeout - cmd [%s] id %#06x\n", - CMD_CHANNEL(dev), ((struct CMD_HDR *)cmd)->id); + CMD_CHANNEL(dev), cmd_id); print_hex_dump(KERN_ERR, ALSA_AOC_CMD " :mem ", DUMP_PREFIX_OFFSET, 16, 1, cmd, cmd_size, false); - aoc_trigger_watchdog(ALSA_CTL_TIMEOUT); + aoc_trigger_watchdog(reset_reason); } else if (err == 4) { pr_err(ALSA_AOC_CMD " ERR:%#x - cmd [%s] id %#06x\n", *(uint32_t *)buffer, CMD_CHANNEL(dev), |