diff mbox

ASoC: wm_adsp: Avoid attempt to free buffers that might still be in use

Message ID 1416221301-27819-1-git-send-email-ckeepax@opensource.wolfsonmicro.com (mailing list archive)
State Accepted
Commit 9da7a5a9fdeeb76b2243f6b473363a7e6147ab6f
Headers show

Commit Message

Charles Keepax Nov. 17, 2014, 10:48 a.m. UTC
We should not free any buffers associated with writing out coefficients
to the DSP until all the async writes have completed. This patch updates
the out of memory path when allocating a new buffer to include a call to
regmap_async_complete.

Reported-by: JS Park <aitdark.park@samsung.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
---
 sound/soc/codecs/wm_adsp.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Comments

Mark Brown Nov. 17, 2014, 2:22 p.m. UTC | #1
On Mon, Nov 17, 2014 at 10:48:21AM +0000, Charles Keepax wrote:
> We should not free any buffers associated with writing out coefficients
> to the DSP until all the async writes have completed. This patch updates
> the out of memory path when allocating a new buffer to include a call to
> regmap_async_complete.

Applied, thanks.
diff mbox

Patch

diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index 0a08ef5e..08d8ec3 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -1343,6 +1343,7 @@  static int wm_adsp_load_coeff(struct wm_adsp *dsp)
 			  file, blocks, pos - firmware->size);
 
 out_fw:
+	regmap_async_complete(regmap);
 	release_firmware(firmware);
 	wm_adsp_buf_free(&buf_list);
 out: