Skip to content
Open
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
6 changes: 5 additions & 1 deletion zephyr/lib/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,11 @@ static void resume_dais(void)
cd = module_get_private_data(mod);
dd = cd->dd[0];
if (dai_probe(dd->dai->dev) < 0) {
tr_err(&zephyr_tr, "DAI resume failed, type %d index %d",
tr_err(&zephyr_tr, "DAI resume failed on probe, type %d index %d",
dd->dai->type, dd->dai->index);
Copy link
Collaborator

Choose a reason for hiding this comment

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

in fact wondering if trying to continue after an error here makes sense? Shouldn't we skip this DAI (using continune) if re-probing fails? Same for the dai_set_config() failure below?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Consider that probe might fail simply because dai_remove failed while entering D3 and a given device is already operational. For example I found the following code in dai_ssp_probe:

    if (dai_get_drvdata(dp)) {
            return -EEXIST; /* already created */
    }

In that case we probably can skip dai_set_config. But should we also skip microphone privacy settings?

Copy link
Contributor

Choose a reason for hiding this comment

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

If re-probing fails, setting the config makes no sense and will probably fail itself as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I just put dai_set_config under "else". The microphone privacy settings probably should stay as is because, if I understand it correctly, the code already is conditional (if an IRQ is not missed during D3 nothing happens)

} else if (dai_set_config(dd->dai, &dd->ipc_config, cd->gtw_cfg,
cd->config.gtw_cfg.config_length) < 0) {
tr_err(&zephyr_tr, "DAI resume failed on config, type %d index %d",
dd->dai->type, dd->dai->index);
}

Expand Down
Loading