Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org, Patrick Lai <quic_plai@quicinc.com>,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Subject: Re: [PATCH v2] ASoC: codecs: wcd938x: fix accessing regmap on unattached devices
Date: Wed, 3 May 2023 10:30:48 -0500	[thread overview]
Message-ID: <d98a8aa1-9e15-7cb4-3bbb-4d4cd437d636@linux.intel.com> (raw)
In-Reply-To: <20230503144102.242240-1-krzysztof.kozlowski@linaro.org>



On 5/3/23 09:41, Krzysztof Kozlowski wrote:
> The WCD938x comes with three devices on two Linux drivers:
> 1. RX Soundwire device (wcd938x-sdw.c driver),
> 2. TX Soundwire device, which is used to access devices via regmap (also
>    wcd938x-sdw.c driver),
> 3. platform device (wcd938x.c driver) - glue and component master,
>    actually having most of the code using TX Soundwire device regmap.
> 
> When RX and TX Soundwire devices probe, the component master (platform
> device) bind tries to write micbias configuration via TX Soundwire
> regmap.  This might happen before TX Soundwire enumerates, so the regmap
> access fails.  On Qualcomm SM8550 board with WCD9385:
> 
>   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
> 
> Fix the issue by:
> 1. Moving the regmap creation from platform device to TX Soundwire
>    device.  The regmap settings are moved as-is with one difference:
>    making the wcd938x_regmap_config const.
> 2. Using regmap in cache only mode till the actual TX Soundwire device
>    enumerates and then sync the regmap cache.
> 
> Cc: <stable@vger.kernel.org> # v3.14+
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> 
> ---
> 
> Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> Cc: Patrick Lai <quic_plai@quicinc.com>
> Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> 
> Changes since v1:
> 1. Previous solution touched Soundwire. Rework it according to feedback.
>    https://lore.kernel.org/all/20230420101617.142225-7-krzysztof.kozlowski@linaro.org/
> 
> Thank you Mark and Pierre-Louis for great hints and valuable feedback!

LGTM, this was a very interesting thread to comment on.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

  reply	other threads:[~2023-05-03 16:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-03 14:41 [PATCH v2] ASoC: codecs: wcd938x: fix accessing regmap on unattached devices Krzysztof Kozlowski
2023-05-03 15:30 ` Pierre-Louis Bossart [this message]
2023-05-04  4:10 ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d98a8aa1-9e15-7cb4-3bbb-4d4cd437d636@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=quic_plai@quicinc.com \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=stable@vger.kernel.org \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox