ALSA: compress: fix drain calls blocking other compress functions (v6)
authorVinod Koul <vinod.koul@intel.com>
Thu, 7 Nov 2013 09:08:22 +0000 (10:08 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Nov 2013 19:11:45 +0000 (11:11 -0800)
commit86e6de789cfeb2bb6c532281e16a478d797f3598
treee3e3b4294e97635015a0863099a889cfb78356e3
parent16442d4ff3014c84008266feee1e36befd84c8c3
ALSA: compress: fix drain calls blocking other compress functions (v6)

commit f44f2a5417b2968a8724b352cc0b2545a6bcb1f4 upstream.

The drain and drain_notify callback were blocked by low level driver
until the draining was complete. Due to this being invoked with big
fat mutex held, others ops like reading timestamp, calling pause, drop
were blocked.

So to fix this we add a new snd_compr_drain_notify() API. This would
be required to be invoked by low level driver when drain or partial
drain has been completed by the DSP. Thus we make the drain and
partial_drain callback as non blocking and driver returns immediately
after notifying DSP.  The waiting is done while releasing the lock so
that other ops can go ahead.

[ The commit 917f4b5cba78 was wrongly applied from the preliminary
  patch.  This commit corrects to the final version.
  Sorry for inconvenience!  -- tiwai ]

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/sound/compress_driver.h
sound/core/compress_offload.c