linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] Suspend related fixes on Tegra
@ 2021-11-23 14:07 Sameer Pujar
  2021-11-23 14:07 ` [PATCH 1/6] ASoC: tegra: Balance runtime PM count Sameer Pujar
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Sameer Pujar @ 2021-11-23 14:07 UTC (permalink / raw)
  To: broonie, lgirdwood, perex, tiwai
  Cc: thierry.reding, jonathanh, alsa-devel, linux-tegra, linux-kernel,
	Sameer Pujar

This series addresses following problems:
 * The runtime PM is not balanced in MVC driver, whenever
   mute or volume mixer controls are set.
 * Some of the AHUB devices (SFC, MVC, Mixer, AMX and ADX)
   use late system sleep. Suspend failure is seen on Jetson
   TX2 platform.

Sameer Pujar (6):
  ASoC: tegra: Balance runtime PM count
  ASoC: tegra: Use normal system sleep for SFC
  ASoC: tegra: Use normal system sleep for MVC
  ASoC: tegra: Use normal system sleep for Mixer
  ASoC: tegra: Use normal system sleep for AMX
  ASoC: tegra: Use normal system sleep for ADX

 sound/soc/tegra/tegra210_adx.c   | 4 ++--
 sound/soc/tegra/tegra210_amx.c   | 4 ++--
 sound/soc/tegra/tegra210_mixer.c | 4 ++--
 sound/soc/tegra/tegra210_mvc.c   | 8 ++++----
 sound/soc/tegra/tegra210_sfc.c   | 4 ++--
 5 files changed, 12 insertions(+), 12 deletions(-)

-- 
2.7.4


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

* [PATCH 1/6] ASoC: tegra: Balance runtime PM count
  2021-11-23 14:07 [PATCH 0/6] Suspend related fixes on Tegra Sameer Pujar
@ 2021-11-23 14:07 ` Sameer Pujar
  2021-11-23 14:07 ` [PATCH 2/6] ASoC: tegra: Use normal system sleep for SFC Sameer Pujar
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Sameer Pujar @ 2021-11-23 14:07 UTC (permalink / raw)
  To: broonie, lgirdwood, perex, tiwai
  Cc: thierry.reding, jonathanh, alsa-devel, linux-tegra, linux-kernel,
	Sameer Pujar, stable

After successful application of volume/mute settings via mixer control
put calls, the control returns without balancing the runtime PM count.
This makes device to be always runtime active. Fix this by allowing
control to reach pm_runtime_put() call.

Fixes: e539891f9687 ("ASoC: tegra: Add Tegra210 based MVC driver")
Cc: stable@vger.kernel.org
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
---
 sound/soc/tegra/tegra210_mvc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/tegra/tegra210_mvc.c b/sound/soc/tegra/tegra210_mvc.c
index ae00570..c9859e1 100644
--- a/sound/soc/tegra/tegra210_mvc.c
+++ b/sound/soc/tegra/tegra210_mvc.c
@@ -164,7 +164,7 @@ static int tegra210_mvc_put_mute(struct snd_kcontrol *kcontrol,
 	if (err < 0)
 		goto end;
 
-	return 1;
+	err = 1;
 
 end:
 	pm_runtime_put(cmpnt->dev);
@@ -236,7 +236,7 @@ static int tegra210_mvc_put_vol(struct snd_kcontrol *kcontrol,
 			   TEGRA210_MVC_VOLUME_SWITCH_MASK,
 			   TEGRA210_MVC_VOLUME_SWITCH_TRIGGER);
 
-	return 1;
+	err = 1;
 
 end:
 	pm_runtime_put(cmpnt->dev);
-- 
2.7.4


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

* [PATCH 2/6] ASoC: tegra: Use normal system sleep for SFC
  2021-11-23 14:07 [PATCH 0/6] Suspend related fixes on Tegra Sameer Pujar
  2021-11-23 14:07 ` [PATCH 1/6] ASoC: tegra: Balance runtime PM count Sameer Pujar
@ 2021-11-23 14:07 ` Sameer Pujar
  2021-11-23 14:07 ` [PATCH 3/6] ASoC: tegra: Use normal system sleep for MVC Sameer Pujar
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Sameer Pujar @ 2021-11-23 14:07 UTC (permalink / raw)
  To: broonie, lgirdwood, perex, tiwai
  Cc: thierry.reding, jonathanh, alsa-devel, linux-tegra, linux-kernel,
	Sameer Pujar, stable

