public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] ASoC/soundwire: qcom: correctly probe devices after link init
@ 2023-04-20 10:16 Krzysztof Kozlowski
  2023-04-20 10:16 ` [PATCH 1/6] ASoC: wcd938x: switch to using gpiod API Krzysztof Kozlowski
                   ` (5 more replies)
  0 siblings, 6 replies; 27+ messages in thread
From: Krzysztof Kozlowski @ 2023-04-20 10:16 UTC (permalink / raw)
  To: Vinod Koul, Bard Liao, Pierre-Louis Bossart, Sanyog Kale,
	Andy Gross, Bjorn Andersson, Konrad Dybcio, Liam Girdwood,
	Mark Brown, Jaroslav Kysela, Takashi Iwai, alsa-devel,
	linux-kernel, linux-arm-msm
  Cc: Krzysztof Kozlowski, Patrick Lai

Hi,

Dependencies
============
1. ASoC codec: changes are independent, however they should rather come the same
   cycle as Soundwire changes, to avoid new warning and small delay.

2. Soundwire: changes (context) depend on:
   https://lore.kernel.org/r/20230209131336.18252-3-srinivas.kandagatla@linaro.org
   https://lore.kernel.org/all/20230418095447.577001-1-krzysztof.kozlowski@linaro.org/

Problems solved
===============
Soundwire devices are supposed to be kept in reset state (powered off)
till their probe() or component bind() callbacks.  However if they are
already powered on, then they might enumerate before the master
initializes bus in qcom_swrm_init() leading to occasional errors like:

  qcom-soundwire 6d30000.soundwire-controller: Qualcomm Soundwire controller v2.0.0 Registered
  wcd938x_codec audio-codec: bound sdw:0:0217:010d:00:4 (ops wcd938x_sdw_component_ops)
  wcd938x_codec audio-codec: bound sdw:0:0217:010d:00:3 (ops wcd938x_sdw_component_ops)
  qcom-soundwire 6ad0000.soundwire-controller: swrm_wait_for_wr_fifo_avail err write overflow

The problem primarily lies in Qualcomm Soundwire controller probe() sequence:
1. request_threaded_irq()
2. sdw_bus_master_add() - which will cause probe() and component bind()
   of Soundwire devices, e.g. WCD938x codec drivers.  Device drivers
   might already start accessing their registers.
3. qcom_swrm_init() - which initializes the link/bus and enables
   interrupts.

Any access to device registers at (2) above, will fail because link/bus
is not yet initialized.

Cc: Patrick Lai <quic_plai@quicinc.com>

Best regards,
Krzysztof

Dmitry Torokhov (1):
  ASoC: wcd938x: switch to using gpiod API

Krzysztof Kozlowski (5):
  ASoC: codecs: wcd938x: Keep device in reset till bind
  ASoC: codecs: wcd938x: Check for enumeration before using TX device
  soundwire: qcom: drop unused struct qcom_swrm_ctrl members
  soudnwire: master: protect concurrecnt check for bus->md
  soundwire: qcom: do not probe devices before bus/link init

 drivers/soundwire/master.c |  7 ++-
 drivers/soundwire/qcom.c   | 92 +++++++++++++++++++++++++++++---------
 sound/soc/codecs/wcd938x.c | 44 +++++++++++-------
 3 files changed, 107 insertions(+), 36 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2023-05-03 14:12 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-20 10:16 [PATCH 0/6] ASoC/soundwire: qcom: correctly probe devices after link init Krzysztof Kozlowski
2023-04-20 10:16 ` [PATCH 1/6] ASoC: wcd938x: switch to using gpiod API Krzysztof Kozlowski
2023-04-20 11:58   ` Mark Brown
2023-04-20 12:30     ` Krzysztof Kozlowski
2023-04-20 12:32       ` Krzysztof Kozlowski
2023-04-20 13:00       ` Mark Brown
2023-04-20 14:16         ` Krzysztof Kozlowski
2023-04-20 16:28           ` Mark Brown
2023-04-20 17:51             ` Krzysztof Kozlowski
2023-04-20 18:19               ` Mark Brown
2023-04-20 10:16 ` [PATCH 2/6] ASoC: codecs: wcd938x: Keep device in reset till bind Krzysztof Kozlowski
2023-04-20 10:16 ` [PATCH 3/6] ASoC: codecs: wcd938x: Check for enumeration before using TX device Krzysztof Kozlowski
2023-04-20 14:18   ` Pierre-Louis Bossart
2023-04-20 17:19     ` Mark Brown
2023-04-20 17:57     ` Krzysztof Kozlowski
2023-04-20 18:22       ` Mark Brown
2023-04-20 10:16 ` [PATCH 4/6] soundwire: qcom: drop unused struct qcom_swrm_ctrl members Krzysztof Kozlowski
2023-04-20 10:16 ` [PATCH 5/6] soudnwire: master: protect concurrecnt check for bus->md Krzysztof Kozlowski
2023-04-20 16:42   ` Pierre-Louis Bossart
2023-04-20 17:27     ` Krzysztof Kozlowski
2023-04-20 21:13       ` Pierre-Louis Bossart
2023-04-20 10:16 ` [PATCH 6/6] soundwire: qcom: do not probe devices before bus/link init Krzysztof Kozlowski
2023-04-20 21:37   ` Pierre-Louis Bossart
2023-05-01 12:24     ` Krzysztof Kozlowski
2023-05-01 13:43       ` Pierre-Louis Bossart
2023-05-03  8:00         ` Krzysztof Kozlowski
2023-05-03 14:11           ` Pierre-Louis Bossart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox