soundwire: stream: only prepare stream when it is configured.
authorBard Liao <yung-chuan.liao@linux.intel.com>
Tue, 14 Jan 2020 23:52:24 +0000 (17:52 -0600)
committerVinod Koul <vkoul@kernel.org>
Thu, 13 Feb 2020 10:27:37 +0000 (15:57 +0530)
commitc32464c9393d0a426b5abbf01980ff5ecfb34a98
treee675a43f7cb4377beb5196f5c999aabf2e77de44
parent59528807715f81f123631f57446b08219efa7526
soundwire: stream: only prepare stream when it is configured.

We don't need to prepare the stream again if the stream is already
prepared.

sdw_prepare_stream() could be called multiple times without calling
sdw_deprepare_stream(). We call sdw_prepare_stream() in the prepare
dai ops and sdw_deprepare_stream() in the hw_free dai ops. If an xrun
happens, sdw_prepare_stream() will be called but
sdw_deprepare_stream() will not, which results in an imbalance and an
invalid total bandwidth.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20200114235227.14502-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/stream.c