public inbox for alsa-devel@alsa-project.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Sasha Levin <sashal@kernel.org>,
	alsa-devel@alsa-project.org,
	Kai Vehmanen <kai.vehmanen@linux.intel.com>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	Ranjani Sridharan <ranjani.sridharan@linux.intel.com>,
	Mark Brown <broonie@kernel.org>,
	Daniel Baluta <daniel.baluta@nxp.com>,
	sound-open-firmware@alsa-project.org
Subject: [PATCH AUTOSEL 5.7 055/388] ASoC: SOF: Do nothing when DSP PM callbacks are not set
Date: Wed, 17 Jun 2020 21:02:32 -0400	[thread overview]
Message-ID: <20200618010805.600873-55-sashal@kernel.org> (raw)
In-Reply-To: <20200618010805.600873-1-sashal@kernel.org>

From: Daniel Baluta <daniel.baluta@nxp.com>

[ Upstream commit c26fde3b15ed41f5f452f1da727795f787833287 ]

This provides a better separation between runtime and PM sleep
callbacks.

Only do nothing if given runtime flag is set and calback is not set.

With the current implementation, if PM sleep callback is set but runtime
callback is not set then at runtime resume we reload the firmware even
if we do not support runtime resume callback.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200515135958.17511-2-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 sound/soc/sof/pm.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/sound/soc/sof/pm.c b/sound/soc/sof/pm.c
index c410822d9920..01d83ddc16ba 100644
--- a/sound/soc/sof/pm.c
+++ b/sound/soc/sof/pm.c
@@ -90,7 +90,10 @@ static int sof_resume(struct device *dev, bool runtime_resume)
 	int ret;
 
 	/* do nothing if dsp resume callbacks are not set */
-	if (!sof_ops(sdev)->resume || !sof_ops(sdev)->runtime_resume)
+	if (!runtime_resume && !sof_ops(sdev)->resume)
+		return 0;
+
+	if (runtime_resume && !sof_ops(sdev)->runtime_resume)
 		return 0;
 
 	/* DSP was never successfully started, nothing to resume */
@@ -175,7 +178,10 @@ static int sof_suspend(struct device *dev, bool runtime_suspend)
 	int ret;
 
 	/* do nothing if dsp suspend callback is not set */
-	if (!sof_ops(sdev)->suspend)
+	if (!runtime_suspend && !sof_ops(sdev)->suspend)
+		return 0;
+
+	if (runtime_suspend && !sof_ops(sdev)->runtime_suspend)
 		return 0;
 
 	if (sdev->fw_state != SOF_FW_BOOT_COMPLETE)
