[1/3] ASoC: codecs: wcd938x: handle deferred probe

Message ID 20240117151208.1219755-1-krzysztof.kozlowski@linaro.org
State New
Headers
Series [1/3] ASoC: codecs: wcd938x: handle deferred probe |

Commit Message

Krzysztof Kozlowski Jan. 17, 2024, 3:12 p.m. UTC
  WCD938x sound codec driver ignores return status of getting regulators
and returns EINVAL instead of EPROBE_DEFER.  If regulator provider
probes after the codec, system is left without probed audio:

  wcd938x_codec audio-codec: wcd938x_probe: Fail to obtain platform data
  wcd938x_codec: probe of audio-codec failed with error -22

Fixes: 16572522aece ("ASoC: codecs: wcd938x-sdw: add SoundWire driver")
Cc: <stable@vger.kernel.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 sound/soc/codecs/wcd938x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Mark Brown Jan. 17, 2024, 3:22 p.m. UTC | #1
On Wed, Jan 17, 2024 at 04:12:06PM +0100, Krzysztof Kozlowski wrote:

>  	if (ret) {
>  		dev_err(dev, "%s: Fail to obtain platform data\n", __func__);
> -		return -EINVAL;
> +		return ret;

Should this be a dev_err_probe() as well?
  
Krzysztof Kozlowski Jan. 17, 2024, 4:59 p.m. UTC | #2
On 17/01/2024 16:22, Mark Brown wrote:
> On Wed, Jan 17, 2024 at 04:12:06PM +0100, Krzysztof Kozlowski wrote:
> 
>>  	if (ret) {
>>  		dev_err(dev, "%s: Fail to obtain platform data\n", __func__);
>> -		return -EINVAL;
>> +		return ret;
> 
> Should this be a dev_err_probe() as well?

It should be just dropped, which I do in the next patch. Errors are
already printed in called wcd938x_populate_dt_data() (with
dev_err_probe). However I decided to split them, as only this one is a
candidate for backport, IMO. Feel free to squash the next (2/3) into
this one.

Best regards,
Krzysztof
  
Mark Brown Jan. 22, 2024, 8:44 p.m. UTC | #3
On Wed, 17 Jan 2024 16:12:06 +0100, Krzysztof Kozlowski wrote:
> WCD938x sound codec driver ignores return status of getting regulators
> and returns EINVAL instead of EPROBE_DEFER.  If regulator provider
> probes after the codec, system is left without probed audio:
> 
>   wcd938x_codec audio-codec: wcd938x_probe: Fail to obtain platform data
>   wcd938x_codec: probe of audio-codec failed with error -22
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/3] ASoC: codecs: wcd938x: handle deferred probe
      commit: 086df711d9b886194481b4fbe525eb43e9ae7403
[2/3] ASoC: codecs: wcd938x: skip printing deferred probe failuers
      commit: 22221b13d0c20a9791dec33121df73fe0b2ac226
[3/3] ASoC: codecs: wcd934x: drop unneeded regulator include
      commit: 35314e39dabcfb256832654ad0e856a9fba744bd

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
  

Patch

diff --git a/sound/soc/codecs/wcd938x.c b/sound/soc/codecs/wcd938x.c
index faf8d3f9b3c5..0aaf494844aa 100644
--- a/sound/soc/codecs/wcd938x.c
+++ b/sound/soc/codecs/wcd938x.c
@@ -3589,7 +3589,7 @@  static int wcd938x_probe(struct platform_device *pdev)
 	ret = wcd938x_populate_dt_data(wcd938x, dev);
 	if (ret) {
 		dev_err(dev, "%s: Fail to obtain platform data\n", __func__);
-		return -EINVAL;
+		return ret;
 	}
 
 	ret = wcd938x_add_slave_components(wcd938x, dev, &match);