<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - [BAT] igt@pm_rpm@basic-* - fail - wait_for_suspended()"
href="https://bugs.freedesktop.org/show_bug.cgi?id=105269#c3">Comment # 3</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - [BAT] igt@pm_rpm@basic-* - fail - wait_for_suspended()"
href="https://bugs.freedesktop.org/show_bug.cgi?id=105269">bug 105269</a>
from <span class="vcard"><a class="email" href="mailto:marta.lofstedt@intel.com" title="Marta Löfstedt <marta.lofstedt@intel.com>"> <span class="fn">Marta Löfstedt</span></a>
</span></b>
<pre>I believe something i weird on drm-tip.
commit 6d167e8d8eaeb7574583e47e207914d3089be0a4
Author: Chris Wilson <<a href="mailto:chris@chris-wilson.co.uk">chris@chris-wilson.co.uk</a>>
Date: Wed Feb 14 11:34:21 2018 +0000
Revert "ALSA: hda: Make use of core codec functions to sync power state"
This reverts commit 3b5b899ca67db07a4c4825911072221f99e157e2.
References: <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED WORKSFORME - [BAT][CI] igt@pm_rpm@* - fail - Failed assertion: wait_for_suspended() | igt@kms_vblank@* - fail - Failed assertion: igt_wait_for_pm_status(IGT_RUNTIME_PM_STATUS_SUSPENDED)"
href="show_bug.cgi?id=105069">https://bugs.freedesktop.org/show_bug.cgi?id=105069</a>
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 5bc3a7468e17..e018ecbf78a8 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -2702,6 +2702,32 @@ void snd_hda_codec_set_power_to_all(struct hda_codec
*codec, hda_nid_t fg,
}
EXPORT_SYMBOL_GPL(snd_hda_codec_set_power_to_all);
+/*
+ * wait until the state is reached, returns the current state
+ */
+static unsigned int hda_sync_power_state(struct hda_codec *codec,
+ hda_nid_t fg,
+ unsigned int power_state)
+{
+ unsigned long end_time = jiffies + msecs_to_jiffies(500);
+ unsigned int state, actual_state;
+
+ for (;;) {
+ state = snd_hda_codec_read(codec, fg, 0,
+ AC_VERB_GET_POWER_STATE, 0);
+ if (state & AC_PWRST_ERROR)
+ break;
+ actual_state = (state >> 4) & 0x0f;
+ if (actual_state == power_state)
+ break;
+ if (time_after_eq(jiffies, end_time))
+ break;
+ /* wait until the codec reachs to the target state */
+ msleep(1);
+ }
+ return state;
+}
+
/**
* snd_hda_codec_eapd_power_filter - A power filter callback for EAPD
* @codec: the HDA codec
@@ -2764,7 +2790,7 @@ static unsigned int hda_set_power_state(struct hda_codec
*codec,
state);
snd_hda_codec_set_power_to_all(codec, fg, power_state);
}
- state = snd_hda_sync_power_state(codec, fg, power_state);
+ state = hda_sync_power_state(codec, fg, power_state);
if (!(state & AC_PWRST_ERROR))
break;
}
However, when I open the sound/pci/hda/hda_codec.c there is no:
static unsigned int hda_sync_power_state(...) function and:
state = snd_hda_sync_power_state(codec, fg, power_state);</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
<li>You are on the CC list for the bug.</li>
<li>You are the QA Contact for the bug.</li>
</ul>
</body>
</html>