linux-stable/drivers/soundwire
Rander Wang bfaa354954 soundwire: stream: don't program ports when a stream that has not been prepared
In the Intel QA multi-pipelines test case, there are two pipelines for
playback and capture on the same bus. The test fails with an error
when setting port params:

[  599.224812] rt711 sdw:0:25d:711:0: invalid dpn_prop direction 1 port_num 0
[  599.224815] sdw_program_slave_port_params failed -22
[  599.224819] intel-sdw sdw-master-0: Program transport params failed: -22
[  599.224822] intel-sdw sdw-master-0: Program params failed: -22
[  599.224828] sdw_enable_stream: SDW0 Pin2-Playback: done

This problem is root-caused to the programming of the capture stream
ports while it is not yet prepared, the calling sequence is:

(1) hw_params for playback. The playback stream provide the port
    information to Bus.
(2) stream_prepare for playback, Transport and port parameters
    are computed for playback.
(3) hw_params for capture. The capture stream provide the port
    information to Bus, but it has not been prepared so is not
    accounted for in the bandwidth allocation.
(4) stream_enable for playback. Program transport and port parameters
    for all masters and slaves. Since the transport and port parameters
    are not computed for capture stream, sdw_program_slave_port_params
    will generate a error when setting port params for capture.

in step (4), we should only program the ports for the stream that have
been prepared. A stream that is only in CONFIGURED state should be
ignored, its ports will be programmed when it becomes PREPARED.

Tested on Comet Lake.

GitHub issue: https://github.com/thesofproject/linux/issues/1637
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Rander Wang <rander.wang@intel.com>
Link: https://lore.kernel.org/r/20200114235227.14502-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2020-02-13 15:57:37 +05:30
..
Kconfig soundwire: qcom: add support for SoundWire controller 2020-01-14 11:57:47 +05:30
Makefile soundwire: qcom: add support for SoundWire controller 2020-01-14 11:57:47 +05:30
bus.c soundwire: bus: fix device number leak on errors 2020-01-14 12:05:52 +05:30
bus.h soundwire: core: add device tree support for slave devices 2019-09-04 13:12:31 +05:30
bus_type.c soundwire: add debugfs support 2019-08-23 12:01:02 +05:30
cadence_master.c soundwire: cadence: fix kernel-doc parameter descriptions 2020-01-16 17:34:38 +05:30
cadence_master.h soundwire: cadence_master: make clock stop exit configurable on init 2019-10-24 17:22:01 +05:30
debugfs.c soundwire: add debugfs support 2019-08-23 12:01:02 +05:30
intel.c soundwire: intel: fix factor of two in MCLK handling 2020-01-14 12:05:52 +05:30
intel.h soundwire: intel: update stream callbacks for hwparams/free stream operations 2019-12-12 09:17:06 +05:30
intel_init.c soundwire: intel: update stream callbacks for hwparams/free stream operations 2019-12-12 09:17:06 +05:30
mipi_disco.c soundwire: mipi_disco: Switch to use fwnode_property_count_uXX() 2019-08-02 17:15:13 +05:30
qcom.c soundwire: qcom: add support for SoundWire controller 2020-01-14 11:57:47 +05:30
slave.c Merge 5.4-rc7 into char-misc-next 2019-11-11 06:24:30 +01:00
stream.c soundwire: stream: don't program ports when a stream that has not been prepared 2020-02-13 15:57:37 +05:30