voice-proto: dump module events, wake sync waiter on unlisted results

- apm_callback: hexdump APM_EVENT_MODULE_TO_CLIENT (0x03001000) packets
  so module events (e.g. VCPM's) are visible in dmesg if delivered.
- GPR_BASIC_RSP_RESULT default case now records the result and wakes the
  waiter: probe opcodes sent via voice-proto (REGISTER_MODULE_EVENTS,
  future ones) get their DSP error immediately instead of stalling for
  the full command timeout.
This commit is contained in:
Jorijn van der Graaf 2026-07-11 23:03:10 +02:00
commit ff614d787e

View file

@ -861,9 +861,31 @@ static int apm_callback(const struct gpr_resp_pkt *data, void *priv, int op)
wake_up(&apm->wait);
break;
default:
/*
* Unlisted command results (debug/probe opcodes sent
* via voice-proto) must still wake the sync waiter or
* every such send stalls for the full timeout.
*/
apm->result.opcode = result->opcode;
apm->result.status = result->status;
if (result->status)
dev_err(dev, "Error (%d) Processing 0x%08x cmd\n",
result->status, result->opcode);
wake_up(&apm->wait);
break;
}
break;
case 0x03001000: { /* APM_EVENT_MODULE_TO_CLIENT */
/* apm_module_event_t: event_id, payload_size, payload */
const u32 *ev = data->payload;
u32 ev_sz = hdr->pkt_size - hdr->hdr_size * 4;
dev_info(dev, "MODULE EVENT from 0x%x: event_id 0x%08x size %u\n",
hdr->src_port, ev[0], ev[1]);
print_hex_dump(KERN_INFO, "EVENT: ", DUMP_PREFIX_OFFSET,
16, 4, ev, ev_sz, false);
break;
}
case APM_CMD_RSP_GET_CFG: {
/* status word, then apm_module_param_data_t sections */
const u32 *rsp_pl = data->payload;