Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/audio/base_fw_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed


switch (extended_param_id.part.parameter_type) {
case IPC4_MEMORY_STATE_INFO_GET:
Expand Down Expand Up @@ -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)
Expand Down
28 changes: 20 additions & 8 deletions src/ipc/ipc4/handler-user.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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;
}

Expand Down
Loading