Skip to content

Commit e51f495

Browse files
ranj063broonie
authored andcommitted
ASoC: SOF: ipc4: Ensure DSP is in D0I0 during sof_ipc4_set_get_data()
The set_get_data() IPC op bypasses the check for the no_pm flag as done with the regular IPC tx_msg op. Since set_get_data should be performed when the DSP is in D0I0, set the DSP power state to D0I0 before sending the IPC's in sof_ipc4_set_get_data(). Fixes: ceb89ac ("ASoC: SOF: ipc4: Add support for mandatory message handling functionality") Signed-off-by: Ranjani Sridharan <[email protected]> Reviewed-by: Bard Liao <[email protected]> Reviewed-by: Péter Ujfalusi <[email protected]> Reviewed-by: Pierre-Louis Bossart <[email protected]> Signed-off-by: Peter Ujfalusi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 205efd4 commit e51f495

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

sound/soc/sof/ipc4.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,9 @@ static int sof_ipc4_tx_msg(struct snd_sof_dev *sdev, void *msg_data, size_t msg_
405405
static int sof_ipc4_set_get_data(struct snd_sof_dev *sdev, void *data,
406406
size_t payload_bytes, bool set)
407407
{
408+
const struct sof_dsp_power_state target_state = {
409+
.state = SOF_DSP_PM_D0,
410+
};
408411
size_t payload_limit = sdev->ipc->max_payload_size;
409412
struct sof_ipc4_msg *ipc4_msg = data;
410413
struct sof_ipc4_msg tx = {{ 0 }};
@@ -435,6 +438,11 @@ static int sof_ipc4_set_get_data(struct snd_sof_dev *sdev, void *data,
435438

436439
tx.extension |= SOF_IPC4_MOD_EXT_MSG_FIRST_BLOCK(1);
437440

441+
/* ensure the DSP is in D0i0 before sending IPC */
442+
ret = snd_sof_dsp_set_power_state(sdev, &target_state);
443+
if (ret < 0)
444+
return ret;
445+
438446
/* Serialise IPC TX */
439447
mutex_lock(&sdev->ipc->tx_mutex);
440448

0 commit comments

Comments
 (0)