mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andris Pavenis <pavenis@latnet.lv>
To: Doug Ledford <dledford@redhat.com>
Cc: linux-kernel@vger.kernel.org
Subject: i810_audio.c v0.11 is still broken (deadlocks)
Date: Fri, 7 Dec 2001 12:21:40 +0200	[thread overview]
Message-ID: <200112071021.fB7ALeH00823@hal.astr.lu.lv> (raw)

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

Downloaded i810_audio.c v0.11 this morning. 

After loading it I'm getting system deadlock immediatelly after first attempt 
to use sound support as i810_write() calls i810_update_lvi() without setting
PCM_ENABLE_INPUT bit. Added setting this bit in i810_write() and
also some protection against deadlocks in __i810_update_lvi() with 
corresponding error message (see attached diffs).

Results: sound seems to work as far as I have tested for not a very long time.

I'm still getting messages that __i810_update_lvi() is called without setting
PCM_ENABLE_INPUT (which would cause deadlock without protection
I added there).

Andris

[-- Attachment #2: i810_audio.c.diff --]
[-- Type: text/x-diff, Size: 856 bytes --]

--- i810_audio.c-0.11	Fri Dec  7 08:29:51 2001
+++ i810_audio.c	Fri Dec  7 11:28:32 2001
@@ -959,7 +959,11 @@
 		} else {
 			__start_dac(state);
 		}
-		while( !(inb(port + OFF_CR) & ((1<<4) | (1<<2))) ) ;
+		if (dmabuf->trigger & PCM_ENABLE_INPUT) {
+    			while( !(inb(port + OFF_CR) & ((1<<4) | (1<<2))) ) ;
+		} else {
+			printk (KERN_ERR "i810_audio: __i810_update_lvi called without setting PCM_ENABLE_INPUT\n");
+		}
 	}
 
 	/* swptr - 1 is the tail of our transfer */
@@ -1509,6 +1513,12 @@
 		x = dmabuf->fragsize - (swptr % dmabuf->fragsize);
 		memset(dmabuf->rawbuf + swptr, '\0', x);
 	}
+	// There is data waiting to be played
+	/*
+	 * Force the trigger setting since we would
+	 * deadlock with it set any other way
+	 */
+	dmabuf->trigger = PCM_ENABLE_OUTPUT;
 	i810_update_lvi(state,0);
 ret:
         set_current_state(TASK_RUNNING);

             reply	other threads:[~2001-12-07 10:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-07 10:21 Andris Pavenis [this message]
2001-12-07 13:07 ` Andris Pavenis

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=200112071021.fB7ALeH00823@hal.astr.lu.lv \
    --to=pavenis@latnet.lv \
    --cc=dledford@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®