From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: Oops on resume, X crashes Date: Thu, 23 Oct 2003 20:01:03 +0200 Sender: alsa-devel-admin@lists.sourceforge.net Message-ID: References: <3F939367.80804@bigfoot.com> <3F94F094.80109@Sun.COM> <3F979B68.9030006@bigfoot.com> Mime-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: multipart/mixed; boundary="Multipart_Thu_Oct_23_20:01:03_2003-1" Return-path: In-Reply-To: <3F979B68.9030006@bigfoot.com> Errors-To: alsa-devel-admin@lists.sourceforge.net List-Help: List-Post: List-Subscribe: , List-Unsubscribe: , List-Archive: To: Gou Zhuang Cc: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org --Multipart_Thu_Oct_23_20:01:03_2003-1 Content-Type: text/plain; charset=US-ASCII At Thu, 23 Oct 2003 17:12:08 +0800, Gou Zhuang wrote: > I turned on OSS_DEBUG in pcm_oss.c. I did not start X this time, I only started artsd from > console to reproduce the oops. Below is the messages after resume, my comments are marked > with <<<--------- > > ------------------------- > MYDEBUG intel8x0.c:2141: Entering intel8x0_suspend() > MYDEBUG intel8x0.c:2149: Call snd_pcm_suspend_all() on Intel 82801CA-ICH3 > MYDEBUG intel8x0.c:2149: Call snd_pcm_suspend_all() on Intel 82801CA-ICH3 - MIC ADC > MYDEBUG intel8x0.c:2152: Call snd_power_change_state(card, SNDRV_CTL_POWER_D3hot) > MYDEBUG intel8x0.c:2154: Return from snd_power_change_state() > pcm_oss: ioctl = 0x8010500c > pcm_oss: space: bytes = 7168, fragments = 7, fragstotal = 7, fragsize = 1024 > pcm_oss: write: recovering from SUSPEND > ALSA pcm_oss.c:552: snd_pcm_oss_prepare: SNDRV_PCM_IOCTL_PREPARE failed > pcm_oss: write 1024 bytes (wrote -11 bytes) <<<----------- IT SEEMS THE WRITE FAILED! that's ok, because it's opened with non-block mode. > MYDEBUG intel8x0.c:2162: Entering intel8x0_resume() > MYDEBUG intel8x0.c:2167: Call pci_enable_device(chip->pci) > PCI: Found IRQ 11 for device 00:1f.5 > PCI: Sharing IRQ 11 with 00:1f.6 > MYDEBUG intel8x0.c:2169: Call pci_set_master(chip->pci) > PCI: Setting latency timer of device 00:1f.5 to 64 > MYDEBUG intel8x0.c:2067: Entering snd_intel8x0_chip_init() > MYDEBUG ../../alsa-kernel/pci/ac97/ac97_codec.c:2148: Entering snd_ac97_resume() > MYDEBUG ../../alsa-kernel/pci/ac97/ac97_codec.c:2148: Entering snd_ac97_resume() > MYDEBUG intel8x0.c:2177: Call snd_power_change_state(card, SNDRV_CTL_POWER_D0) ok, i think i found a bug. please try the attached patch. Takashi --Multipart_Thu_Oct_23_20:01:03_2003-1 Content-Type: application/octet-stream Content-Disposition: attachment; filename="pm-oops-fix.dif" Content-Transfer-Encoding: 7bit Index: alsa-kernel/core/init.c =================================================================== RCS file: /suse/tiwai/cvs/alsa/alsa-kernel/core/init.c,v retrieving revision 1.35 diff -u -r1.35 init.c --- alsa-kernel/core/init.c 23 Oct 2003 17:00:13 -0000 1.35 +++ alsa-kernel/core/init.c 23 Oct 2003 17:55:43 -0000 @@ -679,6 +679,7 @@ int snd_power_wait(snd_card_t *card, unsigned int power_state, struct file *file) { wait_queue_t wait; + int result = 0; /* fastpath */ if (snd_power_get_state(card) == power_state) @@ -686,18 +687,22 @@ init_waitqueue_entry(&wait, current); add_wait_queue(&card->power_sleep, &wait); while (1) { - if (card->shutdown) - return -ENODEV; - if (snd_power_get_state(card) == power_state) { - remove_wait_queue(&card->power_sleep, &wait); - return 0; + if (card->shutdown) { + result = -ENODEV; + break; + } + if (snd_power_get_state(card) == power_state) + break; + if (file && (file->f_flags & O_NONBLOCK)) { + result = -EAGAIN; + break; } - if (file && (file->f_flags & O_NONBLOCK)) - return -EAGAIN; set_current_state(TASK_UNINTERRUPTIBLE); snd_power_unlock(card); schedule_timeout(30 * HZ); snd_power_lock(card); } + remove_wait_queue(&card->power_sleep, &wait); + return result; } #endif /* CONFIG_PM */ --Multipart_Thu_Oct_23_20:01:03_2003-1-- ------------------------------------------------------- This SF.net email is sponsored by: The SF.net Donation Program. Do you like what SourceForge.net is doing for the Open Source Community? Make a contribution, and help us add new features and functionality. Click here: http://sourceforge.net/donate/