From 783efdfb59bcdfcd250d5fa72a79005f460aaab6 Mon Sep 17 00:00:00 2001 From: Kiruthika Vijayasekar Date: Tue, 25 Aug 2026 16:47:48 +0530 Subject: [PATCH] audioreach-driver: q6apm_audio_pkt: remap APM_EVENT_MODULE_TO_CLIENT dest_port When a GPR response's token isn't found in the audio-packet port map, module-to-client events (APM_EVENT_MODULE_TO_CLIENT) destined for the APM module IID were being dropped instead of delivered. Detect this case and remap the destination port to the SVA client port (8208), preserving the original source port, so these events reach the intended client instead of being silently discarded. Signed-off-by: Kiruthika Vijayasekar --- audioreach-driver/q6apm_audio_pkt.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/audioreach-driver/q6apm_audio_pkt.c b/audioreach-driver/q6apm_audio_pkt.c index 46260a7..76021ab 100644 --- a/audioreach-driver/q6apm_audio_pkt.c +++ b/audioreach-driver/q6apm_audio_pkt.c @@ -38,6 +38,7 @@ #define APM_CMD_SHARED_MEM_MAP_REGIONS 0x0100100C #define APM_CMD_SHARED_SATELLITE_MEM_MAP_REGIONS 0x01001026 #define APM_MEMORY_MAP_BIT_MASK_PHYS_ADDRESS 0x000001C1UL +#define APM_EVENT_MODULE_TO_CLIENT 0x03001000 /* Define Logging Macros */ static int audio_pkt_debug_mask; @@ -738,6 +739,12 @@ static int q6apm_audio_pkt_callback_core(const struct gpr_resp_pkt *data, void * kfree(audpkt_port_map); } else { dev_dbg(dev, "Token=%u not found\n", hdr->token); + if (hdr->opcode == APM_EVENT_MODULE_TO_CLIENT && + hdr->dest_port == GPR_APM_MODULE_IID) { + new_dest_port = 8208; + new_src_port = hdr->src_port; + remap_ports = true; + } } mutex_unlock(&apm->audpkt_port_lock);