Re: [alsa-devel] Issue in alsa when dma complete race with pcm release

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/03/2015 10:25 AM, Shengjiu Wang wrote:
Hi alsa-devel

    There maybe a issue in ALSA when dma complete race with snd_pcm_release.
The pcm release and dma complete are in different thread. There is occasion
that dmaengine_pcm_dma_complete() is called too late, some memory has been
freed, the prtd is null. Then there is kernel dump.

    Is there any solution for this issue? Thanks.

We need to introduce a synchronization primitive that allows a dmaengine client to synchronize to the execution of the complete callbacks.

terminate_all() unfortunately can't do this since terminate_all() might be called from within one of the complete callbacks and so would cause a deadlock if we'd wait for all complete callbacks to finish before terminate_all() returns.

So what is needed is a new function called dmaengine_sync() that will wait until all scheduled complete callbacks have finished. A call to this function needs to be put in snd_dmaengine_pcm_close() before the prtd is closed.

- Lars
--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux