snd/hda: Detangle unwind to avoid double release of display powerwell

Submitted by Chris Wilson on April 8, 2019, 9:43 a.m.

Details

Message ID 20190408094337.8709-1-chris@chris-wilson.co.uk
State New
Headers show
Series "snd/hda: Detangle unwind to avoid double release of display powerwell" ( rev: 1 ) in Intel GFX

Browsing this patch as part of:
"snd/hda: Detangle unwind to avoid double release of display powerwell" rev 1 in Intel GFX
<< prev patch [1/1] next patch >>

Commit Message

Chris Wilson April 8, 2019, 9:43 a.m.
<4> [265.019572] Unmatched wakeref (tracking 3), count 3
<4> [265.019680] WARNING: CPU: 1 PID: 163 at drivers/gpu/drm/i915/intel_runtime_pm.c:162 cancel_intel_runtime_pm_wakeref+0x87/0x160 [i915]
<4> [265.019682] Modules linked in: snd_hda_intel i915 vgem snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic mei_hdcp x86_pkg_temp_thermal coretemp crct10dif_pclmul crc32_pclmul ghash_clmulni_intel snd_hda_codec snd_hwdep snd_hda_core snd_pcm mei_me r8169 prime_numbers realtek mei i2c_hid pinctrl_geminilake pinctrl_intel [last unloaded: i915]
<4> [265.019702] CPU: 1 PID: 163 Comm: kworker/1:2 Tainted: G     U  W         5.1.0-rc4-CI-CI_DRM_5887+ #1
<4> [265.019705] Hardware name: Intel Corp. Geminilake/GLK RVP2 LP4SD (07), BIOS GELKRVPA.X64.0062.B30.1708222146 08/22/2017
<4> [265.019710] Workqueue: events azx_probe_work [snd_hda_intel]
<4> [265.019761] RIP: 0010:cancel_intel_runtime_pm_wakeref+0x87/0x160 [i915]
<4> [265.019763] Code: 48 8d 48 ff 75 dc 4c 89 ee 48 89 df e8 42 77 84 e1 8b 95 b0 ae 00 00 48 8b b5 00 af 00 00 48 c7 c7 58 77 2c a0 e8 f9 80 f5 e0 <0f> 0b 48 8b 3d 10 1b ff e1 ba 00 10 00 00 be c0 0c 00 00 e8 51 87
<4> [265.019766] RSP: 0018:ffffc90000fb3da8 EFLAGS: 00010282
<4> [265.019769] RAX: 0000000000000000 RBX: ffff8881452caeb8 RCX: 0000000000000000
<4> [265.019771] RDX: 0000000000000007 RSI: ffff8881788f08e0 RDI: 00000000ffffffff
<4> [265.019773] RBP: ffff8881452c0000 R08: 0000000085ca34c4 R09: 0000000000000000
<4> [265.019775] R10: 0000000000000000 R11: 0000000000000000 R12: 00000000cb400003
<4> [265.019777] R13: 0000000000000292 R14: 0000000000000000 R15: ffff888173798870
<4> [265.019780] FS:  0000000000000000(0000) GS:ffff88817ba80000(0000) knlGS:0000000000000000
<4> [265.019782] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
<4> [265.019784] CR2: 00007f971402e138 CR3: 00000001736dc000 CR4: 0000000000340ee0
<4> [265.019786] Call Trace:
<4> [265.019839]  intel_display_power_put+0x16/0x20 [i915]
<4> [265.019849]  snd_hdac_display_power+0xe3/0x100 [snd_hda_core]
<4> [265.019856]  azx_probe_work+0x4ed/0x7e0 [snd_hda_intel]
<4> [265.019865]  process_one_work+0x245/0x610
<4> [265.019874]  worker_thread+0x37/0x380
<4> [265.019879]  ? process_one_work+0x610/0x610
<4> [265.019882]  kthread+0x119/0x130
<4> [265.019885]  ? kthread_park+0x80/0x80
<4> [265.019892]  ret_from_fork+0x3a/0x50
<4> [265.019903] irq event stamp: 709708
<4> [265.019908] hardirqs last  enabled at (709707): [<ffffffff81124a27>] console_unlock+0x3f7/0x5a0
<4> [265.019911] hardirqs last disabled at (709708): [<ffffffff810019b0>] trace_hardirqs_off_thunk+0x1a/0x1c
<4> [265.019914] softirqs last  enabled at (709656): [<ffffffff81c0033a>] __do_softirq+0x33a/0x4b9
<4> [265.019918] softirqs last disabled at (709647): [<ffffffff810b5159>] irq_exit+0xa9/0xc0
<4> [265.019967] WARNING: CPU: 1 PID: 163 at drivers/gpu/drm/i915/intel_runtime_pm.c:162 cancel_intel_runtime_pm_wakeref+0x87/0x160 [i915]
<4> [265.019970] ---[ end trace 4b6d3cc703fecad8 ]---
<7> [265.020142] [drm:cancel_intel_runtime_pm_wakeref [i915]] wakeref cb400003 from
   intel_display_power_get+0x18/0x50 [i915]
   i915_audio_component_get_power+0x19/0x60 [i915]
   snd_hdac_display_power+0x6a/0x100 [snd_hda_core]
   azx_probe_work+0x88/0x7e0 [snd_hda_intel]
   process_one_work+0x245/0x610
   worker_thread+0x37/0x380
   kthread+0x119/0x130
   ret_from_fork+0x3a/0x50

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Imre Deak <imre.deak@intel.com>
---
 sound/pci/hda/hda_intel.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

Patch hide | download patch | download mbox

diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index ece256a3b48f..3795708ac903 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -2223,7 +2223,7 @@  static int azx_probe_continue(struct azx *chip)
 
 	err = azx_first_init(chip);
 	if (err < 0)
-		goto out_free;
+		goto power;
 
 #ifdef CONFIG_SND_HDA_INPUT_BEEP
 	chip->beep_mode = beep_mode[dev];
@@ -2232,14 +2232,14 @@  static int azx_probe_continue(struct azx *chip)
 	/* create codec instances */
 	err = azx_probe_codecs(chip, azx_max_codecs[chip->driver_type]);
 	if (err < 0)
-		goto out_free;
+		goto power;
 
 #ifdef CONFIG_SND_HDA_PATCH_LOADER
 	if (chip->fw) {
 		err = snd_hda_load_patch(&chip->bus, chip->fw->size,
 					 chip->fw->data);
 		if (err < 0)
-			goto out_free;
+			goto power;
 #ifndef CONFIG_PM
 		release_firmware(chip->fw); /* no longer needed */
 		chip->fw = NULL;
@@ -2249,12 +2249,12 @@  static int azx_probe_continue(struct azx *chip)
 	if ((probe_only[dev] & 1) == 0) {
 		err = azx_codec_configure(chip);
 		if (err < 0)
-			goto out_free;
+			goto power;
 	}
 
 	err = snd_card_register(chip->card);
 	if (err < 0)
-		goto out_free;
+		goto out_power;
 
 	setup_vga_switcheroo_runtime_pm(chip);
 
@@ -2266,9 +2266,10 @@  static int azx_probe_continue(struct azx *chip)
 	if (azx_has_pm_runtime(chip))
 		pm_runtime_put_autosuspend(&pci->dev);
 
-out_free:
+out_power:
 	if (err < 0 || !hda->need_i915_power)
 		display_power(chip, false);
+out_free:
 	if (err < 0)
 		hda->init_failed = 1;
 	complete_all(&hda->probe_wait);

Comments