From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: Oops on resume, X crashes Date: Fri, 24 Oct 2003 12:12:26 +0200 Sender: alsa-devel-admin@lists.sourceforge.net Message-ID: References: <3F939367.80804@bigfoot.com> <3F94F094.80109@Sun.COM> <3F979B68.9030006@bigfoot.com> <3F98BC91.3090606@bigfoot.com> Mime-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: multipart/mixed; boundary="Multipart_Fri_Oct_24_12:12:26_2003-1" Return-path: In-Reply-To: <3F98BC91.3090606@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_Fri_Oct_24_12:12:26_2003-1 Content-Type: text/plain; charset=US-ASCII At Fri, 24 Oct 2003 13:45:53 +0800, Gou Zhuang wrote: > > I applied the patch, the oops went away :) But I still get a lot of > "ALSA pcm_oss.c:552: snd_pcm_oss_prepare: SNDRV_PCM_IOCTL_PREPARE failed". > > And the artsd crashed after resume with the following errmsg: > > Sound Server fatal error: > AudioSubSystem::handleIO: write failed > len = 16, can_write = 24, errno = 4 (interrupted system call) > > Do you have any clue on this? how about the attached patch? (in replacement with the previous one.) Takashi --Multipart_Fri_Oct_24_12:12:26_2003-1 Content-Type: application/octet-stream Content-Disposition: attachment; filename="pm-oops-fix2.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 24 Oct 2003 10:11:03 -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,24 @@ 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 (file && (file->f_flags & O_NONBLOCK)) - return -EAGAIN; + if (snd_power_get_state(card) == power_state) + break; +#if 0 /* block all devices */ + if (file && (file->f_flags & O_NONBLOCK)) { + result = -EAGAIN; + break; + } +#endif 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_Fri_Oct_24_12:12:26_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/