[alsa-devel] Fwd: Possible bug in sound/pci/atiixp.c ?

Takashi Iwai tiwai at suse.de
Fri Mar 11 15:44:25 CET 2011


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?


thanks,

Takashi


More information about the Alsa-devel mailing list