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

Amir Shamsuddin AmirS2+alsa at gmail.com
Fri Mar 11 15:50:52 CET 2011


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.

regards,

Amir

> thanks,
>
> Takashi
>


More information about the Alsa-devel mailing list