Re: [Intel-gfx] [PATCH 2/2] redo

2018-02-13 Thread Chris Wilson
Quoting Chris Wilson (2018-02-13 19:29:18)
> ---
>  sound/pci/hda/hda_codec.c | 7 +--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
> index e018ecbf78a8..afa5f5155220 100644
> --- a/sound/pci/hda/hda_codec.c
> +++ b/sound/pci/hda/hda_codec.c
> @@ -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;
> +   }

This was just to demonstrate that applying the obvious functional
changes from the common routine to hda_codec.c didn't break it.
-Chris
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 2/2] redo

2018-02-13 Thread Chris Wilson
---
 sound/pci/hda/hda_codec.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index e018ecbf78a8..afa5f5155220 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -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;
-- 
2.16.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx