The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Thadeu Lima de Souza Cascardo <cascardo@minaslivre.org>
To: linux-kernel@vger.kernel.org
Cc: tiwai@suse.de
Subject: [PATCH] Wait for all codecs to be ready if doing a cold reset
Date: Sun, 6 Jul 2008 14:15:56 -0300	[thread overview]
Message-ID: <20080706171548.GA9962@vespa.holoscopio.com> (raw)

If AC97_POWER_SAVE is enabled, intel8x0 does a cold reset when
initializing the codecs. While resuming, it does not wait for all codecs
to be active. Sound card does not work after a resume without it,
however. This patch fixes it.
---
 sound/pci/intel8x0.c |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
index 048d99e..7228a0a 100644
--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -2335,16 +2335,6 @@ static int snd_intel8x0_ich_chip_init(struct intel8x0 *chip, int probing)
 				   igetdword(chip, ICHREG(GLOB_STA)));
 			return -EIO;
 		}
-
-		/* wait for other codecs ready status. */
-		end_time = jiffies + HZ / 4;
-		while (status != chip->codec_isr_bits &&
-		       time_after_eq(end_time, jiffies)) {
-			schedule_timeout_uninterruptible(1);
-			status |= igetdword(chip, ICHREG(GLOB_STA)) &
-				chip->codec_isr_bits;
-		}
-
 	} else {
 		/* resume phase */
 		int i;
@@ -2363,6 +2353,20 @@ static int snd_intel8x0_ich_chip_init(struct intel8x0 *chip, int probing)
 		} while (time_after_eq(end_time, jiffies));
 	}
 
+#ifndef CONFIG_SND_AC97_POWER_SAVE
+	if (probing)
+#endif
+	{
+		/* wait for other codecs ready status. */
+		end_time = jiffies + HZ / 4;
+		while (status != chip->codec_isr_bits &&
+		       time_after_eq(end_time, jiffies)) {
+			schedule_timeout_uninterruptible(1);
+			status |= igetdword(chip, ICHREG(GLOB_STA)) &
+				chip->codec_isr_bits;
+		}
+	}
+
 	if (chip->device_type == DEVICE_SIS) {
 		/* unmute the output on SIS7012 */
 		iputword(chip, 0x4c, igetword(chip, 0x4c) | 1);
-- 
1.5.6

             reply	other threads:[~2008-07-06 17:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-06 17:15 Thadeu Lima de Souza Cascardo [this message]
2008-07-07 16:39 ` [PATCH] Wait for all codecs to be ready if doing a cold reset Takashi Iwai
2008-07-07 17:36   ` Thadeu Lima de Souza Cascardo
2008-07-08 10:16     ` Takashi Iwai
2008-07-08 16:59       ` Thadeu Lima de Souza Cascardo
2008-07-09 15:07         ` Takashi Iwai
2008-07-08 17:31           ` Thadeu Lima de Souza Cascardo
     [not found]             ` <s5h63rezzlb.wl%tiwai@suse.de>
2008-07-09 17:26               ` Thadeu Lima de Souza Cascardo
2008-07-15 23:47                 ` Takashi Iwai
2008-07-15  0:10                   ` Thadeu Lima de Souza Cascardo
2008-12-17 22:08                     ` Thadeu Lima de Souza Cascardo
2008-12-18  7:18                       ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080706171548.GA9962@vespa.holoscopio.com \
    --to=cascardo@minaslivre.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox