-
Notifications
You must be signed in to change notification settings - Fork 357
IPC4 error code corrections #10808
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
IPC4 error code corrections #10808
Changes from all commits
3501bf4
d8ded69
feba368
bd988c1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -809,19 +809,23 @@ 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; | ||
|
|
||
| /* Pass IPC to target core */ | ||
| 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); | ||
| } | ||
|
|
||
| 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,19 +1000,23 @@ __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; | ||
|
|
||
| /* Pass IPC to target core */ | ||
| 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); | ||
| } | ||
|
|
||
| if (!drv) | ||
| return IPC4_MOD_INVALID_ID; | ||
| return IPC4_INVALID_RESOURCE_ID; | ||
|
|
||
| if (!drv->ops.get_large_config) | ||
| return IPC4_INVALID_REQUEST; | ||
|
|
@@ -1041,7 +1049,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,19 +1173,23 @@ __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; | ||
|
|
||
| /* Pass IPC to target core */ | ||
| 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); | ||
| } | ||
|
|
||
| if (!drv) | ||
| return IPC4_MOD_INVALID_ID; | ||
| return IPC4_INVALID_RESOURCE_ID; | ||
|
|
||
| if (!drv->ops.set_large_config) | ||
| return IPC4_INVALID_REQUEST; | ||
|
|
@@ -1281,7 +1293,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; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One thing that should be done incrementally is making sure each error path has a unique LOG_ERR(). I found several error paths that would give us the same return value and LOG message which was confusing for user and agents (in fact the agent added its own temp logging to find the actual error).
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree. I also came across such places in the code. I am going to keep that in mind while providing further IPC related fixes. |
||
| break; | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed