soundwire: bus: fix io error when processing alert event
authorRander Wang <rander.wang@intel.com>
Wed, 15 Jan 2020 00:08:42 +0000 (18:08 -0600)
committerVinod Koul <vkoul@kernel.org>
Tue, 25 Feb 2020 10:27:02 +0000 (15:57 +0530)
commitaa79293517b395c6094a382779c911689e8c9a8b
tree18950b9ff25651435abf11a54e9bd241cb52a68f
parentdff70572e9a3a1a01d9dbc2279faa784d95f41b6
soundwire: bus: fix io error when processing alert event

There are two types of io errors when processing alert event.

a) the Master detects an ALERT status for e.g. a jack event and
invokes the implementation-defined function in the Slave driver to
check the jack status. At this time the codec is just suspended, so io
registers can't be accessed.

b) when waking up from clock stop mode1 state, where the bus needs a
complete re-enumeration, Slave registers can't be accessed until the
enumeration is complete.

This patch resumes the Slave device and waits for initialization
complete when processing slave alert event, so that registers on the
Slave can be accessed without timeouts or io errors.

Signed-off-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200115000844.14695-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/bus.c