From 13774d81f38538c5fa2924bdcdfa509155480fa6 Mon Sep 17 00:00:00 2001 From: Rander Wang Date: Wed, 2 Sep 2020 18:42:18 +0300 Subject: ALSA: hda: fix a runtime pm issue in SOF when integrated GPU is disabled 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 Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Guennadi Liakhovetski Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200902154218.1440441-1-kai.vehmanen@linux.intel.com Signed-off-by: Takashi Iwai --- sound/hda/hdac_device.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sound/hda') diff --git a/sound/hda/hdac_device.c b/sound/hda/hdac_device.c index 333220f0f8af..3e9e9ac804f6 100644 --- a/sound/hda/hdac_device.c +++ b/sound/hda/hdac_device.c @@ -127,6 +127,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); -- cgit v1.2.3 From b79de57b4378a93115307be6962d05b099eb0f37 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Wed, 2 Sep 2020 18:42:50 +0300 Subject: ALSA: hda: use consistent HDAudio spelling in comments/docs We use HDaudio and HDAudio, pick one to make searches easier. No functionality change Also fix timestamping typo in documentation. Reported-by: Guennadi Liakhovetski Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Guennadi Liakhovetski Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20200902154250.1440585-1-kai.vehmanen@linux.intel.com Signed-off-by: Takashi Iwai --- sound/hda/intel-dsp-config.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sound/hda') diff --git a/sound/hda/intel-dsp-config.c b/sound/hda/intel-dsp-config.c index 99aec7349167..1c5114dedda9 100644 --- a/sound/hda/intel-dsp-config.c +++ b/sound/hda/intel-dsp-config.c @@ -54,7 +54,7 @@ static const struct config_entry config_table[] = { #endif /* * Apollolake (Broxton-P) - * the legacy HDaudio driver is used except on Up Squared (SOF) and + * the legacy HDAudio driver is used except on Up Squared (SOF) and * Chromebooks (SST) */ #if IS_ENABLED(CONFIG_SND_SOC_SOF_APOLLOLAKE) @@ -89,7 +89,7 @@ static const struct config_entry config_table[] = { }, #endif /* - * Skylake and Kabylake use legacy HDaudio driver except for Google + * Skylake and Kabylake use legacy HDAudio driver except for Google * Chromebooks (SST) */ @@ -135,7 +135,7 @@ static const struct config_entry config_table[] = { #endif /* - * Geminilake uses legacy HDaudio driver except for Google + * Geminilake uses legacy HDAudio driver except for Google * Chromebooks */ /* Geminilake */ @@ -157,7 +157,7 @@ static const struct config_entry config_table[] = { /* * CoffeeLake, CannonLake, CometLake, IceLake, TigerLake use legacy - * HDaudio driver except for Google Chromebooks and when DMICs are + * HDAudio driver except for Google Chromebooks and when DMICs are * present. Two cases are required since Coreboot does not expose NHLT * tables. * @@ -391,7 +391,7 @@ int snd_intel_dsp_driver_probe(struct pci_dev *pci) if (pci->class == 0x040300) return SND_INTEL_DSP_DRIVER_LEGACY; if (pci->class != 0x040100 && pci->class != 0x040380) { - dev_err(&pci->dev, "Unknown PCI class/subclass/prog-if information (0x%06x) found, selecting HDA legacy driver\n", pci->class); + dev_err(&pci->dev, "Unknown PCI class/subclass/prog-if information (0x%06x) found, selecting HDAudio legacy driver\n", pci->class); return SND_INTEL_DSP_DRIVER_LEGACY; } -- cgit v1.2.3