[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230420101617.142225-1-krzysztof.kozlowski@linaro.org>
Date: Thu, 20 Apr 2023 12:16:11 +0200
From: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
To: Vinod Koul <vkoul@...nel.org>,
Bard Liao <yung-chuan.liao@...ux.intel.com>,
Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>,
Sanyog Kale <sanyog.r.kale@...el.com>,
Andy Gross <agross@...nel.org>,
Bjorn Andersson <andersson@...nel.org>,
Konrad Dybcio <konrad.dybcio@...aro.org>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>, alsa-devel@...a-project.org,
linux-kernel@...r.kernel.org, linux-arm-msm@...r.kernel.org
Cc: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
Patrick Lai <quic_plai@...cinc.com>
Subject: [PATCH 0/6] ASoC/soundwire: qcom: correctly probe devices after link init
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@...cinc.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
Powered by blists - more mailing lists