IPC4 error code corrections#10808
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request updates IPC4 reply/status handling to better match IPC4 protocol expectations, mainly by correcting error codes returned from IPC4 module and BaseFW-related handlers to improve compliance and re-enable shared reference-firmware tests.
Changes:
- Replace several uses of
IPC4_MOD_INVALID_IDwithIPC4_INVALID_RESOURCE_IDin IPC4 module config/large-config paths. - Add explicit validation that the BaseFW module only supports instance
0(for large-config get). - Adjust module-message default handling to return
IPC4_UNKNOWN_MESSAGE_TYPEfor unknown commands, and explicitly mark some module commands asIPC4_UNAVAILABLE.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/ipc/ipc4/handler-user.c |
Updates module-message error/status returns and adds BaseFW instance validation for large-config get. |
src/audio/base_fw_intel.c |
Changes default error code returned by Intel BaseFW vendor get-large-config handler. |
| } else { | ||
| drv = ipc4_get_comp_drv(config->primary.r.module_id); | ||
| } | ||
|
|
||
| if (!drv) | ||
| return IPC4_MOD_INVALID_ID; | ||
| return IPC4_INVALID_RESOURCE_ID; |
| } else { | ||
| drv = ipc4_get_comp_drv(config.primary.r.module_id); | ||
| } | ||
|
|
||
| if (!drv) | ||
| return IPC4_MOD_INVALID_ID; | ||
| return IPC4_INVALID_RESOURCE_ID; |
| extended_param_id.full = param_id; | ||
|
|
||
| uint32_t ret = IPC4_ERROR_INVALID_PARAM; | ||
| uint32_t ret = IPC4_INVALID_REQUEST; |
| case SOF_IPC4_MOD_SET_DX: | ||
| case SOF_IPC4_MOD_SET_D0IX: |
There was a problem hiding this comment.
What about this change? You didn't mention it in the commit message.
There was a problem hiding this comment.
Those messages are known but unsupported. Hence they had to be moved here so that they don’t fall into the UNKNOWN_MESSAGE_TYPE default case (because the default error code has changed).
There was a problem hiding this comment.
They are supported but are handled in handler-kernel.c. This won't cause an error and can probably stay, it's just a bit misleading.
There was a problem hiding this comment.
You are right. I will fix this. Thanks!
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 <wojciech.jablonski@intel.com>
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 <wojciech.jablonski@intel.com>
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 <wojciech.jablonski@intel.com>
Only 0th instance of BaseFW module is available. Report an error for any other instance Signed-off-by: Wojciech Jablonski <wojciech.jablonski@intel.com>
8326009 to
f15a1c1
Compare
These commits correct a bunch of error codes to improve compliance with the IPC4 protocol. This allows me to re-enable older tests that are shared with the reference firmware. Some of the fixes seem sound, while others seem more arbitrary, especially the change from MOD_INVALID_ID to INVALID_RESOURCE_ID. Those may reflect the reference firmware's design or implementation rather than an intentional protocol decision. Therefore, if any of these changes are unacceptable or incompatible with the driver, please let me know. I will try to address those issues elsewhere.