|
@@ -1228,6 +1228,11 @@ int sst_hsw_stream_free(struct sst_hsw *hsw, struct sst_hsw_stream *stream)
|
|
struct sst_dsp *sst = hsw->dsp;
|
|
struct sst_dsp *sst = hsw->dsp;
|
|
unsigned long flags;
|
|
unsigned long flags;
|
|
|
|
|
|
|
|
+ if (!stream) {
|
|
|
|
+ dev_warn(hsw->dev, "warning: stream is NULL, no stream to free, ignore it.\n");
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
/* dont free DSP streams that are not commited */
|
|
/* dont free DSP streams that are not commited */
|
|
if (!stream->commited)
|
|
if (!stream->commited)
|
|
goto out;
|
|
goto out;
|
|
@@ -1415,6 +1420,16 @@ int sst_hsw_stream_commit(struct sst_hsw *hsw, struct sst_hsw_stream *stream)
|
|
u32 header;
|
|
u32 header;
|
|
int ret;
|
|
int ret;
|
|
|
|
|
|
|
|
+ if (!stream) {
|
|
|
|
+ dev_warn(hsw->dev, "warning: stream is NULL, no stream to commit, ignore it.\n");
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (stream->commited) {
|
|
|
|
+ dev_warn(hsw->dev, "warning: stream is already committed, ignore it.\n");
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
trace_ipc_request("stream alloc", stream->host_id);
|
|
trace_ipc_request("stream alloc", stream->host_id);
|
|
|
|
|
|
header = IPC_GLB_TYPE(IPC_GLB_ALLOCATE_STREAM);
|
|
header = IPC_GLB_TYPE(IPC_GLB_ALLOCATE_STREAM);
|
|
@@ -1519,6 +1534,11 @@ int sst_hsw_stream_pause(struct sst_hsw *hsw, struct sst_hsw_stream *stream,
|
|
{
|
|
{
|
|
int ret;
|
|
int ret;
|
|
|
|
|
|
|
|
+ if (!stream) {
|
|
|
|
+ dev_warn(hsw->dev, "warning: stream is NULL, no stream to pause, ignore it.\n");
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
trace_ipc_request("stream pause", stream->reply.stream_hw_id);
|
|
trace_ipc_request("stream pause", stream->reply.stream_hw_id);
|
|
|
|
|
|
ret = sst_hsw_stream_operations(hsw, IPC_STR_PAUSE,
|
|
ret = sst_hsw_stream_operations(hsw, IPC_STR_PAUSE,
|
|
@@ -1535,6 +1555,11 @@ int sst_hsw_stream_resume(struct sst_hsw *hsw, struct sst_hsw_stream *stream,
|
|
{
|
|
{
|
|
int ret;
|
|
int ret;
|
|
|
|
|
|
|
|
+ if (!stream) {
|
|
|
|
+ dev_warn(hsw->dev, "warning: stream is NULL, no stream to resume, ignore it.\n");
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
trace_ipc_request("stream resume", stream->reply.stream_hw_id);
|
|
trace_ipc_request("stream resume", stream->reply.stream_hw_id);
|
|
|
|
|
|
ret = sst_hsw_stream_operations(hsw, IPC_STR_RESUME,
|
|
ret = sst_hsw_stream_operations(hsw, IPC_STR_RESUME,
|
|
@@ -1550,6 +1575,11 @@ int sst_hsw_stream_reset(struct sst_hsw *hsw, struct sst_hsw_stream *stream)
|
|
{
|
|
{
|
|
int ret, tries = 10;
|
|
int ret, tries = 10;
|
|
|
|
|
|
|
|
+ if (!stream) {
|
|
|
|
+ dev_warn(hsw->dev, "warning: stream is NULL, no stream to reset, ignore it.\n");
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+
|
|
/* dont reset streams that are not commited */
|
|
/* dont reset streams that are not commited */
|
|
if (!stream->commited)
|
|
if (!stream->commited)
|
|
return 0;
|
|
return 0;
|