From dc05331b6a338352ae5c312c5dc94a5c94ce9132 Mon Sep 17 00:00:00 2001 From: Wojciech Jablonski Date: Fri, 15 May 2026 16:00:51 +0200 Subject: [PATCH 1/4] ipc4: handler-user: fix invalid module IPC type status Improve IPC4 protocol adherence by return IPC4_UNKNOWN_MESSAGE_TYPE for unsupported module IPCs instead of reporting them as IPC4_UNAVAILABLE Signed-off-by: Wojciech Jablonski --- src/ipc/ipc4/handler-user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ipc/ipc4/handler-user.c b/src/ipc/ipc4/handler-user.c index 2bfa31babce0..bfcfca27a972 100644 --- a/src/ipc/ipc4/handler-user.c +++ b/src/ipc/ipc4/handler-user.c @@ -1281,7 +1281,7 @@ __cold int ipc4_user_process_module_message(struct ipc4_message_request *ipc4, ret = IPC4_UNAVAILABLE; break; default: - ret = IPC4_UNAVAILABLE; + ret = IPC4_UNKNOWN_MESSAGE_TYPE; break; } From 6dd6998bcf32462abdd2f8c6b139a3904e8c1b49 Mon Sep 17 00:00:00 2001 From: Wojciech Jablonski Date: Mon, 18 May 2026 11:11:03 +0200 Subject: [PATCH 2/4] ipc4: basefw: fix error code for invalid param IDs Error code INVALID_PARAM is more generic and shall be used when a supported operation contains an invalid value in its data structure. For unsupported operations, INVALID_REQUEST shall be used instead. Signed-off-by: Wojciech Jablonski --- src/audio/base_fw_intel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/audio/base_fw_intel.c b/src/audio/base_fw_intel.c index 510d31190a22..67b87a0afed4 100644 --- a/src/audio/base_fw_intel.c +++ b/src/audio/base_fw_intel.c @@ -424,7 +424,7 @@ __cold int basefw_vendor_get_large_config(struct comp_dev *dev, uint32_t param_i extended_param_id.full = param_id; - uint32_t ret = IPC4_ERROR_INVALID_PARAM; + uint32_t ret = IPC4_INVALID_REQUEST; switch (extended_param_id.part.parameter_type) { case IPC4_MEMORY_STATE_INFO_GET: @@ -560,7 +560,7 @@ __cold int basefw_vendor_set_large_config(struct comp_dev *dev, uint32_t param_i break; } - return IPC4_UNKNOWN_MESSAGE_TYPE; + return IPC4_INVALID_REQUEST; } __cold int basefw_vendor_dma_control(uint32_t node_id, const char *config_data, size_t data_size) From 62e6c9d2fc0bb0abce72301398629d8e5ed75263 Mon Sep 17 00:00:00 2001 From: Wojciech Jablonski Date: Mon, 18 May 2026 12:59:12 +0200 Subject: [PATCH 3/4] ipc4: handler-user: fix error code for unresolved modules In the context of Config Get/Set, when the target module instance cannot be resolved, FW should report INVALID_RESOURCE_ID. MOD_INVALID_ID should be reserved for other module-related IPCs. Signed-off-by: Wojciech Jablonski --- src/ipc/ipc4/handler-user.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ipc/ipc4/handler-user.c b/src/ipc/ipc4/handler-user.c index bfcfca27a972..890dea6163c0 100644 --- a/src/ipc/ipc4/handler-user.c +++ b/src/ipc/ipc4/handler-user.c @@ -809,7 +809,7 @@ static int ipc4_set_get_config_module_instance(struct ipc4_message_request *ipc4 comp_id = IPC4_COMP_ID(config->primary.r.module_id, config->primary.r.instance_id); dev = ipc4_get_comp_dev(comp_id); if (!dev) - return IPC4_MOD_INVALID_ID; + return IPC4_INVALID_RESOURCE_ID; drv = dev->drv; @@ -821,7 +821,7 @@ static int ipc4_set_get_config_module_instance(struct ipc4_message_request *ipc4 } if (!drv) - return IPC4_MOD_INVALID_ID; + return IPC4_INVALID_RESOURCE_ID; function = set ? drv->ops.set_attribute : drv->ops.get_attribute; if (!function) @@ -996,7 +996,7 @@ __cold static int ipc4_get_large_config_module_instance(struct ipc4_message_requ config.primary.r.instance_id); dev = ipc4_get_comp_dev(comp_id); if (!dev) - return IPC4_MOD_INVALID_ID; + return IPC4_INVALID_RESOURCE_ID; drv = dev->drv; @@ -1008,7 +1008,7 @@ __cold static int ipc4_get_large_config_module_instance(struct ipc4_message_requ } if (!drv) - return IPC4_MOD_INVALID_ID; + return IPC4_INVALID_RESOURCE_ID; if (!drv->ops.get_large_config) return IPC4_INVALID_REQUEST; @@ -1041,7 +1041,7 @@ __cold static int ipc4_get_large_config_module_instance(struct ipc4_message_requ /* set up ipc4 error code for reply data */ if (ret < 0) - ret = IPC4_MOD_INVALID_ID; + ret = IPC4_INVALID_RESOURCE_ID; /* Copy host config and overwrite */ reply.extension.dat = config.extension.dat; @@ -1165,7 +1165,7 @@ __cold static int ipc4_set_large_config_module_instance(struct ipc4_message_requ comp_id = IPC4_COMP_ID(config.primary.r.module_id, config.primary.r.instance_id); dev = ipc4_get_comp_dev(comp_id); if (!dev) - return IPC4_MOD_INVALID_ID; + return IPC4_INVALID_RESOURCE_ID; drv = dev->drv; @@ -1177,7 +1177,7 @@ __cold static int ipc4_set_large_config_module_instance(struct ipc4_message_requ } if (!drv) - return IPC4_MOD_INVALID_ID; + return IPC4_INVALID_RESOURCE_ID; if (!drv->ops.set_large_config) return IPC4_INVALID_REQUEST; From f15a1c101fa40dd1020ae6ac9af4f430f8f4a14c Mon Sep 17 00:00:00 2001 From: Wojciech Jablonski Date: Mon, 18 May 2026 17:54:21 +0200 Subject: [PATCH 4/4] ipc4: handler-user: reject invalid basefw module IDs Only 0th instance of BaseFW module is available. Report an error for any other instance Signed-off-by: Wojciech Jablonski --- src/ipc/ipc4/handler-user.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/ipc/ipc4/handler-user.c b/src/ipc/ipc4/handler-user.c index 890dea6163c0..e55af1c66ec5 100644 --- a/src/ipc/ipc4/handler-user.c +++ b/src/ipc/ipc4/handler-user.c @@ -817,6 +817,10 @@ static int ipc4_set_get_config_module_instance(struct ipc4_message_request *ipc4 if (!cpu_is_me(dev->ipc_config.core)) return ipc4_process_on_core(dev->ipc_config.core, false); } else { + /* BaseFW module has only 0th instance */ + if (config->primary.r.instance_id) + return IPC4_INVALID_RESOURCE_ID; + drv = ipc4_get_comp_drv(config->primary.r.module_id); } @@ -1004,6 +1008,10 @@ __cold static int ipc4_get_large_config_module_instance(struct ipc4_message_requ if (!cpu_is_me(dev->ipc_config.core)) return ipc4_process_on_core(dev->ipc_config.core, false); } else { + /* BaseFW module has only 0th instance */ + if (config.primary.r.instance_id) + return IPC4_INVALID_RESOURCE_ID; + drv = ipc4_get_comp_drv(config.primary.r.module_id); } @@ -1173,6 +1181,10 @@ __cold static int ipc4_set_large_config_module_instance(struct ipc4_message_requ if (!cpu_is_me(dev->ipc_config.core)) return ipc4_process_on_core(dev->ipc_config.core, false); } else { + /* BaseFW module has only 0th instance */ + if (config.primary.r.instance_id) + return IPC4_INVALID_RESOURCE_ID; + drv = ipc4_get_comp_drv(config.primary.r.module_id); }