Skip to content

Commit c1be629

Browse files
Srinivas-Kandagatlabroonie
authored andcommitted
ASoC: qcom: q6apm: do not close GPR port before closing graph
Closing GPR port before graph close can result in un handled notifications from DSP, this results in spam of errors from GPR driver as there is no one to handle these notification at that point in time. Fix this by closing GPR port after graph close is finished. Fixes: 5477518 ("ASoC: qdsp6: audioreach: add q6apm support") Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20230705131842.41584-1-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent c03226b commit c1be629

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

sound/soc/qcom/qdsp6/q6apm.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,8 @@ static int graph_callback(struct gpr_resp_pkt *data, void *priv, int op)
511511

512512
switch (hdr->opcode) {
513513
case DATA_CMD_RSP_WR_SH_MEM_EP_DATA_BUFFER_DONE_V2:
514+
if (!graph->ar_graph)
515+
break;
514516
client_event = APM_CLIENT_EVENT_DATA_WRITE_DONE;
515517
mutex_lock(&graph->lock);
516518
token = hdr->token & APM_WRITE_TOKEN_MASK;
@@ -544,6 +546,8 @@ static int graph_callback(struct gpr_resp_pkt *data, void *priv, int op)
544546
wake_up(&graph->cmd_wait);
545547
break;
546548
case DATA_CMD_RSP_RD_SH_MEM_EP_DATA_BUFFER_V2:
549+
if (!graph->ar_graph)
550+
break;
547551
client_event = APM_CLIENT_EVENT_DATA_READ_DONE;
548552
mutex_lock(&graph->lock);
549553
rd_done = data->payload;
@@ -649,8 +653,9 @@ int q6apm_graph_close(struct q6apm_graph *graph)
649653
{
650654
struct audioreach_graph *ar_graph = graph->ar_graph;
651655

652-
gpr_free_port(graph->port);
656+
graph->ar_graph = NULL;
653657
kref_put(&ar_graph->refcount, q6apm_put_audioreach_graph);
658+
gpr_free_port(graph->port);
654659
kfree(graph);
655660

656661
return 0;

0 commit comments

Comments
 (0)