soundwire: intel: Initialize clock stop timeout
authorSjoerd Simons <sjoerd@collabora.com>
Thu, 20 Oct 2022 01:56:24 +0000 (09:56 +0800)
committerVinod Koul <vkoul@kernel.org>
Fri, 28 Oct 2022 11:27:32 +0000 (16:57 +0530)
commit13c30a755847c7e804e1bf755e66e3ff7b7f9367
tree2a701221086d2c8bba3f72653a277d943099b357
parent9abf2313adc1ca1b6180c508c25f22f9395cc780
soundwire: intel: Initialize clock stop timeout

The bus->clk_stop_timeout member is only initialized to a non-zero value
during the codec driver probe. This can lead to corner cases where this
value remains pegged at zero when the bus suspends, which results in an
endless loop in sdw_bus_wait_for_clk_prep_deprep().

Corner cases include configurations with no codecs described in the
firmware, or delays in probing codec drivers.

Initializing the default timeout to the smallest non-zero value avoid this
problem and allows for the existing logic to be preserved: the
bus->clk_stop_timeout is set as the maximum required by all codecs
connected on the bus.

Fixes: 1f2dcf3a154ac ("soundwire: intel: set dev_num_ida_min")
Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Chao Song <chao.song@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20221020015624.1703950-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/intel.c