mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] EMU10K1: Juha Rjola's AC3 Passthrough for SMP kernels (against 2.4.8+Rui)
@ 2001-08-11 19:11 Daniel T. Chen
  2001-08-11 22:25 ` [Emu10k1-devel] " Daniel Bertrand
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel T. Chen @ 2001-08-11 19:11 UTC (permalink / raw)
  To: linux-kernel; +Cc: emu10k1-devel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 153 bytes --]

I've rediffed Juha's patch against 2.4.8+Rui's patch.

---
Dan Chen                 crimsun@email.unc.edu
GPG key: www.cs.unc.edu/~chenda/pubkey.gpg.asc

[-- Attachment #2: ac3-smp-fix.diff --]
[-- Type: TEXT/PLAIN, Size: 2974 bytes --]

diff -uNr linux-2.4.8-rui/drivers/sound/emu10k1/audio.c linux-2.4.8-rui-ac3_smp_fix/drivers/sound/emu10k1/audio.c
--- linux-2.4.8-rui/drivers/sound/emu10k1/audio.c	Sat Aug 11 14:46:37 2001
+++ linux-2.4.8-rui-ac3_smp_fix/drivers/sound/emu10k1/audio.c	Sat Aug 11 14:49:47 2001
@@ -1246,8 +1246,11 @@
 
 		spin_lock_irqsave(&woinst->lock, flags);
 
-		if (woinst->format.passthrough && card->pt.state != PT_STATE_INACTIVE)
+		if (woinst->format.passthrough && card->pt.state != PT_STATE_INACTIVE) {
+			spin_lock(&card->pt.lock);
                         emu10k1_pt_stop(card);
+			spin_unlock(&card->pt.lock);
+		}
 
 		if (woinst->state & WAVE_STATE_OPEN) {
 			if (woinst->state & WAVE_STATE_STARTED) {
diff -uNr linux-2.4.8-rui/drivers/sound/emu10k1/efxmgr.c linux-2.4.8-rui-ac3_smp_fix/drivers/sound/emu10k1/efxmgr.c
--- linux-2.4.8-rui/drivers/sound/emu10k1/efxmgr.c	Sat Aug 11 14:46:37 2001
+++ linux-2.4.8-rui-ac3_smp_fix/drivers/sound/emu10k1/efxmgr.c	Sat Aug 11 14:51:20 2001
@@ -197,15 +197,15 @@
 		u32 bc;
 		bc = sblive_readptr(card, GPR_BASE + card->pt.intr_gpr, 0);
 		if (bc != 0) {
-			spin_lock_irqsave(&card->lock, flags);
+			DPD(3, "pt interrupt, bc = %d\n", bc);
+			spin_lock_irqsave(&card->pt.lock, flags);
 			card->pt.blocks_played = bc;
 			if (card->pt.blocks_played >= card->pt.blocks_copied) {
 				DPF(1, "buffer underrun in passthrough playback\n");
 				emu10k1_pt_stop(card);
 			}
 			wake_up_interruptible(&card->pt.wait);
-			spin_unlock_irqrestore(&card->lock, flags);
-			DPD(3, "pt interrupt, bc = %d\n", bc);
+			spin_unlock_irqrestore(&card->pt.lock, flags);
 		}
 	}
 }
diff -uNr linux-2.4.8-rui/drivers/sound/emu10k1/main.c linux-2.4.8-rui-ac3_smp_fix/drivers/sound/emu10k1/main.c
--- linux-2.4.8-rui/drivers/sound/emu10k1/main.c	Sat Aug 11 14:47:27 2001
+++ linux-2.4.8-rui-ac3_smp_fix/drivers/sound/emu10k1/main.c	Sat Aug 11 14:51:55 2001
@@ -775,6 +775,7 @@
 	card->pt.intr_gpr_name = "count";
 	card->pt.enable_gpr_name = "enable";
 	card->pt.pos_gpr_name = "ptr";
+	spin_lock_init(&card->pt.lock);
 	init_waitqueue_head(&card->pt.wait);
 
 /*	tmp = sblive_readfn0(card, HCFG);
diff -uNr linux-2.4.8-rui/drivers/sound/emu10k1/passthrough.c linux-2.4.8-rui-ac3_smp_fix/drivers/sound/emu10k1/passthrough.c
--- linux-2.4.8-rui/drivers/sound/emu10k1/passthrough.c	Sat Aug 11 14:46:37 2001
+++ linux-2.4.8-rui-ac3_smp_fix/drivers/sound/emu10k1/passthrough.c	Sat Aug 11 14:53:30 2001
@@ -209,9 +209,7 @@
 {
 	struct pt_data *pt = &card->pt;
 	int i;
-	unsigned long flags;
 
-	spin_lock_irqsave(&card->pt.lock, flags);
 	if (pt->state != PT_STATE_INACTIVE) {
 		DPF(2, "digital pass-through stopped\n");
 		sblive_writeptr(card, GPR_BASE + pt->enable_gpr, 0, 0);
@@ -222,7 +220,6 @@
 		pt->state = PT_STATE_INACTIVE;
 		kfree(pt->buf);
 	}
-	spin_unlock_irqrestore(&card->pt.lock, flags);
 }
 
 void emu10k1_pt_waveout_update(struct emu10k1_wavedevice *wave_dev)

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-08-12  0:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-11 19:11 [PATCH] EMU10K1: Juha Rjola's AC3 Passthrough for SMP kernels (against 2.4.8+Rui) Daniel T. Chen
2001-08-11 22:25 ` [Emu10k1-devel] " Daniel Bertrand
2001-08-11 23:29   ` [Emu10k1-devel] [PATCH] EMU10K1: Juha Rjola's AC3 Passthrough for Alan Cox
2001-08-11 23:53     ` Daniel Bertrand
2001-08-12  0:18       ` Alan Cox

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®