The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Thadeu Lima de Souza Cascardo <cascardo@minaslivre.org>
To: Takashi Iwai <tiwai@suse.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Wait for all codecs to be ready if doing a cold reset
Date: Wed, 9 Jul 2008 14:26:38 -0300	[thread overview]
Message-ID: <20080709172637.GA5355@vespa.holoscopio.com> (raw)
In-Reply-To: <s5h63rezzlb.wl%tiwai@suse.de>

[-- Attachment #1: Type: text/plain, Size: 3903 bytes --]

On Wed, Jul 09, 2008 at 08:23:12PM +0200, Takashi Iwai wrote:
> At Tue, 8 Jul 2008 14:31:22 -0300,
> Thadeu Lima de Souza Cascardo wrote:
> > 
> > On Wed, Jul 09, 2008 at 05:07:17PM +0200, Takashi Iwai wrote:
> > > At Tue, 8 Jul 2008 13:59:32 -0300,
> > > Thadeu Lima de Souza Cascardo wrote:
> > > > 
> > > > On Tue, Jul 08, 2008 at 12:16:35PM +0200, Takashi Iwai wrote:
> > > > > At Mon, 7 Jul 2008 14:36:55 -0300,
> > > > > Thadeu Lima de Souza Cascardo wrote:
> > > > > > 
> > > > > > On Mon, Jul 07, 2008 at 06:39:09PM +0200, Takashi Iwai wrote:
> > > > > > > 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
> > > > > > > 
> > > > > > > 
> > > > > > 
> > > > > > The 1/4 sec delay came in my mind as one of the possible reasons, and
> > > > > > that's why I've made some tests. status and nstatus are 0x200, while
> > > > > > codec_isr_bits is 0x300. The loop waits for the status register give us
> > > > > > 0x300 as the active codecs, instead of the only one probed. Since the
> > > > > > cold reset in the case of a power saving cleans up all codec registers,
> > > > > > it is needed that we wait for all codecs again (like in the probe case).
> > > > > 
> > > > > You loaded the modem driver as well?
> > > > > If so, what happens if you unload modem driver?
> > > > > 
> > > > > 
> > > > > thanks,
> > > > > 
> > > > > Takashi
> > > > > 
> > > > 
> > > > The modem driver has always been loaded. Unloading it with my patch
> > > > works OK.
> > > 
> > > Well, I meant to unload the modem driver *without* your patch.
> > > That is, does it the unmodified version work if you unload the modem
> > > driver beforehand (e.g. adding it to blacklist)?
> > > 
> > > 
> > > thanks,
> > > 
> > > Takashi
> > > 
> > 
> > I blacklisted snd_intel8x0m, rebooted, it was not loaded, sound worked.
> > Suspended, resumed, sound didn't work, as usual.
> 
> Thanks for checking.
> 
> I still don't understand why you need to wait for all codecs.
> Certainly the secondary one is the modem codec, and it has nothing to
> do with the audio codec...
> 
> I don't mind to apply the patch as is since it's harmless except for
> the extra delay.  But, the real question is whether it's the codec
> probe or just another delay.
> 
> Note that not all devices have codecs filling all slots like yours.
> On the later ICH, it has three slots while usually two of them are
> used.  So, on these hardwares, your code results always in just a 25ms
> delay.
> 
> Anyway, could you give your sign-off?
> 
> 
> thanks,
> 
> Takashi


Maybe we could treat this as a quirk in my device, which is 8086:2485?

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@minaslivre.org>

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

  parent reply	other threads:[~2008-07-09 17:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-06 17:15 [PATCH] Wait for all codecs to be ready if doing a cold reset Thadeu Lima de Souza Cascardo
2008-07-07 16:39 ` 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 [this message]
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=20080709172637.GA5355@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