msm: eva: fix DSP session deletion racing

The racing to delete DSP session may happen after DSP SSR when
EVA DSP driver just sent session deletion command to CPU driver.

Change-Id: I252000bc2c04148874db02b50d0a94c10edbb6e6
Signed-off-by: George Shen <quic_sqiao@quicinc.com>
This commit is contained in:
George Shen
2022-08-01 14:49:13 -07:00
committed by Gerrit - the friendly Code Review server
parent dcbb74265f
commit e30e31d72b
2 changed files with 27 additions and 2 deletions

View File

@@ -1833,6 +1833,7 @@ int cvp_allocate_dsp_bufs(struct msm_cvp_inst *inst,
goto err_no_mem;
}
buf->smem->pkt_type = buf->smem->buf_idx = 0;
atomic_inc(&buf->smem->refcount);
dprintk(CVP_MEM, "%s dma_buf %pK\n", __func__, buf->smem->dma_buf);
@@ -1875,6 +1876,7 @@ int cvp_release_dsp_buffers(struct msm_cvp_inst *inst,
"%s: %x : fd %x %s size %d",
__func__, hash32_ptr(inst->session), buf->fd,
smem->dma_buf->name, buf->size);
atomic_dec(&smem->refcount);
msm_cvp_smem_free(smem);
kmem_cache_free(cvp_driver->smem_cache, smem);
} else {