retval = sst_wait_interruptible_timeout(sst_drv_ctx,
&str_info->ctrl_blk, SST_BLOCK_TIMEOUT);
if ((retval != 0) || (str_info->ctrl_blk.ret_code != 0)) {
- pr_debug("FW alloc failed retval %d, ret_code %d\n",
+ pr_err("sst: FW alloc failed retval %d, ret_code %d\n",
retval, str_info->ctrl_blk.ret_code);
str_id = -str_info->ctrl_blk.ret_code; /*return error*/
if (str_id == 0)
}
if (!str_param) {
- pr_debug("open_pcm, doing rtpm_put\n");
- pm_runtime_put(&sst_drv_ctx->pci->dev);
+ pr_debug("sst: open_pcm, doing rtpm_put\n");
return -EINVAL;
}
+ mutex_lock(&sst_drv_ctx->sst_lock);
+ if (sst_drv_ctx->sst_state != SST_FW_RUNNING) {
+ mutex_unlock(&sst_drv_ctx->sst_lock);
+ return -EAGAIN;
+ }
+ mutex_unlock(&sst_drv_ctx->sst_lock);
+
retval = sst_get_stream(str_param);
if (retval > 0) {
sst_drv_ctx->stream_cnt++;
ret_val = sst_platform_alloc_stream(substream);
if (ret_val <= 0)
- return ret_val;
+ goto out;
snprintf(substream->pcm->id, sizeof(substream->pcm->id),
"%d", stream->stream_info.str_id);
return ret_val;
substream->runtime->hw.info = SNDRV_PCM_INFO_BLOCK_TRANSFER;
+
+out:
/* we are suspending the sink/source here as we want to have
* device suspended in idle, before handling next request we will send
* an explict RESUME call */
pr_debug("Suspend NOW\n");
- ret_val = stream->sstdrv_ops->pcm_control->device_control(
+ stream->sstdrv_ops->pcm_control->device_control(
SST_SND_DEVICE_SUSPEND, &stream->stream_info.str_id);
sst_set_stream_status(stream, SST_PLATFORM_SUSPENDED);
return ret_val;