Skip to contentSkip to conversation

Revert "ALSA: hda: Make use of core codec functions to sync power state"

PATCH New [email protected] 2 participants 5 messages Feb 14, 2018 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 Revert "ALSA: hda: Make use of core codec functions to sync power state"

From: Abhijeet Kumar <[email protected]>

This reverts commit 3b5b899ca67db07a4c4825911072221f99e157e2.

---
 sound/pci/hda/hda_codec.c | 28 +++++++++++++++++++++++++++-
 sound/pci/hda/hda_local.h |  6 +-----
 2 files changed, 28 insertions(+), 6 deletions(-)
sound/pci/hda/hda_codec.c +27 -1
index 5bc3a7468e17..e018ecbf78a8 100644
@@ -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;
 	}
sound/pci/hda/hda_local.h +1 -5
index 321e78baa63c..5b5c324c99b9 100644
@@ -622,11 +622,7 @@ int snd_hda_check_amp_list_power(struct hda_codec *codec,
 {
 	return snd_hdac_check_power_state(&codec->core, nid, target_state);
 }
-static inline bool snd_hda_sync_power_state(struct hda_codec *codec,
-			   hda_nid_t nid, unsigned int target_state)
-{
-	return snd_hdac_sync_power_state(&codec->core, nid, target_state);
-}
+
 unsigned int snd_hda_codec_eapd_power_filter(struct hda_codec *codec,
 					     hda_nid_t nid,
 					     unsigned int power_state);
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH 2/3 redo

From: Abhijeet Kumar <[email protected]>

---
 sound/pci/hda/hda_codec.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
sound/pci/hda/hda_codec.c +5 -2
index e018ecbf78a8..8c1b07e300a8 100644
@@ -2711,12 +2711,15 @@ static unsigned int hda_sync_power_state(struct hda_codec *codec,
 {
 	unsigned long end_time = jiffies + msecs_to_jiffies(500);
 	unsigned int state, actual_state;
+	int count;
 
-	for (;;) {
+	for (count = 0;count < 500; count++) {
 		state = snd_hda_codec_read(codec, fg, 0,
 					   AC_VERB_GET_POWER_STATE, 0);
-		if (state & AC_PWRST_ERROR)
+		if (state & AC_PWRST_ERROR){
+			msleep(20);
 			break;
+		}
 		actual_state = (state >> 4) & 0x0f;
 		if (actual_state == power_state)
 			break;
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

PATCH 3/3 just some guess work to findout the culprit. If this breaks then we know what do.

In reply to [email protected]

From: Abhijeet Kumar <[email protected]>

---
 sound/pci/hda/hda_codec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/hda_codec.c +1 -1
index 8c1b07e300a8..377d5719b4cd 100644
@@ -2714,7 +2714,7 @@ static unsigned int hda_sync_power_state(struct hda_codec *codec,
 	int count;
 
 	for (count = 0;count < 500; count++) {
-		state = snd_hda_codec_read(codec, fg, 0,
+		state = snd_hdac_codec_read(&codec->core, fg, 0,
 					   AC_VERB_GET_POWER_STATE, 0);
 		if (state & AC_PWRST_ERROR){
 			msleep(20);
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

✓ Fi.CI.BAT: success for series starting with [1/3] Revert "ALSA: hda: Make use of core codec functions to sync power state"

In reply to [email protected]
== Series Details ==

== Series Details ==

Series: series starting with [1/3] Revert "ALSA: hda: Make use of core codec functions to sync power state"
URL : https://patchwork.freedesktop.org/series/38212/
State : success

== Summary ==

Series 38212v1 series starting with [1/3] Revert "ALSA: hda: Make use of core codec functions to sync power state"
https://patchwork.freedesktop.org/api/1.0/series/38212/revisions/1/mbox/

Test gem_mmap_gtt:

        Subgroup basic-small-bo-tiledx:
                pass       -> FAIL       (fi-gdg-551) fdo#102575
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-a:
                dmesg-warn -> PASS       (fi-cnl-y3) fdo#105058
        Subgroup suspend-read-crc-pipe-b:
                incomplete -> PASS       (fi-snb-2520m) fdo#103713
Test pm_rpm:
        Subgroup basic-pci-d3-state:
                fail       -> PASS       (fi-hsw-4770) fdo#105069 +3

fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575
fdo#105058 https://bugs.freedesktop.org/show_bug.cgi?id=105058
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#105069 https://bugs.freedesktop.org/show_bug.cgi?id=105069

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:428s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:436s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:382s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:492s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:290s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:484s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:491s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:473s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:461s
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:573s
fi-cnl-y3        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:582s
fi-elk-e7500     total:288  pass:229  dwarn:0   dfail:0   fail:0   skip:59  time:418s
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:284s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:513s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:392s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:417s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:468s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:416s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:462s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:497s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:500s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:595s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:439s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:507s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:528s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:494s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:482s
fi-skl-guc       total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:415s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:434s
fi-snb-2520m     total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:528s
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:399s
Blacklisted hosts:
fi-glk-dsi       total:117  pass:104  dwarn:0   dfail:0   fail:0   skip:12 
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:454s

e404d341ffdd255f9a7d8e4461170694edcb3e25 drm-tip: 2018y-02m-14d-01h-12m-17s UTC integration manifest 2ee32574fbfc just some guess work to findout the culprit. If this breaks then we know what do. 90c5eef4d5b8 redo
78ff10b72263 Revert "ALSA: hda: Make use of core codec functions to sync power state"

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8004/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw

✓ Fi.CI.IGT: success for series starting with [1/3] Revert "ALSA: hda: Make use of core codec functions to sync power state"

In reply to [email protected]
== Series Details ==

== Series Details ==

Series: series starting with [1/3] Revert "ALSA: hda: Make use of core codec functions to sync power state"
URL : https://patchwork.freedesktop.org/series/38212/
State : success

== Summary ==

Test pm_rpm:

        Subgroup gem-mmap-cpu:
                fail       -> PASS       (shard-hsw) fdo#105069 +38
        Subgroup system-suspend-execbuf:
                fail       -> PASS       (shard-hsw) fdo#103375 +1
Test kms_sysfs_edid_timing:
                pass       -> WARN       (shard-apl) fdo#100047
Test perf:
        Subgroup polling:
                fail       -> PASS       (shard-hsw) fdo#102252
Test kms_cursor_crc:
        Subgroup cursor-64x64-suspend:
                skip       -> PASS       (shard-snb) fdo#102365
Test kms_frontbuffer_tracking:
        Subgroup fbc-1p-primscrn-pri-shrfb-draw-blt:
                dmesg-fail -> PASS       (shard-apl) fdo#101623
        Subgroup fbc-1p-shrfb-fliptrack:
                fail       -> PASS       (shard-apl) fdo#103167
Test pm_lpsp:
        Subgroup screens-disabled:
                fail       -> PASS       (shard-hsw) fdo#104941
Test perf_pmu:
        Subgroup rc6-runtime-pm:
                skip       -> PASS       (shard-hsw) fdo#105010 +1

fdo#105069 https://bugs.freedesktop.org/show_bug.cgi?id=105069
fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375
fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
fdo#102365 https://bugs.freedesktop.org/show_bug.cgi?id=102365
fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#104941 https://bugs.freedesktop.org/show_bug.cgi?id=104941
fdo#105010 https://bugs.freedesktop.org/show_bug.cgi?id=105010

shard-apl        total:3344 pass:1729 dwarn:1   dfail:0   fail:21  skip:1591 time:13896s
shard-hsw        total:3427 pass:1759 dwarn:1   dfail:0   fail:10  skip:1656 time:14711s
shard-snb        total:3427 pass:1349 dwarn:1   dfail:0   fail:10  skip:2067 time:7678s

Blacklisted hosts:
shard-kbl total:3370 pass:1849 dwarn:27 dfail:0 fail:20 skip:1473 time:10926s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8004/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx