Re: [PATCH] Wait for all codecs to be ready if doing a cold reset

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Thadeu Lima de Souza Cascardo <cascardo@...>
Cc: <linux-kernel@...>
Date: Tuesday, July 15, 2008 - 7:47 pm

At Wed, 9 Jul 2008 14:26:38 -0300,
Thadeu Lima de Souza Cascardo wrote:

Thanks.

Meanwhile, I reconsidered about this problem.  I think the check of
the whole "active" codec slots can be done better in a way like the
following.  Could you give it a try?

If this still doesn't work, I suspect it's really the matter of
additional delay.


thanks,

Takashi
---
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
index 048d99e..a282c7c 100644
--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -404,6 +404,7 @@ struct intel8x0 {
 	unsigned int *codec_bit;
 	unsigned int codec_isr_bits;
 	unsigned int codec_ready_bits;
+	unsigned int codec_init_bits;
 
 	spinlock_t reg_lock;
 	
@@ -2278,7 +2279,7 @@ static void do_ali_reset(struct intel8x0 *chip)
 static int snd_intel8x0_ich_chip_init(struct intel8x0 *chip, int probing)
 {
 	unsigned long end_time;
-	unsigned int cnt, status, nstatus;
+	unsigned int cnt, status;
 	
 	/* put logic to right state */
 	/* first clear status bits */
@@ -2344,20 +2345,15 @@ static int snd_intel8x0_ich_chip_init(struct intel8x0 *chip, int probing)
 			status |= igetdword(chip, ICHREG(GLOB_STA)) &
 				chip->codec_isr_bits;
 		}
-
+		chip->codec_init_bits = status;
 	} else {
 		/* resume phase */
-		int i;
-		status = 0;
-		for (i = 0; i < chip->ncodecs; i++)
-			if (chip->ac97[i])
-				status |= chip->codec_bit[chip->ac97_sdin[i]];
 		/* wait until all the probed codecs are ready */
 		end_time = jiffies + HZ;
 		do {
-			nstatus = igetdword(chip, ICHREG(GLOB_STA)) &
+			status = igetdword(chip, ICHREG(GLOB_STA)) &
 				chip->codec_isr_bits;
-			if (status == nstatus)
+			if (status == chip->codec_init_bits)
 				break;
 			schedule_timeout_uninterruptible(1);
 		} while (time_after_eq(end_time, jiffies));
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] Wait for all codecs to be ready if doing a cold ..., Thadeu Lima de Souza Cascardo..., (Wed Jul 9, 1:26 pm)
Re: [PATCH] Wait for all codecs to be ready if doing a cold ..., Takashi Iwai, (Tue Jul 15, 7:47 pm)
Re: [PATCH] Wait for all codecs to be ready if doing a cold ..., Thadeu Lima de Souza Cascardo..., (Mon Jul 14, 8:10 pm)