The driver currently subscribes for a late system sleep call.
The initcall_debug log shows that suspend call for SFC device
happens after the parent device (AHUB). This seems to cause
suspend failure on Jetson TX2 platform. Also there is no use
of having late system sleep specifically for SFC device. Fix
the order by using normal system sleep.

Fixes: b2f74ec53a6c ("ASoC: tegra: Add Tegra210 based SFC driver")
Cc: stable@vger.kernel.org
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
---
 sound/soc/tegra/tegra210_sfc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/tegra/tegra210_sfc.c b/sound/soc/tegra/tegra210_sfc.c
index 955cecd..af33bf2 100644
--- a/sound/soc/tegra/tegra210_sfc.c
+++ b/sound/soc/tegra/tegra210_sfc.c
@@ -3602,8 +3602,8 @@ static int tegra210_sfc_platform_remove(struct platform_device *pdev)
 static const struct dev_pm_ops tegra210_sfc_pm_ops = {
 	SET_RUNTIME_PM_OPS(tegra210_sfc_runtime_suspend,
 			   tegra210_sfc_runtime_resume, NULL)
-	SET_LATE_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
-				     pm_runtime_force_resume)
+	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
+				pm_runtime_force_resume)
 };
 
 static struct platform_driver tegra210_sfc_driver = {
-- 
2.7.4


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

* [PATCH 3/6] ASoC: tegra: Use normal system sleep for MVC
  2021-11-23 14:07 [PATCH 0/6] Suspend related fixes on Tegra Sameer Pujar
  2021-11-23 14:07 ` [PATCH 1/6] ASoC: tegra: Balance runtime PM count Sameer Pujar
  2021-11-23 14:07 ` [PATCH 2/6] ASoC: tegra: Use normal system sleep for SFC Sameer Pujar
@ 2021-11-23 14:07 ` Sameer Pujar
  2021-11-23 14:07 ` [PATCH 4/6] ASoC: tegra: Use normal system sleep for Mixer Sameer Pujar
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Sameer Pujar @ 2021-11-23 14:07 UTC (permalink / raw)
  To: broonie, lgirdwood, perex, tiwai
  Cc: thierry.reding, jonathanh, alsa-devel, linux-tegra, linux-kernel,
	Sameer Pujar, stable

The driver currently subscribes for a late system sleep call.
The initcall_debug log shows that suspend call for MVC device
happens after the parent device (AHUB). This seems to cause
suspend failure on Jetson TX2 platform. Also there is no use
of having late system sleep specifically for MVC device. Fix
the order by using normal system sleep.

Fixes: e539891f9687 ("ASoC: tegra: Add Tegra210 based MVC driver")
Cc: stable@vger.kernel.org
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
---
 sound/soc/tegra/tegra210_mvc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/tegra/tegra210_mvc.c b/sound/soc/tegra/tegra210_mvc.c
index c9859e1..93cbeb6 100644
--- a/sound/soc/tegra/tegra210_mvc.c
+++ b/sound/soc/tegra/tegra210_mvc.c
@@ -641,8 +641,8 @@ static int tegra210_mvc_platform_remove(struct platform_device *pdev)
 static const struct dev_pm_ops tegra210_mvc_pm_ops = {
 	SET_RUNTIME_PM_OPS(tegra210_mvc_runtime_suspend,
 			   tegra210_mvc_runtime_resume, NULL)
-	SET_LATE_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
-				     pm_runtime_force_resume)
+	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
+				pm_runtime_force_resume)
 };
 
 static struct platform_driver tegra210_mvc_driver = {
-- 
2.7.4


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

* [PATCH 4/6] ASoC: tegra: Use normal system sleep for Mixer
  2021-11-23 14:07 [PATCH 0/6] Suspend related fixes on Tegra Sameer Pujar
                   ` (2 preceding siblings ...)
  2021-11-23 14:07 ` [PATCH 3/6] ASoC: tegra: Use normal system sleep for MVC Sameer Pujar
@ 2021-11-23 14:07 ` Sameer Pujar
  2021-11-23 14:07 ` [PATCH 5/6] ASoC: tegra: Use normal system sleep for AMX Sameer Pujar
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Sameer Pujar @ 2021-11-23 14:07 UTC (permalink / raw)
  To: broonie, lgirdwood, perex, tiwai
  Cc: thierry.reding, jonathanh, alsa-devel, linux-tegra, linux-kernel,
	Sameer Pujar, stable

The driver currently subscribes for a late system sleep call.
The initcall_debug log shows that suspend call for Mixer device
happens after the parent device (AHUB). This seems to cause
suspend failure on Jetson TX2 platform. Also there is no use
of having late system sleep specifically for Mixer device. Fix
the order by using normal system sleep.

Fixes: 05bb3d5ec64a ("ASoC: tegra: Add Tegra210 based Mixer driver")
Cc: stable@vger.kernel.org
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
---
 sound/soc/tegra/tegra210_mixer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/tegra/tegra210_mixer.c b/sound/soc/tegra/tegra210_mixer.c
index 6fb041c..9513034 100644
--- a/sound/soc/tegra/tegra210_mixer.c
+++ b/sound/soc/tegra/tegra210_mixer.c
@@ -670,8 +670,8 @@ static int tegra210_mixer_platform_remove(struct platform_device *pdev)
 static const struct dev_pm_ops tegra210_mixer_pm_ops = {
 	SET_RUNTIME_PM_OPS(tegra210_mixer_runtime_suspend,
 			   tegra210_mixer_runtime_resume, NULL)
-	SET_LATE_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
-				     pm_runtime_force_resume)
+	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
+				pm_runtime_force_resume)
 };
 
 static struct platform_driver tegra210_mixer_driver = {
-- 
2.7.4


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

* [PATCH 5/6] ASoC: tegra: Use normal system sleep for AMX
  2021-11-23 14:07 [PATCH 0/6] Suspend related fixes on Tegra Sameer Pujar
                   ` (3 preceding siblings ...)
  2021-11-23 14:07 ` [PATCH 4/6] ASoC: tegra: Use normal system sleep for Mixer Sameer Pujar
@ 2021-11-23 14:07 ` Sameer Pujar
  2021-11-23 14:07 ` [PATCH 6/6] ASoC: tegra: Use normal system sleep for ADX Sameer Pujar
  2021-11-27  1:29 ` [PATCH 0/6] Suspend related fixes on Tegra Mark Brown
  6 siblings, 0 replies; 8+ messages in thread
From: Sameer Pujar @ 2021-11-23 14:07 UTC (permalink / raw)
  To: broonie, lgirdwood, perex, tiwai
  Cc: thierry.reding, jonathanh, alsa-devel, linux-tegra, linux-kernel,
	Sameer Pujar, stable

The driver currently subscribes for a late system sleep call.
The initcall_debug log shows that suspend call for AMX device
happens after the parent device (AHUB). This seems to cause
suspend failure on Jetson TX2 platform. Also there is no use
of having late system sleep specifically for AMX device. Fix
the order by using normal system sleep.

Fixes: 77f7df346c45 ("ASoC: tegra: Add Tegra210 based AMX driver")
Cc: stable@vger.kernel.org
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
---
 sound/soc/tegra/tegra210_amx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/tegra/tegra210_amx.c b/sound/soc/tegra/tegra210_amx.c
index 86ad550..a10d616 100644
--- a/sound/soc/tegra/tegra210_amx.c
+++ b/sound/soc/tegra/tegra210_amx.c
@@ -587,8 +587,8 @@ static int tegra210_amx_platform_remove(struct platform_device *pdev)
 static const struct dev_pm_ops tegra210_amx_pm_ops = {
 	SET_RUNTIME_PM_OPS(tegra210_amx_runtime_suspend,
 			   tegra210_amx_runtime_resume, NULL)
-	SET_LATE_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
-				     pm_runtime_force_resume)
+	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
+				pm_runtime_force_resume)
 };
 
 static struct platform_driver tegra210_amx_driver = {
-- 
2.7.4


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

* [PATCH 6/6] ASoC: tegra: Use normal system sleep for ADX
  2021-11-23 14:07 [PATCH 0/6] Suspend related fixes on Tegra Sameer Pujar
                   ` (4 preceding siblings ...)
  2021-11-23 14:07 ` [PATCH 5/6] ASoC: tegra: Use normal system sleep for AMX Sameer Pujar
@ 2021-11-23 14:07 ` Sameer Pujar
  2021-11-27  1:29 ` [PATCH 0/6] Suspend related fixes on Tegra Mark Brown
  6 siblings, 0 replies; 8+ messages in thread
From: Sameer Pujar @ 2021-11-23 14:07 UTC (permalink / raw)
  To: broonie, lgirdwood, perex, tiwai
  Cc: thierry.reding, jonathanh, alsa-devel, linux-tegra, linux-kernel,
	Sameer Pujar, stable

The driver currently subscribes for a late system sleep call.
The initcall_debug log shows that suspend call for ADX device
happens after the parent device (AHUB). This seems to cause
suspend failure on Jetson TX2 platform. Also there is no use
of having late system sleep specifically for ADX device. Fix
the order by using normal system sleep.

Fixes: a99ab6f395a9 ("ASoC: tegra: Add Tegra210 based ADX driver")
Cc: stable@vger.kernel.org
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
---
 sound/soc/tegra/tegra210_adx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/tegra/tegra210_adx.c b/sound/soc/tegra/tegra210_adx.c
index 035e24e..69fabf9 100644
--- a/sound/soc/tegra/tegra210_adx.c
+++ b/sound/soc/tegra/tegra210_adx.c
@@ -518,8 +518,8 @@ static int tegra210_adx_platform_remove(struct platform_device *pdev)
 static const struct dev_pm_ops tegra210_adx_pm_ops = {
 	SET_RUNTIME_PM_OPS(tegra210_adx_runtime_suspend,
 			   tegra210_adx_runtime_resume, NULL)
-	SET_LATE_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
-				     pm_runtime_force_resume)
+	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
+				pm_runtime_force_resume)
 };
 
 static struct platform_driver tegra210_adx_driver = {
-- 
2.7.4


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

* Re: [PATCH 0/6] Suspend related fixes on Tegra
  2021-11-23 14:07 [PATCH 0/6] Suspend related fixes on Tegra Sameer Pujar
                   ` (5 preceding siblings ...)
  2021-11-23 14:07 ` [PATCH 6/6] ASoC: tegra: Use normal system sleep for ADX Sameer Pujar
@ 2021-11-27  1:29 ` Mark Brown
  6 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2021-11-27  1:29 UTC (permalink / raw)
  To: tiwai, lgirdwood, Sameer Pujar, perex
  Cc: jonathanh, thierry.reding, linux-kernel, alsa-devel, linux-tegra

On Tue, 23 Nov 2021 19:37:33 +0530, Sameer Pujar wrote:
> This series addresses following problems:
>  * The runtime PM is not balanced in MVC driver, whenever
>    mute or volume mixer controls are set.
>  * Some of the AHUB devices (SFC, MVC, Mixer, AMX and ADX)
>    use late system sleep. Suspend failure is seen on Jetson
>    TX2 platform.
> 
> [...]

Applied to

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

Thanks!

[1/6] ASoC: tegra: Balance runtime PM count
      commit: 70408f755f589f67957b9ec6852e6b01f858d0a2
[2/6] ASoC: tegra: Use normal system sleep for SFC
      commit: af120d07bbb0721708b10204beed66ed2cb0cb62
[3/6] ASoC: tegra: Use normal system sleep for MVC
      commit: c83d263a89f30d1c0274827c475f3583cf8e477f
[4/6] ASoC: tegra: Use normal system sleep for Mixer
      commit: b78400e41653b3a752a4cd17d2fcbd4a96bb4bc2
[5/6] ASoC: tegra: Use normal system sleep for AMX
      commit: 638c31d542a576714a52bb6a9a7dedff98e32a1d
[6/6] ASoC: tegra: Use normal system sleep for ADX
      commit: cf36de4fc5ce5502ce5070a793addd9d49df4113

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

end of thread, other threads:[~2021-11-27  2:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-23 14:07 [PATCH 0/6] Suspend related fixes on Tegra Sameer Pujar
2021-11-23 14:07 ` [PATCH 1/6] ASoC: tegra: Balance runtime PM count Sameer Pujar
2021-11-23 14:07 ` [PATCH 2/6] ASoC: tegra: Use normal system sleep for SFC Sameer Pujar
2021-11-23 14:07 ` [PATCH 3/6] ASoC: tegra: Use normal system sleep for MVC Sameer Pujar
2021-11-23 14:07 ` [PATCH 4/6] ASoC: tegra: Use normal system sleep for Mixer Sameer Pujar
2021-11-23 14:07 ` [PATCH 5/6] ASoC: tegra: Use normal system sleep for AMX Sameer Pujar
2021-11-23 14:07 ` [PATCH 6/6] ASoC: tegra: Use normal system sleep for ADX Sameer Pujar
2021-11-27  1:29 ` [PATCH 0/6] Suspend related fixes on Tegra 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).