Loading sound/soc/msm/qdsp6v2/msm-pcm-q6-v2.c +52 −43 Original line number Diff line number Diff line Loading @@ -611,8 +611,10 @@ static int msm_pcm_playback_copy(struct snd_pcm_substream *substream, int a, pr_debug("%s: prtd->out_count = %d\n", __func__, atomic_read(&prtd->out_count)); while (fbytes > 0) { if (prtd->reset_event) { pr_err("%s: In SSR return ENETRESET before wait\n", __func__); pr_err("%s: In SSR return ENETRESET before wait\n", __func__); return -ENETRESET; } Loading @@ -620,11 +622,14 @@ static int msm_pcm_playback_copy(struct snd_pcm_substream *substream, int a, (atomic_read(&prtd->out_count)), 5 * HZ); if (!ret) { pr_err("%s: wait_event_timeout failed\n", __func__); ret = -ETIMEDOUT; goto fail; } ret = 0; if (prtd->reset_event) { pr_err("%s: In SSR return ENETRESET after wait\n", __func__); pr_err("%s: In SSR return ENETRESET after wait\n", __func__); return -ENETRESET; } Loading @@ -633,22 +638,25 @@ static int msm_pcm_playback_copy(struct snd_pcm_substream *substream, int a, return 0; } data = q6asm_is_cpu_buf_avail(IN, prtd->audio_client, &size, &idx); if (size < fbytes) { fbytes = size; } data = q6asm_is_cpu_buf_avail(IN, prtd->audio_client, &size, &idx); if (fbytes > size) xfer = size; else xfer = fbytes; bufptr = data; if (bufptr) { pr_debug("%s:fbytes =%d: xfer=%d size=%d\n", __func__, fbytes, xfer, size); xfer = fbytes; if (copy_from_user(bufptr, buf, xfer)) { ret = -EFAULT; goto fail; } buf += xfer; fbytes -= xfer; pr_debug("%s:fbytes = %d: xfer=%d\n", __func__, fbytes, xfer); pr_debug("%s:fbytes = %d: xfer=%d\n", __func__, fbytes, xfer); if (atomic_read(&prtd->start)) { pr_debug("%s:writing %d bytes of buffer to dsp\n", __func__, xfer); Loading @@ -662,6 +670,7 @@ static int msm_pcm_playback_copy(struct snd_pcm_substream *substream, int a, atomic_inc(&prtd->out_needed); atomic_dec(&prtd->out_count); } } fail: return ret; } Loading Loading
sound/soc/msm/qdsp6v2/msm-pcm-q6-v2.c +52 −43 Original line number Diff line number Diff line Loading @@ -611,8 +611,10 @@ static int msm_pcm_playback_copy(struct snd_pcm_substream *substream, int a, pr_debug("%s: prtd->out_count = %d\n", __func__, atomic_read(&prtd->out_count)); while (fbytes > 0) { if (prtd->reset_event) { pr_err("%s: In SSR return ENETRESET before wait\n", __func__); pr_err("%s: In SSR return ENETRESET before wait\n", __func__); return -ENETRESET; } Loading @@ -620,11 +622,14 @@ static int msm_pcm_playback_copy(struct snd_pcm_substream *substream, int a, (atomic_read(&prtd->out_count)), 5 * HZ); if (!ret) { pr_err("%s: wait_event_timeout failed\n", __func__); ret = -ETIMEDOUT; goto fail; } ret = 0; if (prtd->reset_event) { pr_err("%s: In SSR return ENETRESET after wait\n", __func__); pr_err("%s: In SSR return ENETRESET after wait\n", __func__); return -ENETRESET; } Loading @@ -633,22 +638,25 @@ static int msm_pcm_playback_copy(struct snd_pcm_substream *substream, int a, return 0; } data = q6asm_is_cpu_buf_avail(IN, prtd->audio_client, &size, &idx); if (size < fbytes) { fbytes = size; } data = q6asm_is_cpu_buf_avail(IN, prtd->audio_client, &size, &idx); if (fbytes > size) xfer = size; else xfer = fbytes; bufptr = data; if (bufptr) { pr_debug("%s:fbytes =%d: xfer=%d size=%d\n", __func__, fbytes, xfer, size); xfer = fbytes; if (copy_from_user(bufptr, buf, xfer)) { ret = -EFAULT; goto fail; } buf += xfer; fbytes -= xfer; pr_debug("%s:fbytes = %d: xfer=%d\n", __func__, fbytes, xfer); pr_debug("%s:fbytes = %d: xfer=%d\n", __func__, fbytes, xfer); if (atomic_read(&prtd->start)) { pr_debug("%s:writing %d bytes of buffer to dsp\n", __func__, xfer); Loading @@ -662,6 +670,7 @@ static int msm_pcm_playback_copy(struct snd_pcm_substream *substream, int a, atomic_inc(&prtd->out_needed); atomic_dec(&prtd->out_count); } } fail: return ret; } Loading