]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: compress: Correct handling of copy callback
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Fri, 26 Jan 2018 13:08:43 +0000 (13:08 +0000)
committerMark Brown <broonie@kernel.org>
Fri, 26 Jan 2018 15:22:52 +0000 (15:22 +0000)
commit97b557616853da8f7e97d9540abef027d9c5a473
tree3002381419f36498d97398aee64a5347acabbc0d
parentfc34a8d7a6e80eb2c2304f3fb1526e012599ae42
ASoC: compress: Correct handling of copy callback

The soc_compr_copy callback is currently broken. Since the
changes to move the compr_ops over to the component the return
value is not correctly propagated, always returning zero on
success rather than the number of bytes copied. This causes
user-space to stall continuously reading as it does not believe
it has received any data.

Furthermore, the changes to move the compr_ops over to the
component iterate through the list of components and will call
the copy callback for any that have compressed ops. There isn't
currently any consensus on the mechanism to combine the results
of multiple copy callbacks.

To fix this issue for now halt searching the component list when
we locate a copy callback and return the result of that single
callback. Additional work should probably be done to look at the
other ops, tidy things up, and work out if we want to support
multiple components on a single compressed, but this is the only
fix required to get things working again.

Fixes: bc73b87542d9 ("ASoC: snd_soc_component_driver has snd_compr_ops")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
sound/soc/soc-compress.c