All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: wcd-mbhc-v2: Revert "ASoC: wcd-mbhc-v2: use pm_runtime_resume_and_get()"
@ 2022-09-29 13:15 Krzysztof Kozlowski
  2022-09-29 13:41   ` Mark Brown
  2022-09-29 15:16   ` Mark Brown
  0 siblings, 2 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-29 13:15 UTC (permalink / raw)
  To: Srinivas Kandagatla, Banajit Goswami, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Kai Vehmanen, Ranjani Sridharan,
	Cezary Rojewski, alsa-devel, linux-kernel
  Cc: Krzysztof Kozlowski, Bard Liao, Pierre-Louis Bossart, stable

This reverts commit ddea4bbf287b6028eaa15a185d0693856956ecf2 ("ASoC:
wcd-mbhc-v2: use pm_runtime_resume_and_get()"), because it introduced
double runtime PM put if pm_runtime_get_sync() returns -EACCES:

  wcd934x-codec wcd934x-codec.3.auto: WCD934X Minor:0x1 Version:0x401
  wcd934x-codec wcd934x-codec.3.auto: Runtime PM usage count underflow!

The commit claimed no changes in functionality except dropping the
reference on -EACCESS.  This is exactly the change introducing bug
because function calls unconditionally pm_runtime_put_autosuspend() at
the end.

Cc: Bard Liao <yung-chuan.liao@linux.intel.com>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Cc: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Cezary Rojewski <cezary.rojewski@intel.com>
Cc: <stable@vger.kernel.org>
Fixes: ddea4bbf287b ("ASoC: wcd-mbhc-v2: use pm_runtime_resume_and_get()")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 sound/soc/codecs/wcd-mbhc-v2.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/sound/soc/codecs/wcd-mbhc-v2.c b/sound/soc/codecs/wcd-mbhc-v2.c
index b16a18dbfe7a..1911750f7445 100644
--- a/sound/soc/codecs/wcd-mbhc-v2.c
+++ b/sound/soc/codecs/wcd-mbhc-v2.c
@@ -714,11 +714,12 @@ static int wcd_mbhc_initialise(struct wcd_mbhc *mbhc)
 	struct snd_soc_component *component = mbhc->component;
 	int ret;
 
-	ret = pm_runtime_resume_and_get(component->dev);
+	ret = pm_runtime_get_sync(component->dev);
 	if (ret < 0 && ret != -EACCES) {
 		dev_err_ratelimited(component->dev,
-				    "pm_runtime_resume_and_get failed in %s, ret %d\n",
+				    "pm_runtime_get_sync failed in %s, ret %d\n",
 				    __func__, ret);
+		pm_runtime_put_noidle(component->dev);
 		return ret;
 	}
 
@@ -1096,11 +1097,12 @@ static void wcd_correct_swch_plug(struct work_struct *work)
 	mbhc = container_of(work, struct wcd_mbhc, correct_plug_swch);
 	component = mbhc->component;
 
-	ret = pm_runtime_resume_and_get(component->dev);
+	ret = pm_runtime_get_sync(component->dev);
 	if (ret < 0 && ret != -EACCES) {
 		dev_err_ratelimited(component->dev,
-				    "pm_runtime_resume_and_get failed in %s, ret %d\n",
+				    "pm_runtime_get_sync failed in %s, ret %d\n",
 				    __func__, ret);
+		pm_runtime_put_noidle(component->dev);
 		return;
 	}
 	micbias_mv = wcd_mbhc_get_micbias(mbhc);
-- 
2.34.1


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

* Re: [PATCH] ASoC: wcd-mbhc-v2: Revert "ASoC: wcd-mbhc-v2: use pm_runtime_resume_and_get()"
  2022-09-29 13:15 [PATCH] ASoC: wcd-mbhc-v2: Revert "ASoC: wcd-mbhc-v2: use pm_runtime_resume_and_get()" Krzysztof Kozlowski
@ 2022-09-29 13:41   ` Mark Brown
  2022-09-29 15:16   ` Mark Brown
  1 sibling, 0 replies; 9+ messages in thread
From: Mark Brown @ 2022-09-29 13:41 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Srinivas Kandagatla, Banajit Goswami, Liam Girdwood,
	Jaroslav Kysela, Takashi Iwai, Kai Vehmanen, Ranjani Sridharan,
	Cezary Rojewski, alsa-devel, linux-kernel, Bard Liao,
	Pierre-Louis Bossart, stable

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

On Thu, Sep 29, 2022 at 03:15:28PM +0200, Krzysztof Kozlowski wrote:

> Cc: <stable@vger.kernel.org>
> Fixes: ddea4bbf287b ("ASoC: wcd-mbhc-v2: use pm_runtime_resume_and_get()")

That commit isn't in a released kernel.

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

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

* Re: [PATCH] ASoC: wcd-mbhc-v2: Revert "ASoC: wcd-mbhc-v2: use pm_runtime_resume_and_get()"
@ 2022-09-29 13:41   ` Mark Brown
  0 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2022-09-29 13:41 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: alsa-devel, Pierre-Louis Bossart, Cezary Rojewski, Kai Vehmanen,
	linux-kernel, Takashi Iwai, stable, Liam Girdwood,
	Srinivas Kandagatla, Ranjani Sridharan, Banajit Goswami,
	Bard Liao

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

On Thu, Sep 29, 2022 at 03:15:28PM +0200, Krzysztof Kozlowski wrote:

> Cc: <stable@vger.kernel.org>
> Fixes: ddea4bbf287b ("ASoC: wcd-mbhc-v2: use pm_runtime_resume_and_get()")

That commit isn't in a released kernel.

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

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

* Re: [PATCH] ASoC: wcd-mbhc-v2: Revert "ASoC: wcd-mbhc-v2: use pm_runtime_resume_and_get()"
  2022-09-29 13:41   ` Mark Brown
@ 2022-09-29 14:00     ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-29 14:00 UTC (permalink / raw)
  To: Mark Brown
  Cc: Srinivas Kandagatla, Banajit Goswami, Liam Girdwood,
	Jaroslav Kysela, Takashi Iwai, Kai Vehmanen, Ranjani Sridharan,
	Cezary Rojewski, alsa-devel, linux-kernel, Bard Liao,
	Pierre-Louis Bossart, stable

On 29/09/2022 15:41, Mark Brown wrote:
> On Thu, Sep 29, 2022 at 03:15:28PM +0200, Krzysztof Kozlowski wrote:
> 
>> Cc: <stable@vger.kernel.org>
>> Fixes: ddea4bbf287b ("ASoC: wcd-mbhc-v2: use pm_runtime_resume_and_get()")
> 
> That commit isn't in a released kernel.

Oh, indeed, thanks. I'll send a v2 without it.

Best regards,
Krzysztof


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

* Re: [PATCH] ASoC: wcd-mbhc-v2: Revert "ASoC: wcd-mbhc-v2: use pm_runtime_resume_and_get()"
@ 2022-09-29 14:00     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-29 14:00 UTC (permalink / raw)
  To: Mark Brown
  Cc: alsa-devel, Pierre-Louis Bossart, Cezary Rojewski, Kai Vehmanen,
	linux-kernel, Takashi Iwai, stable, Liam Girdwood,
	Srinivas Kandagatla, Ranjani Sridharan, Banajit Goswami,
	Bard Liao

On 29/09/2022 15:41, Mark Brown wrote:
> On Thu, Sep 29, 2022 at 03:15:28PM +0200, Krzysztof Kozlowski wrote:
> 
>> Cc: <stable@vger.kernel.org>
>> Fixes: ddea4bbf287b ("ASoC: wcd-mbhc-v2: use pm_runtime_resume_and_get()")
> 
> That commit isn't in a released kernel.

Oh, indeed, thanks. I'll send a v2 without it.

Best regards,
Krzysztof


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

* Re: [PATCH] ASoC: wcd-mbhc-v2: Revert "ASoC: wcd-mbhc-v2: use pm_runtime_resume_and_get()"
  2022-09-29 14:00     ` Krzysztof Kozlowski
@ 2022-09-29 14:01       ` Mark Brown
  -1 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2022-09-29 14:01 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Srinivas Kandagatla, Banajit Goswami, Liam Girdwood,
	Jaroslav Kysela, Takashi Iwai, Kai Vehmanen, Ranjani Sridharan,
	Cezary Rojewski, alsa-devel, linux-kernel, Bard Liao,
	Pierre-Louis Bossart, stable

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

On Thu, Sep 29, 2022 at 04:00:26PM +0200, Krzysztof Kozlowski wrote:
> On 29/09/2022 15:41, Mark Brown wrote:
> > On Thu, Sep 29, 2022 at 03:15:28PM +0200, Krzysztof Kozlowski wrote:
> > 
> >> Cc: <stable@vger.kernel.org>
> >> Fixes: ddea4bbf287b ("ASoC: wcd-mbhc-v2: use pm_runtime_resume_and_get()")
> > 
> > That commit isn't in a released kernel.
> 
> Oh, indeed, thanks. I'll send a v2 without it.

It's fine.

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

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

* Re: [PATCH] ASoC: wcd-mbhc-v2: Revert "ASoC: wcd-mbhc-v2: use pm_runtime_resume_and_get()"
@ 2022-09-29 14:01       ` Mark Brown
  0 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2022-09-29 14:01 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: alsa-devel, Pierre-Louis Bossart, Cezary Rojewski, Kai Vehmanen,
	linux-kernel, Takashi Iwai, stable, Liam Girdwood,
	Srinivas Kandagatla, Ranjani Sridharan, Banajit Goswami,
	Bard Liao

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

On Thu, Sep 29, 2022 at 04:00:26PM +0200, Krzysztof Kozlowski wrote:
> On 29/09/2022 15:41, Mark Brown wrote:
> > On Thu, Sep 29, 2022 at 03:15:28PM +0200, Krzysztof Kozlowski wrote:
> > 
> >> Cc: <stable@vger.kernel.org>
> >> Fixes: ddea4bbf287b ("ASoC: wcd-mbhc-v2: use pm_runtime_resume_and_get()")
> > 
> > That commit isn't in a released kernel.
> 
> Oh, indeed, thanks. I'll send a v2 without it.

It's fine.

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

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

* Re: [PATCH] ASoC: wcd-mbhc-v2: Revert "ASoC: wcd-mbhc-v2: use pm_runtime_resume_and_get()"
  2022-09-29 13:15 [PATCH] ASoC: wcd-mbhc-v2: Revert "ASoC: wcd-mbhc-v2: use pm_runtime_resume_and_get()" Krzysztof Kozlowski
@ 2022-09-29 15:16   ` Mark Brown
  2022-09-29 15:16   ` Mark Brown
  1 sibling, 0 replies; 9+ messages in thread
From: Mark Brown @ 2022-09-29 15:16 UTC (permalink / raw)
  To: Banajit Goswami, Srinivas Kandagatla, Krzysztof Kozlowski,
	Takashi Iwai, Ranjani Sridharan, Cezary Rojewski,
	Jaroslav Kysela, alsa-devel, linux-kernel, Kai Vehmanen,
	Liam Girdwood
  Cc: Bard Liao, stable, Pierre-Louis Bossart

On Thu, 29 Sep 2022 15:15:28 +0200, Krzysztof Kozlowski wrote:
> This reverts commit ddea4bbf287b6028eaa15a185d0693856956ecf2 ("ASoC:
> wcd-mbhc-v2: use pm_runtime_resume_and_get()"), because it introduced
> double runtime PM put if pm_runtime_get_sync() returns -EACCES:
> 
>   wcd934x-codec wcd934x-codec.3.auto: WCD934X Minor:0x1 Version:0x401
>   wcd934x-codec wcd934x-codec.3.auto: Runtime PM usage count underflow!
> 
> [...]

Applied to

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

Thanks!

[1/1] ASoC: wcd-mbhc-v2: Revert "ASoC: wcd-mbhc-v2: use pm_runtime_resume_and_get()"
      commit: e18f6bcf8e864ea0e9690691d0d749c662b6a2c7

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] 9+ messages in thread

* Re: [PATCH] ASoC: wcd-mbhc-v2: Revert "ASoC: wcd-mbhc-v2: use pm_runtime_resume_and_get()"
@ 2022-09-29 15:16   ` Mark Brown
  0 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2022-09-29 15:16 UTC (permalink / raw)
  To: Banajit Goswami, Srinivas Kandagatla, Krzysztof Kozlowski,
	Takashi Iwai, Ranjani Sridharan, Cezary Rojewski,
	Jaroslav Kysela, alsa-devel, linux-kernel, Kai Vehmanen,
	Liam Girdwood
  Cc: Bard Liao, Pierre-Louis Bossart, stable

On Thu, 29 Sep 2022 15:15:28 +0200, Krzysztof Kozlowski wrote:
> This reverts commit ddea4bbf287b6028eaa15a185d0693856956ecf2 ("ASoC:
> wcd-mbhc-v2: use pm_runtime_resume_and_get()"), because it introduced
> double runtime PM put if pm_runtime_get_sync() returns -EACCES:
> 
>   wcd934x-codec wcd934x-codec.3.auto: WCD934X Minor:0x1 Version:0x401
>   wcd934x-codec wcd934x-codec.3.auto: Runtime PM usage count underflow!
> 
> [...]

Applied to

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

Thanks!

[1/1] ASoC: wcd-mbhc-v2: Revert "ASoC: wcd-mbhc-v2: use pm_runtime_resume_and_get()"
      commit: e18f6bcf8e864ea0e9690691d0d749c662b6a2c7

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] 9+ messages in thread

end of thread, other threads:[~2022-09-29 15:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-29 13:15 [PATCH] ASoC: wcd-mbhc-v2: Revert "ASoC: wcd-mbhc-v2: use pm_runtime_resume_and_get()" Krzysztof Kozlowski
2022-09-29 13:41 ` Mark Brown
2022-09-29 13:41   ` Mark Brown
2022-09-29 14:00   ` Krzysztof Kozlowski
2022-09-29 14:00     ` Krzysztof Kozlowski
2022-09-29 14:01     ` Mark Brown
2022-09-29 14:01       ` Mark Brown
2022-09-29 15:16 ` Mark Brown
2022-09-29 15:16   ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.