All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Gou Zhuang <gouzhuang@bigfoot.com>
Cc: alsa-devel@lists.sourceforge.net
Subject: Re: Oops on resume, X crashes
Date: Fri, 24 Oct 2003 12:12:26 +0200	[thread overview]
Message-ID: <s5hoew77xmd.wl@alsa2.suse.de> (raw)
In-Reply-To: <3F98BC91.3090606@bigfoot.com>

[-- Attachment #1: Type: text/plain, Size: 524 bytes --]

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

[-- Attachment #2: pm-oops-fix2.dif --]
[-- Type: application/octet-stream, Size: 1343 bytes --]

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 */

  reply	other threads:[~2003-10-24 10:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-20  7:48 Oops on resume, X crashes Gou Zhuang
2003-10-20 14:48 ` Takashi Iwai
     [not found]   ` <3F94F094.80109@Sun.COM>
2003-10-21 11:29     ` Takashi Iwai
2003-10-23  9:12       ` Gou Zhuang
2003-10-23 18:01         ` Takashi Iwai
2003-10-24  5:45           ` Gou Zhuang
2003-10-24 10:12             ` Takashi Iwai [this message]
2003-10-27  1:03               ` Gou Zhuang
  -- strict thread matches above, loose matches on Subject: below --
2003-10-20  6:42 Gou Zhuang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5hoew77xmd.wl@alsa2.suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=gouzhuang@bigfoot.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.