Skip to content
Closed
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
15 changes: 10 additions & 5 deletions sound/soc/sof/loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,9 @@ EXPORT_SYMBOL(snd_sof_load_firmware_memcpy);
int snd_sof_run_firmware(struct snd_sof_dev *sdev)
{
struct sof_dsp_power_state state = {
.state = SOF_DSP_PM_D0,
};
.state = SOF_DSP_PM_D0,
};
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this should be the first patch.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Uh, sorry, I put this last on purpose. Now fixed in updated series.

ktime_t boot_start;
int ret;

init_waitqueue_head(&sdev->boot_wait);
Expand Down Expand Up @@ -143,6 +144,7 @@ int snd_sof_run_firmware(struct snd_sof_dev *sdev)
}

dev_dbg(sdev->dev, "booting DSP firmware\n");
boot_start = ktime_get();

/* boot the firmware on the DSP */
ret = snd_sof_dsp_run(sdev);
Expand Down Expand Up @@ -171,7 +173,6 @@ int snd_sof_run_firmware(struct snd_sof_dev *sdev)
if (sdev->fw_state == SOF_FW_BOOT_READY_FAILED)
return -EIO; /* FW boots but fw_ready op failed */

dev_dbg(sdev->dev, "firmware boot complete\n");
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The firmware boot proper is done at this point to be pragmatic, from this point we have the post boot calls, which needs a running firmware on the DSP side...

sof_set_fw_state(sdev, SOF_FW_BOOT_COMPLETE);

/* set the DSP power state to D0 after successful firmware boot */
Expand All @@ -185,9 +186,13 @@ int snd_sof_run_firmware(struct snd_sof_dev *sdev)
}

if (sdev->ipc->ops->post_fw_boot)
return sdev->ipc->ops->post_fw_boot(sdev);
ret = sdev->ipc->ops->post_fw_boot(sdev);

return 0;
if (!ret)
dev_dbg(sdev->dev, "firmware boot complete, took %lldus\n",
ktime_us_delta(ktime_get(), boot_start));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Are you fine with logging now the combined snd_sof_dsp_run() + snd_sof_dsp_post_fw_run() + sdev->ipc->ops->post_fw_boot() ?

Note: the basefw boot time can be deduced based on the timestamps in kernel log:

"booting DSP firmware"
...
"fw_state change: 6 -> 7"


return ret;
}
EXPORT_SYMBOL(snd_sof_run_firmware);

Expand Down
Loading