linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] ASoC: codecs: wcd938x: handle deferred probe
@ 2024-01-17 15:12 Krzysztof Kozlowski
  2024-01-17 15:12 ` [PATCH 2/3] ASoC: codecs: wcd938x: skip printing deferred probe failuers Krzysztof Kozlowski
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2024-01-17 15:12 UTC (permalink / raw)
  To: Srinivas Kandagatla, Banajit Goswami, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, alsa-devel, linux-sound,
	linux-kernel
  Cc: Krzysztof Kozlowski, stable

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(-)

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);
-- 
2.34.1


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

* [PATCH 2/3] ASoC: codecs: wcd938x: skip printing deferred probe failuers
  2024-01-17 15:12 [PATCH 1/3] ASoC: codecs: wcd938x: handle deferred probe Krzysztof Kozlowski
@ 2024-01-17 15:12 ` Krzysztof Kozlowski
  2024-01-17 15:12 ` [PATCH 3/3] ASoC: codecs: wcd934x: drop unneeded regulator include Krzysztof Kozlowski
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2024-01-17 15:12 UTC (permalink / raw)
  To: Srinivas Kandagatla, Banajit Goswami, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, alsa-devel, linux-sound,
	linux-kernel
  Cc: Krzysztof Kozlowski

Probe calls wcd938x_populate_dt_data() which already prints all the
error cases with dev_err_probe(), so skip the additional dev_err().

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 sound/soc/codecs/wcd938x.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

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


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

* [PATCH 3/3] ASoC: codecs: wcd934x: drop unneeded regulator include
  2024-01-17 15:12 [PATCH 1/3] ASoC: codecs: wcd938x: handle deferred probe Krzysztof Kozlowski
  2024-01-17 15:12 ` [PATCH 2/3] ASoC: codecs: wcd938x: skip printing deferred probe failuers Krzysztof Kozlowski
@ 2024-01-17 15:12 ` Krzysztof Kozlowski
  2024-01-17 15:22 ` [PATCH 1/3] ASoC: codecs: wcd938x: handle deferred probe Mark Brown
  2024-01-22 20:44 ` Mark Brown
  3 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2024-01-17 15:12 UTC (permalink / raw)
  To: Srinivas Kandagatla, Banajit Goswami, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, alsa-devel, linux-sound,
	linux-kernel
  Cc: Krzysztof Kozlowski

Driver does not use any regulator code, so drop redundant include of
regulator/consumer.h header.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 sound/soc/codecs/wcd934x.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/soc/codecs/wcd934x.c b/sound/soc/codecs/wcd934x.c
index 1b6e376f3833..6813268e6a19 100644
--- a/sound/soc/codecs/wcd934x.c
+++ b/sound/soc/codecs/wcd934x.c
@@ -13,7 +13,6 @@
 #include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/regmap.h>
-#include <linux/regulator/consumer.h>
 #include <linux/slab.h>
 #include <linux/slimbus.h>
 #include <sound/pcm_params.h>
-- 
2.34.1


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

* Re: [PATCH 1/3] ASoC: codecs: wcd938x: handle deferred probe
  2024-01-17 15:12 [PATCH 1/3] ASoC: codecs: wcd938x: handle deferred probe Krzysztof Kozlowski
  2024-01-17 15:12 ` [PATCH 2/3] ASoC: codecs: wcd938x: skip printing deferred probe failuers Krzysztof Kozlowski
  2024-01-17 15:12 ` [PATCH 3/3] ASoC: codecs: wcd934x: drop unneeded regulator include Krzysztof Kozlowski
@ 2024-01-17 15:22 ` Mark Brown
  2024-01-17 16:59   ` Krzysztof Kozlowski
  2024-01-22 20:44 ` Mark Brown
  3 siblings, 1 reply; 6+ messages in thread
From: Mark Brown @ 2024-01-17 15:22 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Srinivas Kandagatla, Banajit Goswami, Liam Girdwood,
	Jaroslav Kysela, Takashi Iwai, alsa-devel, linux-sound,
	linux-kernel, stable

[-- Attachment #1: Type: text/plain, Size: 233 bytes --]

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?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH 1/3] ASoC: codecs: wcd938x: handle deferred probe
  2024-01-17 15:22 ` [PATCH 1/3] ASoC: codecs: wcd938x: handle deferred probe Mark Brown
@ 2024-01-17 16:59   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2024-01-17 16:59 UTC (permalink / raw)
  To: Mark Brown
  Cc: Srinivas Kandagatla, Banajit Goswami, Liam Girdwood,
	Jaroslav Kysela, Takashi Iwai, alsa-devel, linux-sound,
	linux-kernel, stable

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


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

* Re: [PATCH 1/3] ASoC: codecs: wcd938x: handle deferred probe
  2024-01-17 15:12 [PATCH 1/3] ASoC: codecs: wcd938x: handle deferred probe Krzysztof Kozlowski
                   ` (2 preceding siblings ...)
  2024-01-17 15:22 ` [PATCH 1/3] ASoC: codecs: wcd938x: handle deferred probe Mark Brown
@ 2024-01-22 20:44 ` Mark Brown
  3 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2024-01-22 20:44 UTC (permalink / raw)
  To: Srinivas Kandagatla, Banajit Goswami, Liam Girdwood,
	Jaroslav Kysela, Takashi Iwai, alsa-devel, linux-sound,
	linux-kernel, Krzysztof Kozlowski
  Cc: stable

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


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

end of thread, other threads:[~2024-01-22 20:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-17 15:12 [PATCH 1/3] ASoC: codecs: wcd938x: handle deferred probe Krzysztof Kozlowski
2024-01-17 15:12 ` [PATCH 2/3] ASoC: codecs: wcd938x: skip printing deferred probe failuers Krzysztof Kozlowski
2024-01-17 15:12 ` [PATCH 3/3] ASoC: codecs: wcd934x: drop unneeded regulator include Krzysztof Kozlowski
2024-01-17 15:22 ` [PATCH 1/3] ASoC: codecs: wcd938x: handle deferred probe Mark Brown
2024-01-17 16:59   ` Krzysztof Kozlowski
2024-01-22 20:44 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).