From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Rander Wang <rander.wang@intel.com>,
Ranjani Sridharan <ranjani.sridharan@linux.intel.com>,
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
Bard Liao <yung-chuan.liao@linux.intel.com>,
Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>,
Kai Vehmanen <kai.vehmanen@linux.intel.com>,
Takashi Iwai <tiwai@suse.de>, Sasha Levin <sashal@kernel.org>,
alsa-devel@alsa-project.org
Subject: [PATCH AUTOSEL 4.14 16/17] ALSA: hda: fix a runtime pm issue in SOF when integrated GPU is disabled
Date: Mon, 7 Sep 2020 12:34:59 -0400 [thread overview]
Message-ID: <20200907163500.1281543-16-sashal@kernel.org> (raw)
In-Reply-To: <20200907163500.1281543-1-sashal@kernel.org>
From: Rander Wang <rander.wang@intel.com>
[ Upstream commit 13774d81f38538c5fa2924bdcdfa509155480fa6 ]
In snd_hdac_device_init pm_runtime_set_active is called to
increase child_count in parent device. But when it is failed
to build connection with GPU for one case that integrated
graphic gpu is disabled, snd_hdac_ext_bus_device_exit will be
invoked to clean up a HD-audio extended codec base device. At
this time the child_count of parent is not decreased, which
makes parent device can't get suspended.
This patch calls pm_runtime_set_suspended to decrease child_count
in parent device in snd_hdac_device_exit to match with
snd_hdac_device_init. pm_runtime_set_suspended can make sure that
it will not decrease child_count if the device is already suspended.
Signed-off-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200902154218.1440441-1-kai.vehmanen@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/hda/hdac_device.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/hda/hdac_device.c b/sound/hda/hdac_device.c
index 19deb306facb7..4a843eb7cc940 100644
--- a/sound/hda/hdac_device.c
+++ b/sound/hda/hdac_device.c
@@ -123,6 +123,8 @@ EXPORT_SYMBOL_GPL(snd_hdac_device_init);
void snd_hdac_device_exit(struct hdac_device *codec)
{
pm_runtime_put_noidle(&codec->dev);
+ /* keep balance of runtime PM child_count in parent device */
+ pm_runtime_set_suspended(&codec->dev);
snd_hdac_bus_remove_device(codec->bus, codec);
kfree(codec->vendor_name);
kfree(codec->chip_name);
--
2.25.1
next prev parent reply other threads:[~2020-09-07 16:47 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-07 16:34 [PATCH AUTOSEL 4.14 01/17] ARC: HSDK: wireup perf irq Sasha Levin
2020-09-07 16:34 ` [PATCH AUTOSEL 4.14 02/17] dmaengine: acpi: Put the CSRT table after using it Sasha Levin
2020-09-07 16:34 ` [PATCH AUTOSEL 4.14 03/17] drivers/net/wan/lapbether: Added needed_tailroom Sasha Levin
2020-09-07 16:34 ` [PATCH AUTOSEL 4.14 04/17] NFC: st95hf: Fix memleak in st95hf_in_send_cmd Sasha Levin
2020-09-07 16:34 ` [PATCH AUTOSEL 4.14 05/17] firestream: Fix memleak in fs_open Sasha Levin
2020-09-07 16:34 ` [PATCH AUTOSEL 4.14 06/17] ALSA: hda: Fix 2 channel swapping for Tegra Sasha Levin
2020-09-07 16:34 ` [PATCH AUTOSEL 4.14 07/17] drivers/net/wan/lapbether: Set network_header before transmitting Sasha Levin
2020-09-07 16:34 ` [PATCH AUTOSEL 4.14 08/17] cfg80211: regulatory: reject invalid hints Sasha Levin
2020-09-07 16:34 ` [PATCH AUTOSEL 4.14 09/17] net: usb: Fix uninit-was-stored issue in asix_read_phy_addr() Sasha Levin
2020-09-07 16:34 ` [PATCH AUTOSEL 4.14 10/17] xfs: initialize the shortform attr header padding entry Sasha Levin
2020-09-07 16:34 ` [PATCH AUTOSEL 4.14 11/17] irqchip/eznps: Fix build error for !ARC700 builds Sasha Levin
2020-09-07 16:34 ` [PATCH AUTOSEL 4.14 12/17] drivers/net/wan/hdlc_cisco: Add hard_header_len Sasha Levin
2020-09-07 16:34 ` [PATCH AUTOSEL 4.14 13/17] ARC: [plat-hsdk]: Switch ethernet phy-mode to rgmii-id Sasha Levin
2020-09-07 16:34 ` [PATCH AUTOSEL 4.14 14/17] cpufreq: intel_pstate: Refuse to turn off with HWP enabled Sasha Levin
2020-09-07 16:34 ` [PATCH AUTOSEL 4.14 15/17] net: usb: dm9601: Add USB ID of Keenetic Plus DSL Sasha Levin
2020-09-07 16:34 ` Sasha Levin [this message]
2020-09-07 16:35 ` [PATCH AUTOSEL 4.14 17/17] gcov: Disable gcov build with GCC 10 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=20200907163500.1281543-16-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=alsa-devel@alsa-project.org \
--cc=guennadi.liakhovetski@linux.intel.com \
--cc=kai.vehmanen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=rander.wang@intel.com \
--cc=ranjani.sridharan@linux.intel.com \
--cc=stable@vger.kernel.org \
--cc=tiwai@suse.de \
--cc=yung-chuan.liao@linux.intel.com \
/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
all inboxes | Powered by JetHome®