[alsa-devel] Fwd: Possible bug in sound/pci/atiixp.c ?
Takashi Iwai
tiwai at suse.de
Mon Mar 14 15:05:11 CET 2011
At Mon, 14 Mar 2011 09:35:08 +0000,
Amir Shamsuddin wrote:
>
> On Fri, Mar 11, 2011 at 2:50 PM, Amir Shamsuddin <AmirS2+alsa at gmail.com> wrote:
> > On Fri, Mar 11, 2011 at 2:44 PM, Takashi Iwai <tiwai at suse.de> wrote:
> >> At Fri, 11 Mar 2011 11:04:27 +0000,
> >> Amir Shamsuddin wrote:
> >>>
> >>> Hi,
> >>>
> >>> My laptop occasionally fails to resume from suspend, and when it does,
> >>> I see (only) this error message on screen:
> >>>
> >>> [nnn.nnn] atiixp: codec reset timeout
> >>>
> >>> I had a look at the code where this comes from, and while I'm not sure
> >>> it's related to my resume problem, it does (to my untrained eyes) look
> >>> like there is a small bug in the function snd_atiixp_aclink_reset in
> >>> file sound/pci/atiixp.c:
> >>>
> >>> (lines 500 - 536 in latest git)
> >>> static int snd_atiixp_aclink_reset(struct atiixp *chip)
> >>> {
> >>> int timeout;
> >>> [snip]
> >>> timeout = 10;
> >>> while (! (atiixp_read(chip, CMD) & ATI_REG_CMD_ACLINK_ACTIVE)) {
> >>> /* do a hard reset */
> >>> [snip]
> >>> if (--timeout) {
> >>> snd_printk(KERN_ERR "atiixp: codec reset timeout\n");
> >>> break;
> >>> }
> >>> }
> >>> [snip]
> >>> }
> >>>
> >>> Surely the timeout condition should be negated, so the timeout message
> >>> and loop break is only hit when 'timeout' reaches zero? ie.
> >>>
> >>> if (! --timeout) {
> >>>
> >>> Or am I missing something?
> >>
> >> Indeed it's a bug. Does the message go away when you change it?
> >
> > I haven't tried a new kernel with it fixed yet (I'm not usually a
> > kernel developer), but I'll give it a go and try and trigger the
> > resume bug and let you know what happens.
>
> I've tried it now, the message does go away with the fix in.
>
> Unfortunately it doesn't help my laptop resume, but I think that's a
> separate problem!
Thanks for testing.
Takashi
More information about the Alsa-devel
mailing list