Home Home > GIT Browse > SLE15-SP1
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-07-19 14:20:49 +0200
committerTakashi Iwai <tiwai@suse.de>2019-07-19 14:34:28 +0200
commitb8b1a5d5ac69444a442e3bbd19fdf8c6e0397fab (patch)
tree81eb5c9148589db3da259fcea75043da74e1afd6
parent93c949a507a027a0550491e200d7b8b0533a0859 (diff)
ALSA: hda - Don't resume forcibly i915 HDMI/DP codec
(bsc#1111666).
-rw-r--r--patches.drivers/ALSA-hda-Don-t-resume-forcibly-i915-HDMI-DP-codec.patch100
-rw-r--r--series.conf1
2 files changed, 101 insertions, 0 deletions
diff --git a/patches.drivers/ALSA-hda-Don-t-resume-forcibly-i915-HDMI-DP-codec.patch b/patches.drivers/ALSA-hda-Don-t-resume-forcibly-i915-HDMI-DP-codec.patch
new file mode 100644
index 0000000000..5e4031af3c
--- /dev/null
+++ b/patches.drivers/ALSA-hda-Don-t-resume-forcibly-i915-HDMI-DP-codec.patch
@@ -0,0 +1,100 @@
+From 4914da2fb0c89205790503f20dfdde854f3afdd8 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Tue, 16 Jul 2019 08:56:51 +0200
+Subject: [PATCH] ALSA: hda - Don't resume forcibly i915 HDMI/DP codec
+Git-commit: 4914da2fb0c89205790503f20dfdde854f3afdd8
+Patch-mainline: v5.3-rc1
+References: bsc#1111666
+
+We apply the codec resume forcibly at system resume callback for
+updating and syncing the jack detection state that may have changed
+during sleeping. This is, however, superfluous for the codec like
+Intel HDMI/DP, where the jack detection is managed via the audio
+component notification; i.e. the jack state change shall be reported
+sooner or later from the graphics side at mode change.
+
+This patch changes the codec resume callback to avoid the forcible
+resume conditionally with a new flag, codec->relaxed_resume, for
+reducing the resume time. The flag is set in the codec probe.
+
+Although this doesn't fix the entire bug mentioned in the bugzilla
+entry below, it's still a good optimization and some improvements are
+seen.
+
+Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=201901
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ include/sound/hda_codec.h | 2 ++
+ sound/pci/hda/hda_codec.c | 8 ++++++--
+ sound/pci/hda/patch_hdmi.c | 6 +++++-
+ 3 files changed, 13 insertions(+), 3 deletions(-)
+
+diff --git a/include/sound/hda_codec.h b/include/sound/hda_codec.h
+index 8f46ff3449d5..871993696c5f 100644
+--- a/include/sound/hda_codec.h
++++ b/include/sound/hda_codec.h
+@@ -252,6 +252,8 @@ struct hda_codec {
+ unsigned int auto_runtime_pm:1; /* enable automatic codec runtime pm */
+ unsigned int force_pin_prefix:1; /* Add location prefix */
+ unsigned int link_down_at_suspend:1; /* link down at runtime suspend */
++ unsigned int relaxed_resume:1; /* don't resume forcibly for jack */
++
+ #ifdef CONFIG_PM
+ unsigned long power_on_acct;
+ unsigned long power_off_acct;
+diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
+index 5346631df1ec..e30e86ca6b72 100644
+--- a/sound/pci/hda/hda_codec.c
++++ b/sound/pci/hda/hda_codec.c
+@@ -2941,15 +2941,19 @@ static int hda_codec_runtime_resume(struct device *dev)
+ #ifdef CONFIG_PM_SLEEP
+ static int hda_codec_force_resume(struct device *dev)
+ {
++ struct hda_codec *codec = dev_to_hda_codec(dev);
++ bool forced_resume = !codec->relaxed_resume;
+ int ret;
+
+ /* The get/put pair below enforces the runtime resume even if the
+ * device hasn't been used at suspend time. This trick is needed to
+ * update the jack state change during the sleep.
+ */
+- pm_runtime_get_noresume(dev);
++ if (forced_resume)
++ pm_runtime_get_noresume(dev);
+ ret = pm_runtime_force_resume(dev);
+- pm_runtime_put(dev);
++ if (forced_resume)
++ pm_runtime_put(dev);
+ return ret;
+ }
+
+diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
+index 0b2a26e2c5f1..bea7b0961080 100644
+--- a/sound/pci/hda/patch_hdmi.c
++++ b/sound/pci/hda/patch_hdmi.c
+@@ -2292,8 +2292,10 @@ static void generic_hdmi_free(struct hda_codec *codec)
+ struct hdmi_spec *spec = codec->spec;
+ int pin_idx, pcm_idx;
+
+- if (codec_has_acomp(codec))
++ if (codec_has_acomp(codec)) {
+ snd_hdac_acomp_register_notifier(&codec->bus->core, NULL);
++ codec->relaxed_resume = 0;
++ }
+
+ for (pin_idx = 0; pin_idx < spec->num_pins; pin_idx++) {
+ struct hdmi_spec_per_pin *per_pin = get_pin(spec, pin_idx);
+@@ -2579,6 +2581,8 @@ static void register_i915_notifier(struct hda_codec *codec)
+ spec->drm_audio_ops.pin_eld_notify = intel_pin_eld_notify;
+ snd_hdac_acomp_register_notifier(&codec->bus->core,
+ &spec->drm_audio_ops);
++ /* no need for forcible resume for jack check thanks to notifier */
++ codec->relaxed_resume = 1;
+ }
+
+ /* setup_stream ops override for HSW+ */
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index 9ef70b45b5..3f6ed822e5 100644
--- a/series.conf
+++ b/series.conf
@@ -47896,6 +47896,7 @@
patches.fixes/PCI-P2PDMA-Fix-missing-check-for-dma_virt_ops.patch
patches.drivers/ALSA-hda-hdmi-Remove-duplicated-define.patch
patches.drivers/ALSA-hda-hdmi-Fix-i915-reverse-port-pin-mapping.patch
+ patches.drivers/ALSA-hda-Don-t-resume-forcibly-i915-HDMI-DP-codec.patch
# davem/net-next
patches.drivers/cxgb4-Enable-hash-filter-with-offload.patch