Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756320AbYGGQj2 (ORCPT ); Mon, 7 Jul 2008 12:39:28 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754395AbYGGQjQ (ORCPT ); Mon, 7 Jul 2008 12:39:16 -0400 Received: from mx2.suse.de ([195.135.220.15]:55476 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754459AbYGGQjP (ORCPT ); Mon, 7 Jul 2008 12:39:15 -0400 Date: Mon, 07 Jul 2008 18:39:09 +0200 Message-ID: From: Takashi Iwai To: Thadeu Lima de Souza Cascardo Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] Wait for all codecs to be ready if doing a cold reset In-Reply-To: <20080706171548.GA9962@vespa.holoscopio.com> References: <20080706171548.GA9962@vespa.holoscopio.com> User-Agent: Wanderlust/2.12.0 (Your Wildest Dreams) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-8859-4?Q?Sanj=F2?=) APEL/10.6 Emacs/22.2 (x86_64-suse-linux-gnu) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2635 Lines: 79 At Sun, 6 Jul 2008 14:15:56 -0300, Thadeu Lima de Souza Cascardo wrote: > > 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. Thanks for the patch. But, I still don't figure out why this is needed. In the else block (with the comment "resume phase"), you can find the loop to wait for the all *probed* codecs. The difference with the code you moved is that it checks only the bits corresponding to the already probed codecs. In other words, the other bits should be irrelevant with the hardware. I guess it's not about the loop but the additional 1/4 sec delay that did fix the resume on your device. Please check how is the status bits and whether it passed the loop in the middle. Takashi > --- > 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 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/