diff mbox

ALSA: hda: Remove finite loop from snd_hdac_sync_power_state()

Message ID 1518512988-24305-1-git-send-email-abhijeet.kumar@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Abhijeet Kumar Feb. 13, 2018, 9:09 a.m. UTC
From: Abhijeet Kumar <abhijeet.kumar@intel.com>

Finite loop was causing few igt@pm_rpm tests failure for HSW and BDW.
Thus changing it back to infinite one.

References: https://bugs.freedesktop.org/show_bug.cgi?id=105069

Signed-off-by: Abhijeet Kumar <abhijeet.kumar@intel.com>
---
 sound/hda/hdac_device.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Takashi Iwai Feb. 13, 2018, 9:14 a.m. UTC | #1
On Tue, 13 Feb 2018 10:09:48 +0100,
abhijeet.kumar@intel.com wrote:
> 
> From: Abhijeet Kumar <abhijeet.kumar@intel.com>
> 
> Finite loop was causing few igt@pm_rpm tests failure for HSW and BDW.
> Thus changing it back to infinite one.

This missing the explanation why the finite loop fails.
I can guess, but some more details please.


Takashi

> 
> References: https://bugs.freedesktop.org/show_bug.cgi?id=105069
> 
> Signed-off-by: Abhijeet Kumar <abhijeet.kumar@intel.com>
> ---
>  sound/hda/hdac_device.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/hda/hdac_device.c b/sound/hda/hdac_device.c
> index 7ba100bb1c3f..5a1dd570cea7 100644
> --- a/sound/hda/hdac_device.c
> +++ b/sound/hda/hdac_device.c
> @@ -1079,9 +1079,9 @@ unsigned int snd_hdac_sync_power_state(struct hdac_device *codec,
>  			hda_nid_t nid, unsigned int power_state)
>  {
>  	unsigned long end_time = jiffies + msecs_to_jiffies(500);
> -	unsigned int state, actual_state, count;
> +	unsigned int state, actual_state;
>  
> -	for (count = 0; count < 500; count++) {
> +	for (; ;) {
>  		state = snd_hdac_codec_read(codec, nid, 0,
>  				AC_VERB_GET_POWER_STATE, 0);
>  		if (state & AC_PWRST_ERROR) {
> -- 
> 1.9.1
>
Chris Wilson Feb. 13, 2018, 9:45 a.m. UTC | #2
Quoting Patchwork (2018-02-13 09:42:41)
> == Series Details ==
> 
> Series: ALSA: hda: Remove finite loop from snd_hdac_sync_power_state()
> URL   : https://patchwork.freedesktop.org/series/38140/
> State : success
> 
> == Summary ==
> 
> Series 38140v1 ALSA: hda: Remove finite loop from snd_hdac_sync_power_state()
> https://patchwork.freedesktop.org/api/1.0/series/38140/revisions/1/mbox/
[snip]
> == Logs ==
> 
> For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7990/issues.html

In case it's not clear, this did not fix the pm regression. Odd!
-Chris
Abhijeet Kumar Feb. 13, 2018, 10:12 a.m. UTC | #3
On 2/13/2018 3:15 PM, Chris Wilson wrote:
> Quoting Patchwork (2018-02-13 09:42:41)
>> == Series Details ==
>>
>> Series: ALSA: hda: Remove finite loop from snd_hdac_sync_power_state()
>> URL   : https://patchwork.freedesktop.org/series/38140/
>> State : success
>>
>> == Summary ==
>>
>> Series 38140v1 ALSA: hda: Remove finite loop from snd_hdac_sync_power_state()
>> https://patchwork.freedesktop.org/api/1.0/series/38140/revisions/1/mbox/
> [snip]
>> == Logs ==
>>
>> For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7990/issues.html
> In case it's not clear, this did not fix the pm regression. Odd!
> -Chris
Strange. I believe the theory i was expecting doesn't hold strong.
Nevertheless shared another patch which makes the new function look 
exactly similar to the original one.

Hoping to see diff in behavior.
Saarinen, Jani Feb. 13, 2018, 10:36 a.m. UTC | #4
Hi, 
Still fails. 

> -----Original Message-----

> From: Intel-gfx [mailto:intel-gfx-bounces@lists.freedesktop.org] On Behalf Of

> Patchwork

> Sent: tiistai 13. helmikuuta 2018 11.43

> To: Kumar, Abhijeet <abhijeet.kumar@intel.com>

> Cc: intel-gfx@lists.freedesktop.org

> Subject: [Intel-gfx] ✓ Fi.CI.BAT: success for ALSA: hda: Remove finite loop from

> snd_hdac_sync_power_state()

> 

> == Series Details ==

> 

> Series: ALSA: hda: Remove finite loop from snd_hdac_sync_power_state()

> URL   : https://patchwork.freedesktop.org/series/38140/

> State : success

> 

> == Summary ==

> 

> Series 38140v1 ALSA: hda: Remove finite loop from

> snd_hdac_sync_power_state()

> https://patchwork.freedesktop.org/api/1.0/series/38140/revisions/1/mbox/

> 

> fi-bdw-5557u     total:288  pass:265  dwarn:0   dfail:0   fail:2   skip:21  time:449s

https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7990/all.html

> fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:423s

> fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:375s

> fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:494s

> fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:289s

> fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:478s

> fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:486s

> fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:475s

> fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:459s

> fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:569s

> fi-cnl-y3        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:585s

> fi-elk-e7500     total:288  pass:229  dwarn:0   dfail:0   fail:0   skip:59  time:415s

> fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:285s

> fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:510s

> fi-hsw-4770      total:288  pass:259  dwarn:0   dfail:0   fail:2   skip:27  time:413s

https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7990/all.html

> fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:414s

> fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:463s

> 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:459s

> fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:496s

> fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:507s

> fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:590s

> fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:431s

> fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:513s

> fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:529s

> fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:489s

> fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:498s

> fi-skl-guc       total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:417s

> fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:429s

> 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:401s

> Blacklisted hosts:

> fi-glk-dsi       total:117  pass:104  dwarn:0   dfail:0   fail:0   skip:12

> 

> 013536408c7f1cd9049580cfc71865fcdeb86fa0 drm-tip: 2018y-02m-13d-07h-

> 39m-27s UTC integration manifest

> 8af4811b4156 ALSA: hda: Remove finite loop from

> snd_hdac_sync_power_state()

> 

> == Logs ==

> 

> For more details see: https://intel-gfx-ci.01.org/tree/drm-

> tip/Patchwork_7990/issues.html

> _______________________________________________

> Intel-gfx mailing list

> Intel-gfx@lists.freedesktop.org

> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/sound/hda/hdac_device.c b/sound/hda/hdac_device.c
index 7ba100bb1c3f..5a1dd570cea7 100644
--- a/sound/hda/hdac_device.c
+++ b/sound/hda/hdac_device.c
@@ -1079,9 +1079,9 @@  unsigned int snd_hdac_sync_power_state(struct hdac_device *codec,
 			hda_nid_t nid, unsigned int power_state)
 {
 	unsigned long end_time = jiffies + msecs_to_jiffies(500);
-	unsigned int state, actual_state, count;
+	unsigned int state, actual_state;
 
-	for (count = 0; count < 500; count++) {
+	for (; ;) {
 		state = snd_hdac_codec_read(codec, nid, 0,
 				AC_VERB_GET_POWER_STATE, 0);
 		if (state & AC_PWRST_ERROR) {