Skip to content
Merged
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
7 changes: 4 additions & 3 deletions src/audio/copier/copier.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,6 @@ static int create_dai(struct comp_dev *parent_dev, struct copier_data *cd,
const struct comp_driver *drv;
struct ipc_config_dai dai;
int dai_count;
int ret;
int i;

drv = ipc4_get_drv((uint8_t *)&id);
Expand Down Expand Up @@ -388,15 +387,17 @@ static int create_dai(struct comp_dev *parent_dev, struct copier_data *cd,
}

for (i = 0; i < dai_count; i++) {
int ret;

dai.dai_index = dai_index[i];
ret = init_dai(parent_dev, drv, config, copier, pipeline, &dai, type, i);
if (ret) {
comp_err(parent_dev, "failed to create dai");
break;
return ret;
}
}

return ret;
return 0;
}

static int init_pipeline_reg(struct comp_dev *dev)
Expand Down
6 changes: 1 addition & 5 deletions src/audio/data_blob.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,11 +281,7 @@ int ipc4_comp_data_blob_set(struct comp_data_blob_handler *blob_handler,
int ret;
int valid_data_size;

if (!blob_handler) {
comp_err(blob_handler->dev,
"ipc4_comp_data_blob_set(): blob_handler is NULL!");
return -EINVAL;
}
assert(blob_handler);

comp_dbg(blob_handler->dev,
"ipc4_comp_data_blob_set(): data_offset = %d",
Expand Down
4 changes: 2 additions & 2 deletions src/audio/module_adapter/iadk/system_agent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ SystemAgent::SystemAgent(uint32_t module_id,
core_id_(core_id),
module_id_(module_id),
instance_id_(instance_id),
module_handle_(NULL)
module_handle_(NULL),
module_size_(0)
{}


void SystemAgent::CheckIn(ProcessingModuleInterface& processing_module,
ModuleHandle &module_handle,
LogHandle *&log_handle)
Expand Down
4 changes: 4 additions & 0 deletions src/ipc/ipc4/handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,10 @@ static int set_pipeline_state(struct ipc_comp_dev *ppl_icd, uint32_t cmd,
}
if (ret == PPL_STATUS_SCHEDULED)
*delayed = true;
break;
default:
tr_err(&ipc_tr, "ipc: invalid status %d for RESET", status);
return IPC4_INVALID_REQUEST;
}

/*
Expand Down
9 changes: 7 additions & 2 deletions src/library_manager/lib_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,8 @@ static int lib_manager_dma_init(struct lib_manager_dma_ext *dma_ext, uint32_t dm
int chan_index;
int ret;

/* Initialize dma_ext with zeros */
memset(dma_ext, 0, sizeof(struct lib_manager_dma_ext));
/* request DMA in the dir HMEM->LMEM */
dma_ext->dma = dma_get(DMA_DIR_HMEM_TO_LMEM, 0, DMA_DEV_HOST,
DMA_ACCESS_EXCLUSIVE);
Expand Down Expand Up @@ -451,8 +453,11 @@ static int lib_manager_dma_init(struct lib_manager_dma_ext *dma_ext, uint32_t dm

static int lib_manager_dma_deinit(struct lib_manager_dma_ext *dma_ext, uint32_t dma_id)
{
dma_release_channel(dma_ext->dma->z_dev, dma_id);
dma_put(dma_ext->dma);
if (dma_ext->dma) {
dma_put(dma_ext->dma);
if (dma_ext->dma->z_dev)
dma_release_channel(dma_ext->dma->z_dev, dma_id);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I feel like this is an ordering issue -- is dma_ext->dma even valid after dma_put? I missed this in the original commit I think.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I think You are right. Thank you for catching this.

Copy link
Member

Choose a reason for hiding this comment

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

yes, should be like on mtl-002
c4f38c2

}
return 0;
}

Expand Down
30 changes: 11 additions & 19 deletions src/probe/probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -979,41 +979,33 @@ static struct comp_buffer *ipc4_get_buffer(struct ipc_comp_dev *dev, probe_point
struct comp_buffer *buf;
struct comp_buffer __sparse_cache *buf_c;
struct list_item *sink_list, *source_list;
unsigned int queue_id;

switch (probe_point.fields.type) {
case PROBE_TYPE_INPUT:
if (list_is_empty(&dev->cd->bsource_list))
return NULL;

list_for_item(source_list, &dev->cd->bsource_list) {
buf = container_of(source_list, struct comp_buffer, sink_list);
buf_c = buffer_acquire(buf);

if (IPC4_SRC_QUEUE_ID(buf_c->id) == probe_point.fields.index)
break;

queue_id = IPC4_SRC_QUEUE_ID(buf_c->id);
buffer_release(buf_c);

if (queue_id == probe_point.fields.index)
return buf;
}
break;
case PROBE_TYPE_OUTPUT:
if (list_is_empty(&dev->cd->bsink_list))
return NULL;

list_for_item(sink_list, &dev->cd->bsink_list) {
buf = container_of(sink_list, struct comp_buffer, source_list);
buf_c = buffer_acquire(buf);

if (IPC4_SINK_QUEUE_ID(buf_c->id) == probe_point.fields.index)
break;

queue_id = IPC4_SINK_QUEUE_ID(buf_c->id);
buffer_release(buf_c);

if (queue_id == probe_point.fields.index)
return buf;
}
break;
default:
return NULL;
}
buffer_release(buf_c);
return buf;

return NULL;
}
#endif

Expand Down
4 changes: 4 additions & 0 deletions tools/logger/convert.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ static const char *format_uid(uint32_t uid_ptr, int use_colors, bool be, bool up
if (uid_ptr < uids_dict->base_address ||
uid_ptr >= uids_dict->base_address + uids_dict->data_length) {
str = calloc(1, strlen(BAD_PTR_STR) + 1 + 6);
if (!str) {
log_err("can't allocate memory\n");
exit(EXIT_FAILURE);
}
sprintf(str, BAD_PTR_STR, uid_ptr);
} else {
uid_entry = get_uuid_entry(uid_ptr);
Expand Down
10 changes: 10 additions & 0 deletions tools/logger/logger.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,11 @@ static void *wait_open(const char *watched_dir, const char *expected_file)

char * const fpath = malloc(strlen(watched_dir) + 1 + strlen(expected_file) + 1);

if (!fpath) {
fprintf(stderr, "error: can't allocate memory\n");
exit(EXIT_FAILURE);
}

strcpy(fpath, watched_dir);
strcat(fpath, "/");
strcat(fpath, expected_file);
Expand Down Expand Up @@ -436,6 +441,11 @@ int main(int argc, char *argv[])
if (!config.in_file && !config.dump_ldc)
config.in_file = "/sys/kernel/debug/sof/etrace";

if (!config.in_file && baud) {
fprintf(stderr, "error: No UART device specified\n");
usage();
}

if (config.input_std) {
config.in_fd = stdin;
} else if (baud) {
Expand Down