Skip to content

Commit

Permalink
ASoC: SOF: ignore unrecoverable CTX_SAVE IPC errors at suspend
Browse files Browse the repository at this point in the history
As part of the suspend flow, a context save IPC message is
sent to the firmware before powering down the DSP. If errors
are met, the suspend flow is aborted with current code.

Change the behaviour such that if firmware returns -EBUSY or
-EAGAIN, return the error codes to PM core as before. The device
is left in active state in this case.

If other errors are reported, print a warning but do not block the
suspend flow. As per interface specification, no valid error can be
returned in this scenario. If the hardware has hit a fatal error and
is not able to respond successfully, best recovery method is to
proceed with suspend and power off the DSP.

Signed-off-by: Kai Vehmanen <[email protected]>
  • Loading branch information
kv2019i committed Jun 5, 2019
1 parent 0a747dc commit a2748c6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion sound/soc/sof/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,20 @@ static int sof_suspend(struct device *dev, bool runtime_suspend)
#endif
/* notify DSP of upcoming power down */
ret = sof_send_pm_ipc(sdev, SOF_IPC_PM_CTX_SAVE);
if (ret < 0) {
if (ret == -EBUSY || ret == -EAGAIN) {
/*
* runtime PM has logic to handle -EBUSY/-EAGAIN so
* pass these errors up
*/
dev_err(sdev->dev,
"error: ctx_save ipc error during suspend %d\n",
ret);
return ret;
} else if (ret < 0) {
/* FW in unexpected state, continue to power down */
dev_warn(sdev->dev,
"ctx_save ipc error %d, proceeding with suspend\n",
ret);
}

/* power down all DSP cores */
Expand Down

0 comments on commit a2748c6

Please sign in to comment.