-- 
2.25.1


  parent reply	other threads:[~2020-06-18  1:13 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200618010805.600873-1-sashal@kernel.org>
2020-06-18  1:01 ` [PATCH AUTOSEL 5.7 004/388] ASoC: tegra: tegra_wm8903: Support nvidia, headset property Sasha Levin
2020-06-18 11:00   ` Mark Brown
2020-06-18 14:30     ` Sasha Levin
2020-06-18 14:39       ` Mark Brown
2020-06-21 23:33         ` Sasha Levin
2020-06-22 11:23           ` Mark Brown
2020-06-22 12:31             ` Sasha Levin
2020-06-22 13:27               ` Mark Brown
2020-06-22 14:44                 ` Sasha Levin
2020-06-22 17:57                   ` Mark Brown
2020-06-18  1:01 ` [PATCH AUTOSEL 5.7 007/388] ASoC: SOF: imx8: Fix randbuild error Sasha Levin
2020-06-18  1:01 ` [PATCH AUTOSEL 5.7 013/388] ASoC: fsl_esai: Disable exception interrupt before scheduling tasklet Sasha Levin
2020-06-18  1:01 ` [PATCH AUTOSEL 5.7 016/388] ASoC: davinci-mcasp: Fix dma_chan refcnt leak when getting dma type Sasha Levin
2020-06-18  1:01 ` [PATCH AUTOSEL 5.7 020/388] ASoC: codecs: wm97xx: fix ac97 dependency Sasha Levin
2020-06-18  1:02 ` [PATCH AUTOSEL 5.7 025/388] ALSA: hda/realtek - Introduce polarity for micmute LED GPIO Sasha Levin
2020-06-18  1:02 ` [PATCH AUTOSEL 5.7 026/388] ALSA: isa/wavefront: prevent out of bounds write in ioctl Sasha Levin
2020-06-18  1:02 ` Sasha Levin [this message]
2020-06-18 11:01   ` [PATCH AUTOSEL 5.7 055/388] ASoC: SOF: Do nothing when DSP PM callbacks are not set Mark Brown
2020-06-18 11:44     ` Daniel Baluta
2020-06-18 12:13       ` Mark Brown
2020-06-18 13:56       ` Pierre-Louis Bossart
2020-06-18  1:03 ` [PATCH AUTOSEL 5.7 085/388] ASoC: qcom: q6asm-dai: kCFI fix Sasha Levin
2020-06-18  1:03 ` [PATCH AUTOSEL 5.7 094/388] ASoC: meson: fix memory leak of links if allocation of ldata fails Sasha Levin
2020-06-18  1:03 ` [PATCH AUTOSEL 5.7 103/388] ASoC: meson: add missing free_irq() in error path Sasha Levin
2020-06-18  1:03 ` [PATCH AUTOSEL 5.7 124/388] ALSA: usb-audio: RME Babyface Pro mixer patch Sasha Levin
2020-06-18  1:03 ` [PATCH AUTOSEL 5.7 130/388] ASoC: Fix wrong dependency of da7210 and wm8983 Sasha Levin
2020-06-18 11:02   ` Mark Brown
2020-06-21 23:34     ` Sasha Levin
2020-06-22 10:18       ` Mark Brown
2020-06-22 12:31         ` Sasha Levin
2020-06-18  1:03 ` [PATCH AUTOSEL 5.7 138/388] ALSA: usb-audio: Improve frames size computation Sasha Levin
2020-06-18  1:03 ` [PATCH AUTOSEL 5.7 139/388] ALSA: usb-audio: Fix racy list management in output queue Sasha Levin
2020-06-18  1:04 ` [PATCH AUTOSEL 5.7 147/388] slimbus: ngd: get drvdata from correct device Sasha Levin
2020-06-18  1:04 ` [PATCH AUTOSEL 5.7 155/388] ASoC: component: suppress uninitialized-variable warning Sasha Levin
2020-06-18  1:04 ` [PATCH AUTOSEL 5.7 157/388] ASoC: rt5682: fix I2C/Soundwire dependencies Sasha Levin
2020-06-18  1:04 ` [PATCH AUTOSEL 5.7 160/388] ASoC: SOF: Update correct LED status at the first time usage of update_mute_led() Sasha Levin
2020-06-18  1:04 ` [PATCH AUTOSEL 5.7 162/388] ASoC: max98373: reorder max98373_reset() in resume Sasha Levin
2020-06-18  1:04 ` [PATCH AUTOSEL 5.7 163/388] soundwire: slave: don't init debugfs on device registration error Sasha Levin
2020-06-18  1:04 ` [PATCH AUTOSEL 5.7 179/388] ALSA: firewire-lib: fix invalid assignment to union data for directional parameter Sasha Levin
2020-06-18  1:04 ` [PATCH AUTOSEL 5.7 183/388] ASoC: SOF: core: fix error return code in sof_probe_continue() Sasha Levin
2020-06-18  1:04 ` [PATCH AUTOSEL 5.7 193/388] SoC: rsnd: add interrupt support for SSI BUSIF buffer Sasha Levin
2020-06-18  1:04 ` [PATCH AUTOSEL 5.7 194/388] ASoC: ux500: mop500: Fix some refcounted resources issues Sasha Levin
2020-06-18  1:04 ` [PATCH AUTOSEL 5.7 195/388] ASoC: ti: omap-mcbsp: Fix an error handling path in 'asoc_mcbsp_probe()' Sasha Levin
2020-06-18  1:05 ` [PATCH AUTOSEL 5.7 209/388] ALSA: usb-audio: fixing upper volume limit for RME Babyface Pro routing crosspoints Sasha Levin
2020-06-18  1:05 ` [PATCH AUTOSEL 5.7 210/388] ALSA: usb-audio: Add duplex sound support for USB devices using implicit feedback Sasha Levin
2020-06-18  1:05 ` [PATCH AUTOSEL 5.7 217/388] ASoC: codecs: rt*-sdw: fix memory leak in set_sdw_stream() Sasha Levin
2020-06-18  1:05 ` [PATCH AUTOSEL 5.7 232/388] ASoC: Intel: bytcr_rt5640: Add quirk for Toshiba Encore WT8-A tablet Sasha Levin
2020-06-18  1:06 ` [PATCH AUTOSEL 5.7 279/388] ASoC: fix incomplete error-handling in img_i2s_in_probe Sasha Levin
2020-06-18  1:06 ` [PATCH AUTOSEL 5.7 294/388] ASoC: dapm: Move dai_link widgets to runtime to fix use after free Sasha Levin
2020-06-18  1:06 ` [PATCH AUTOSEL 5.7 306/388] ASoC: fsl_asrc_dma: Fix dma_chan leak when config DMA channel failed Sasha Levin
2020-06-18  1:06 ` [PATCH AUTOSEL 5.7 307/388] ASoC: SOF: Intel: hda: fix generic hda codec support Sasha Levin
2020-06-18  1:07 ` [PATCH AUTOSEL 5.7 362/388] ASoC: soc-pcm: dpcm: fix playback/capture checks Sasha Levin
2020-06-18  1:07 ` [PATCH AUTOSEL 5.7 363/388] ASoC: core: only convert non DPCM link to DPCM link Sasha Levin
2020-06-18  1:07 ` [PATCH AUTOSEL 5.7 364/388] ASoC: SOF: nocodec: conditionally set dpcm_capture/dpcm_playback flags Sasha Levin
2020-06-18  1:07 ` [PATCH AUTOSEL 5.7 365/388] ASoC: Intel: bytcr_rt5640: Add quirk for Toshiba Encore WT10-A tablet Sasha Levin
2020-06-18  1:07 ` [PATCH AUTOSEL 5.7 366/388] ASoC: rt5645: Add platform-data for Asus T101HA Sasha Levin

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=20200618010805.600873-55-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=daniel.baluta@nxp.com \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=ranjani.sridharan@linux.intel.com \
    --cc=sound-open-firmware@alsa-project.org \
    --cc=stable@vger.kernel.org \
    /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