public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Waechtler <pwaechtler@mac.com>
To: Adrian Bunk <bunk@fs.tum.de>, torvalds@transmeta.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: [2.5 patch] fix sound/oss/ics2101.c compilation
Date: 31 Mar 2003 02:04:04 +0200	[thread overview]
Message-ID: <1049068012.2798.13.camel@picklock> (raw)
In-Reply-To: <20030330093048.GF10005@fs.tum.de>

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

On Sun, 2003-03-30 at 11:30, Adrian Bunk wrote:
> On Sun, Mar 23, 2003 at 07:11:03PM +0100, Peter Waechtler wrote:
> > Am Fre, 2003-03-21 um 21.10 schrieb Adrian Bunk:
> > > The following patch fixes the problem for me, please check whether it's 
> > > correct:
> > > 
[patch deleted] 
> > With that patch you do not protect anything.
> > The write_mix function should share the spinlock used in the 
> > interrupt handler.
> 
> This sounds reasonable (I have to admit I didn't look deeply into the 
> code).
> 
> > Do you compile for Uniprocessor? Can you post the relevant config?
> > I don't get a link error with SMP.
> 
> Yes, I'm compiling Uniprocessor. The .config is attached.
> 

There's a problem when compiling the GUS driver into the kernel
instead of as a module. I renamed the global "lock" to "gus_lock"
and made sure that it's used (shared by gus_midi, gus_wave, ics2101)

[snippet of sound/oss/Makefile]
obj-$(CONFIG_SOUND_GUS)         += gus.o ad1848.o
gus-objs        := gus_card.o gus_midi.o gus_vol.o gus_wave.o ics2101.o


Adrian: Do you have a GUS and can test this?



[-- Attachment #2: Type: text/plain, Size: 22429 bytes --]

diff -Nur -X dontdiff vanilla-2.5.66/sound/oss/gus_midi.c linux-2.5.66/sound/oss/gus_midi.c
--- vanilla-2.5.66/sound/oss/gus_midi.c	2003-03-26 19:54:14.000000000 +0100
+++ linux-2.5.66/sound/oss/gus_midi.c	2003-03-31 00:51:33.000000000 +0200
@@ -26,7 +26,6 @@
 static int      my_dev;
 static int      output_used = 0;
 static volatile unsigned char gus_midi_control;
-static spinlock_t lock=SPIN_LOCK_UNLOCKED;
 static void     (*midi_input_intr) (int dev, unsigned char data);
 
 static unsigned char tmp_queue[256];
@@ -35,6 +34,7 @@
 static volatile unsigned char qhead, qtail;
 extern int      gus_base, gus_irq, gus_dma;
 extern int     *gus_osp;
+extern spinlock_t gus_lock;
 
 static int GUS_MIDI_STATUS(void)
 {
@@ -76,7 +76,7 @@
 
 	output_used = 1;
 
-	spin_lock_irqsave(&lock, flags);
+	spin_lock_irqsave(&gus_lock, flags);
 
 	if (GUS_MIDI_STATUS() & MIDI_XMIT_EMPTY)
 	{
@@ -92,7 +92,7 @@
 		outb((gus_midi_control), u_MidiControl);
 	}
 
-	spin_unlock_irqrestore(&lock,flags);
+	spin_unlock_irqrestore(&gus_lock,flags);
 	return ok;
 }
 
@@ -113,14 +113,14 @@
 	/*
 	 * Drain the local queue first
 	 */
-	spin_lock_irqsave(&lock, flags);
+	spin_lock_irqsave(&gus_lock, flags);
 
 	while (qlen && dump_to_midi(tmp_queue[qhead]))
 	{
 		qlen--;
 		qhead++;
 	}
-	spin_unlock_irqrestore(&lock,flags);
+	spin_unlock_irqrestore(&gus_lock,flags);
 
 	/*
 	 *	Output the byte if the local queue is empty.
@@ -140,13 +140,13 @@
 		return 0;	/*
 				 * Local queue full
 				 */
-	spin_lock_irqsave(&lock, flags);
+	spin_lock_irqsave(&gus_lock, flags);
 
 	tmp_queue[qtail] = midi_byte;
 	qlen++;
 	qtail++;
 
-	spin_unlock_irqrestore(&lock,flags);
+	spin_unlock_irqrestore(&gus_lock,flags);
 	return 1;
 }
 
@@ -171,14 +171,14 @@
 	if (!output_used)
 		return 0;
 
-	spin_lock_irqsave(&lock, flags);
+	spin_lock_irqsave(&gus_lock, flags);
 
 	if (qlen && dump_to_midi(tmp_queue[qhead]))
 	{
 		qlen--;
 		qhead++;
 	}
-	spin_unlock_irqrestore(&lock,flags);
+	spin_unlock_irqrestore(&gus_lock,flags);
 	return (qlen > 0) || !(GUS_MIDI_STATUS() & MIDI_XMIT_EMPTY);
 }
 
@@ -224,7 +224,7 @@
 	volatile unsigned char stat, data;
 	int timeout = 10;
 
-	spin_lock(&lock);
+	spin_lock(&gus_lock);
 
 	while (timeout-- > 0 && (stat = GUS_MIDI_STATUS()) & (MIDI_RCV_FULL | MIDI_XMIT_EMPTY))
 	{
@@ -252,5 +252,5 @@
 			}
 		}
 	}
-	spin_unlock(&lock);
+	spin_unlock(&gus_lock);
 }
diff -Nur -X dontdiff vanilla-2.5.66/sound/oss/gus_wave.c linux-2.5.66/sound/oss/gus_wave.c
--- vanilla-2.5.66/sound/oss/gus_wave.c	2002-12-11 15:00:17.000000000 +0100
+++ linux-2.5.66/sound/oss/gus_wave.c	2003-03-31 00:50:27.000000000 +0200
@@ -139,7 +139,7 @@
 static unsigned long pcm_current_buf;
 static int      pcm_current_count;
 static int      pcm_current_intrflag;
-static spinlock_t lock=SPIN_LOCK_UNLOCKED;
+spinlock_t gus_lock=SPIN_LOCK_UNLOCKED;
 
 extern int     *gus_osp;
 
@@ -469,7 +469,7 @@
 {
 	unsigned long   flags;
 
-	spin_lock_irqsave(&lock,flags);
+	spin_lock_irqsave(&gus_lock,flags);
 	gus_select_voice(voice);
 	gus_voice_volume(0);
 	gus_voice_off();
@@ -478,7 +478,7 @@
 	gus_write8(0x0d, 0x03);	/* Ramping off */
 	voice_alloc->map[voice] = 0;
 	voice_alloc->alloc_times[voice] = 0;
-	spin_unlock_irqrestore(&lock,flags);
+	spin_unlock_irqrestore(&gus_lock,flags);
 
 }
 
@@ -512,10 +512,10 @@
 
 	if (voices[voice].mode & WAVE_SUSTAIN_ON && voices[voice].env_phase == 2)
 	{
-		spin_lock_irqsave(&lock,flags);
+		spin_lock_irqsave(&gus_lock,flags);
 		gus_select_voice(voice);
 		gus_rampoff();
-		spin_unlock_irqrestore(&lock,flags);
+		spin_unlock_irqrestore(&gus_lock,flags);
 		return;
 		/*
 		 * Sustain phase begins. Continue envelope after receiving note off.
@@ -533,7 +533,7 @@
 	vol = voices[voice].initial_volume * voices[voice].env_offset[phase] / 255;
 	rate = voices[voice].env_rate[phase];
 
-	spin_lock_irqsave(&lock,flags);
+	spin_lock_irqsave(&gus_lock,flags);
 	gus_select_voice(voice);
 
 	gus_voice_volume(prev_vol);
@@ -545,7 +545,7 @@
 
 	if (((vol - prev_vol) / 64) == 0)	/* No significant volume change */
 	{
-		spin_unlock_irqrestore(&lock,flags);
+		spin_unlock_irqrestore(&gus_lock,flags);
 		step_envelope(voice);		/* Continue the envelope on the next step */
 		return;
 	}
@@ -564,7 +564,7 @@
 		gus_rampon(0x60);	/* Decreasing volume, with IRQ */
 	}
 	voices[voice].current_volume = vol;
-	spin_unlock_irqrestore(&lock,flags);
+	spin_unlock_irqrestore(&gus_lock,flags);
 }
 
 static void init_envelope(int voice)
@@ -595,14 +595,14 @@
 	int instr_no = sample_map[voice], is16bits;
 	long int flags;
 
-	spin_lock_irqsave(&lock,flags);
+	spin_lock_irqsave(&gus_lock,flags);
 	gus_select_voice(voice);
 
 	if (instr_no < 0 || instr_no > MAX_SAMPLE)
 	{
 		gus_write8(0x00, 0x03);	/* Hard stop */
 		voice_alloc->map[voice] = 0;
-		spin_unlock_irqrestore(&lock,flags);
+		spin_unlock_irqrestore(&gus_lock,flags);
 		return;
 	}
 	is16bits = (samples[instr_no].mode & WAVE_16_BITS) ? 1 : 0;	/* 8 or 16 bits */
@@ -610,7 +610,7 @@
 	if (voices[voice].mode & WAVE_ENVELOPES)
 	{
 		start_release(voice);
-		spin_unlock_irqrestore(&lock,flags);
+		spin_unlock_irqrestore(&gus_lock,flags);
 		return;
 	}
 	/*
@@ -621,14 +621,14 @@
 		gus_voice_off();
 		gus_rampoff();
 		gus_voice_init(voice);
-		spin_unlock_irqrestore(&lock,flags);
+		spin_unlock_irqrestore(&gus_lock,flags);
 		return;
 	}
 	gus_ramp_range(65, 4030);
 	gus_ramp_rate(2, 4);
 	gus_rampon(0x40 | 0x20);	/* Down, once, with IRQ */
 	voices[voice].volume_irq_mode = VMODE_HALT;
-	spin_unlock_irqrestore(&lock,flags);
+	spin_unlock_irqrestore(&gus_lock,flags);
 }
 
 static void gus_reset(void)
@@ -660,7 +660,7 @@
 		0, 1, 0, 2, 0, 3, 4, 5
 	};
 
-	spin_lock_irqsave(&lock,flags);
+	spin_lock_irqsave(&gus_lock,flags);
 	gus_write8(0x4c, 0);	/* Reset GF1 */
 	gus_delay();
 	gus_delay();
@@ -799,7 +799,7 @@
 
 	if (iw_mode)
 		gus_write8(0x19, gus_read8(0x19) | 0x01);
-	spin_unlock_irqrestore(&lock,flags);
+	spin_unlock_irqrestore(&gus_lock,flags);
 }
 
 
@@ -1108,16 +1108,16 @@
 {
 	unsigned long flags;
 
-	spin_lock_irqsave(&lock,flags);
+	spin_lock_irqsave(&gus_lock,flags);
 	/* voice_alloc->map[voice] = 0xffff; */
 	if (voices[voice].volume_irq_mode == VMODE_START_NOTE)
 	{
 		voices[voice].kill_pending = 1;
-		spin_unlock_irqrestore(&lock,flags);
+		spin_unlock_irqrestore(&gus_lock,flags);
 	}
 	else
 	{
-		spin_unlock_irqrestore(&lock,flags);
+		spin_unlock_irqrestore(&gus_lock,flags);
 		gus_voice_fade(voice);
 	}
 
@@ -1175,7 +1175,7 @@
 	compute_volume(voice, volume);
 	voices[voice].current_volume = voices[voice].initial_volume;
 
-	spin_lock_irqsave(&lock,flags);
+	spin_lock_irqsave(&gus_lock,flags);
 	/*
 	 * CAUTION! Interrupts disabled. Enable them before returning
 	 */
@@ -1189,7 +1189,7 @@
 	{
 		gus_rampoff();
 		gus_voice_volume(target);
-		spin_unlock_irqrestore(&lock,flags);
+		spin_unlock_irqrestore(&gus_lock,flags);
 		return;
 	}
 	if (ramp_time == FAST_RAMP)
@@ -1202,7 +1202,7 @@
 	{
 		gus_rampoff();
 		gus_voice_volume(target);
-		spin_unlock_irqrestore(&lock,flags);
+		spin_unlock_irqrestore(&gus_lock,flags);
 		return;
 	}
 	if (target > curr)
@@ -1220,7 +1220,7 @@
 		gus_ramp_range(target, curr);
 		gus_rampon(0x40);	/* Ramp down, once, no irq */
 	}
-	spin_unlock_irqrestore(&lock,flags);
+	spin_unlock_irqrestore(&gus_lock,flags);
 }
 
 static void dynamic_volume_change(int voice)
@@ -1228,10 +1228,10 @@
 	unsigned char status;
 	unsigned long flags;
 
-	spin_lock_irqsave(&lock,flags);
+	spin_lock_irqsave(&gus_lock,flags);
 	gus_select_voice(voice);
 	status = gus_read8(0x00);	/* Get voice status */
-	spin_unlock_irqrestore(&lock,flags);
+	spin_unlock_irqrestore(&gus_lock,flags);
 
 	if (status & 0x03)
 		return;		/* Voice was not running */
@@ -1246,10 +1246,10 @@
 	 * Voice is running and has envelopes.
 	 */
 
-	spin_lock_irqsave(&lock,flags);
+	spin_lock_irqsave(&gus_lock,flags);
 	gus_select_voice(voice);
 	status = gus_read8(0x0d);	/* Ramping status */
-	spin_unlock_irqrestore(&lock,flags);
+	spin_unlock_irqrestore(&gus_lock,flags);
 
 	if (status & 0x03)	/* Sustain phase? */
 	{
@@ -1281,10 +1281,10 @@
 				freq = compute_finetune(voices[voice].orig_freq, value, voices[voice].bender_range, 0);
 				voices[voice].current_freq = freq;
 
-				spin_lock_irqsave(&lock,flags);
+				spin_lock_irqsave(&gus_lock,flags);
 				gus_select_voice(voice);
 				gus_voice_freq(freq);
-				spin_unlock_irqrestore(&lock,flags);
+				spin_unlock_irqrestore(&gus_lock,flags);
 			}
 			break;
 
@@ -1441,12 +1441,12 @@
 			((sample_ptrs[sample] + samples[sample].len) / GUS_BANK_SIZE))
 				printk(KERN_ERR "GUS: Sample address error\n");
 	}
-	spin_lock_irqsave(&lock,flags);
+	spin_lock_irqsave(&gus_lock,flags);
 	gus_select_voice(voice);
 	gus_voice_off();
 	gus_rampoff();
 
-	spin_unlock_irqrestore(&lock,flags);
+	spin_unlock_irqrestore(&gus_lock,flags);
 
 	if (voices[voice].mode & WAVE_ENVELOPES)
 	{
@@ -1458,7 +1458,7 @@
 		compute_and_set_volume(voice, volume, 0);
 	}
 
-	spin_lock_irqsave(&lock,flags);
+	spin_lock_irqsave(&gus_lock,flags);
 	gus_select_voice(voice);
 
 	if (samples[sample].mode & WAVE_LOOP_BACK)
@@ -1498,7 +1498,7 @@
 	gus_voice_freq(freq);
 	gus_voice_balance(pan);
 	gus_voice_on(mode);
-	spin_unlock_irqrestore(&lock,flags);
+	spin_unlock_irqrestore(&gus_lock,flags);
 
 	return 0;
 }
@@ -1515,7 +1515,7 @@
 	int mode;
 	int ret_val = 0;
 
-	spin_lock_irqsave(&lock,flags);
+	spin_lock_irqsave(&gus_lock,flags);
 	if (note_num == 255)
 	{
 		if (voices[voice].volume_irq_mode == VMODE_START_NOTE)
@@ -1541,10 +1541,10 @@
 
 		if (voices[voice].sample_pending >= 0)
 		{
-			spin_unlock_irqrestore(&lock,flags);	/* Run temporarily with interrupts enabled */
+			spin_unlock_irqrestore(&gus_lock,flags);	/* Run temporarily with interrupts enabled */
 			guswave_set_instr(voices[voice].dev_pending, voice, voices[voice].sample_pending);
 			voices[voice].sample_pending = -1;
-			spin_lock_irqsave(&lock,flags);
+			spin_lock_irqsave(&gus_lock,flags);
 			gus_select_voice(voice);	/* Reselect the voice (just to be sure) */
 		}
 		if ((mode & 0x01) || (int) ((gus_read16(0x09) >> 4) < (unsigned) 2065))
@@ -1564,7 +1564,7 @@
 			gus_rampon(0x20 | 0x40);	/* Ramp down, once, irq */
 		}
 	}
-	spin_unlock_irqrestore(&lock,flags);
+	spin_unlock_irqrestore(&gus_lock,flags);
 	return ret_val;
 }
 
@@ -1807,7 +1807,7 @@
 					   blk_sz))
 				return -EFAULT;
 
-			spin_lock_irqsave(&lock,flags);
+			spin_lock_irqsave(&gus_lock,flags);
 			gus_write8(0x41, 0);	/* Disable GF1 DMA */
 			DMAbuf_start_dma(gus_devnum, audio_devs[gus_devnum]->dmap_out->raw_buf_phys,
 				blk_sz, DMA_MODE_WRITE);
@@ -1864,7 +1864,7 @@
 			active_device = GUS_DEV_WAVE;
 			gus_write8(0x41, dma_command);	/* Lets go luteet (=bugs) */
 
-			spin_unlock_irqrestore(&lock,flags); /* opens a race */
+			spin_unlock_irqrestore(&gus_lock,flags); /* opens a race */
 			if (!interruptible_sleep_on_timeout(&dram_sleeper, HZ))
 				printk("GUS: DMA Transfer timed out\n");
 		}
@@ -1905,10 +1905,10 @@
 	switch (cmd)
 	{
 		case _GUS_NUMVOICES:
-			spin_lock_irqsave(&lock,flags);
+			spin_lock_irqsave(&gus_lock,flags);
 			gus_select_voice(voice);
 			gus_select_max_voices(p1);
-			spin_unlock_irqrestore(&lock,flags);
+			spin_unlock_irqrestore(&gus_lock,flags);
 			break;
 
 		case _GUS_VOICESAMPLE:
@@ -1916,18 +1916,18 @@
 			break;
 
 		case _GUS_VOICEON:
-			spin_lock_irqsave(&lock,flags);
+			spin_lock_irqsave(&gus_lock,flags);
 			gus_select_voice(voice);
 			p1 &= ~0x20;	/* Don't allow interrupts */
 			gus_voice_on(p1);
-			spin_unlock_irqrestore(&lock,flags);
+			spin_unlock_irqrestore(&gus_lock,flags);
 			break;
 
 		case _GUS_VOICEOFF:
-			spin_lock_irqsave(&lock,flags);
+			spin_lock_irqsave(&gus_lock,flags);
 			gus_select_voice(voice);
 			gus_voice_off();
-			spin_unlock_irqrestore(&lock,flags);
+			spin_unlock_irqrestore(&gus_lock,flags);
 			break;
 
 		case _GUS_VOICEFADE:
@@ -1935,32 +1935,32 @@
 			break;
 
 		case _GUS_VOICEMODE:
-			spin_lock_irqsave(&lock,flags);
+			spin_lock_irqsave(&gus_lock,flags);
 			gus_select_voice(voice);
 			p1 &= ~0x20;	/* Don't allow interrupts */
 			gus_voice_mode(p1);
-			spin_unlock_irqrestore(&lock,flags);
+			spin_unlock_irqrestore(&gus_lock,flags);
 			break;
 
 		case _GUS_VOICEBALA:
-			spin_lock_irqsave(&lock,flags);
+			spin_lock_irqsave(&gus_lock,flags);
 			gus_select_voice(voice);
 			gus_voice_balance(p1);
-			spin_unlock_irqrestore(&lock,flags);
+			spin_unlock_irqrestore(&gus_lock,flags);
 			break;
 
 		case _GUS_VOICEFREQ:
-			spin_lock_irqsave(&lock,flags);
+			spin_lock_irqsave(&gus_lock,flags);
 			gus_select_voice(voice);
 			gus_voice_freq(plong);
-			spin_unlock_irqrestore(&lock,flags);
+			spin_unlock_irqrestore(&gus_lock,flags);
 			break;
 
 		case _GUS_VOICEVOL:
-			spin_lock_irqsave(&lock,flags);
+			spin_lock_irqsave(&gus_lock,flags);
 			gus_select_voice(voice);
 			gus_voice_volume(p1);
-			spin_unlock_irqrestore(&lock,flags);
+			spin_unlock_irqrestore(&gus_lock,flags);
 			break;
 
 		case _GUS_VOICEVOL2:	/* Just update the software voice level */
@@ -1970,48 +1970,48 @@
 		case _GUS_RAMPRANGE:
 			if (voices[voice].mode & WAVE_ENVELOPES)
 				break;	/* NO-NO */
-			spin_lock_irqsave(&lock,flags);
+			spin_lock_irqsave(&gus_lock,flags);
 			gus_select_voice(voice);
 			gus_ramp_range(p1, p2);
-			spin_unlock_irqrestore(&lock,flags);
+			spin_unlock_irqrestore(&gus_lock,flags);
 			break;
 
 		case _GUS_RAMPRATE:
 			if (voices[voice].mode & WAVE_ENVELOPES)
 				break;	/* NJET-NJET */
-			spin_lock_irqsave(&lock,flags);
+			spin_lock_irqsave(&gus_lock,flags);
 			gus_select_voice(voice);
 			gus_ramp_rate(p1, p2);
-			spin_unlock_irqrestore(&lock,flags);
+			spin_unlock_irqrestore(&gus_lock,flags);
 			break;
 
 		case _GUS_RAMPMODE:
 			if (voices[voice].mode & WAVE_ENVELOPES)
 				break;	/* NO-NO */
-			spin_lock_irqsave(&lock,flags);
+			spin_lock_irqsave(&gus_lock,flags);
 			gus_select_voice(voice);
 			p1 &= ~0x20;	/* Don't allow interrupts */
 			gus_ramp_mode(p1);
-			spin_unlock_irqrestore(&lock,flags);
+			spin_unlock_irqrestore(&gus_lock,flags);
 			break;
 
 		case _GUS_RAMPON:
 			if (voices[voice].mode & WAVE_ENVELOPES)
 				break;	/* EI-EI */
-			spin_lock_irqsave(&lock,flags);
+			spin_lock_irqsave(&gus_lock,flags);
 			gus_select_voice(voice);
 			p1 &= ~0x20;	/* Don't allow interrupts */
 			gus_rampon(p1);
-			spin_unlock_irqrestore(&lock,flags);
+			spin_unlock_irqrestore(&gus_lock,flags);
 			break;
 
 		case _GUS_RAMPOFF:
 			if (voices[voice].mode & WAVE_ENVELOPES)
 				break;	/* NEJ-NEJ */
-			spin_lock_irqsave(&lock,flags);
+			spin_lock_irqsave(&gus_lock,flags);
 			gus_select_voice(voice);
 			gus_rampoff();
-			spin_unlock_irqrestore(&lock,flags);
+			spin_unlock_irqrestore(&gus_lock,flags);
 			break;
 
 		case _GUS_VOLUME_SCALE:
@@ -2020,10 +2020,10 @@
 			break;
 
 		case _GUS_VOICE_POS:
-			spin_lock_irqsave(&lock,flags);
+			spin_lock_irqsave(&gus_lock,flags);
 			gus_select_voice(voice);
 			gus_set_voice_pos(voice, plong);
-			spin_unlock_irqrestore(&lock,flags);
+			spin_unlock_irqrestore(&gus_lock,flags);
 			break;
 
 		default:
@@ -2214,12 +2214,12 @@
 	if (pcm_active && pcm_opened)
 		for (voice = 0; voice < gus_audio_channels; voice++)
 		{
-			spin_lock_irqsave(&lock,flags);
+			spin_lock_irqsave(&gus_lock,flags);
 			gus_select_voice(voice);
 			gus_rampoff();
 			gus_voice_volume(1530 + (25 * gus_pcm_volume));
 			gus_ramp_range(65, 1530 + (25 * gus_pcm_volume));
-			spin_unlock_irqrestore(&lock,flags);
+			spin_unlock_irqrestore(&gus_lock,flags);
 		}
 }
 
@@ -2267,7 +2267,7 @@
 			if (chn == 0)
 				ramp_mode[chn] = 0x04;	/* Enable rollover bit */
 		}
-		spin_lock_irqsave(&lock,flags);
+		spin_lock_irqsave(&gus_lock,flags);
 		gus_select_voice(chn);
 		gus_voice_freq(speed);
 
@@ -2304,17 +2304,17 @@
 					 0, is16bits);	/* Loop end location */
 		else
 			mode[chn] |= 0x08;	/* Enable looping */
-		spin_unlock_irqrestore(&lock,flags);
+		spin_unlock_irqrestore(&gus_lock,flags);
 	}
 	for (chn = 0; chn < gus_audio_channels; chn++)
 	{
-		spin_lock_irqsave(&lock,flags);
+		spin_lock_irqsave(&gus_lock,flags);
 		gus_select_voice(chn);
 		gus_write8(0x0d, ramp_mode[chn]);
 		if (iw_mode)
 			gus_write8(0x15, 0x00);	/* Reset voice deactivate bit of SMSI */
 		gus_voice_on(mode[chn]);
-		spin_unlock_irqrestore(&lock,flags);
+		spin_unlock_irqrestore(&gus_lock,flags);
 	}
 	pcm_active = 1;
 }
@@ -2336,7 +2336,7 @@
 	unsigned char dma_command;
 	unsigned long address, hold_address;
 
-	spin_lock_irqsave(&lock,flags);
+	spin_lock_irqsave(&gus_lock,flags);
 
 	count = total_count / gus_audio_channels;
 
@@ -2401,7 +2401,7 @@
 		active_device = GUS_DEV_PCM_CONTINUE;
 	}
 
-	spin_unlock_irqrestore(&lock,flags);
+	spin_unlock_irqrestore(&gus_lock,flags);
 }
 
 static void gus_uninterleave8(char *buf, int l)
@@ -2463,7 +2463,7 @@
 	unsigned long flags;
 	unsigned char mode;
 
-	spin_lock_irqsave(&lock,flags);
+	spin_lock_irqsave(&gus_lock,flags);
 
 	DMAbuf_start_dma(dev, buf, count, DMA_MODE_READ);
 	mode = 0xa0;		/* DMA IRQ enabled, invert MSB */
@@ -2475,7 +2475,7 @@
 	mode |= 0x01;		/* DMA enable */
 
 	gus_write8(0x49, mode);
-	spin_unlock_irqrestore(&lock,flags);
+	spin_unlock_irqrestore(&gus_lock,flags);
 }
 
 static int gus_audio_prepare_for_input(int dev, int bsize, int bcount)
@@ -2571,10 +2571,10 @@
 	freq = compute_finetune(voices[voice].orig_freq, value - 8192, voices[voice].bender_range, 0);
 	voices[voice].current_freq = freq;
 
-	spin_lock_irqsave(&lock,flags);
+	spin_lock_irqsave(&gus_lock,flags);
 	gus_select_voice(voice);
 	gus_voice_freq(freq);
-	spin_unlock_irqrestore(&lock,flags);
+	spin_unlock_irqrestore(&gus_lock,flags);
 }
 
 static int guswave_alloc(int dev, int chn, int note, struct voice_alloc_info *alloc)
@@ -2655,7 +2655,7 @@
 	if (have_gus_max)	/* Don't disturb GUS MAX */
 		return;
 
-	spin_lock_irqsave(&lock,flags);
+	spin_lock_irqsave(&gus_lock,flags);
 
 	/*
 	 *    Enable channels having vol > 10%
@@ -2681,7 +2681,7 @@
 	mix_image |= mask & 0x07;
 	outb((mix_image), u_Mixer);
 
-	spin_unlock_irqrestore(&lock,flags);
+	spin_unlock_irqrestore(&gus_lock,flags);
 }
 
 #define MIX_DEVS	(SOUND_MASK_MIC|SOUND_MASK_LINE| \
@@ -2890,10 +2890,10 @@
 	 *  Versions < 3.6 don't have the digital ASIC. Try to probe it first.
 	 */
 
-	spin_lock_irqsave(&lock,flags);
+	spin_lock_irqsave(&gus_lock,flags);
 	outb((0x20), gus_base + 0x0f);
 	val = inb(gus_base + 0x0f);
-	spin_unlock_irqrestore(&lock,flags);
+	spin_unlock_irqrestore(&gus_lock,flags);
 
 	if (gus_pnp_flag || (val != 0xff && (val & 0x06)))	/* Should be 0x02?? */
 	{
@@ -3124,7 +3124,7 @@
 	unsigned char   tmp;
 	int             mode, parm;
 
-	spin_lock(&lock);
+	spin_lock(&gus_lock);
 	gus_select_voice(voice);
 
 	tmp = gus_read8(0x00);
@@ -3200,7 +3200,7 @@
 		default:
 			break;
 	}
-	spin_unlock(&lock);
+	spin_unlock(&gus_lock);
 }
 
 static void do_volume_irq(int voice)
@@ -3209,7 +3209,7 @@
 	int mode, parm;
 	unsigned long flags;
 
-	spin_lock_irqsave(&lock,flags);
+	spin_lock_irqsave(&gus_lock,flags);
 
 	gus_select_voice(voice);
 	tmp = gus_read8(0x0d);
@@ -3227,18 +3227,18 @@
 		case VMODE_HALT:	/* Decay phase finished */
 			if (iw_mode)
 				gus_write8(0x15, 0x02);	/* Set voice deactivate bit of SMSI */
-			spin_unlock_irqrestore(&lock,flags);
+			spin_unlock_irqrestore(&gus_lock,flags);
 			gus_voice_init(voice);
 			break;
 
 		case VMODE_ENVELOPE:
 			gus_rampoff();
-			spin_unlock_irqrestore(&lock,flags);
+			spin_unlock_irqrestore(&gus_lock,flags);
 			step_envelope(voice);
 			break;
 
 		case VMODE_START_NOTE:
-			spin_unlock_irqrestore(&lock,flags);
+			spin_unlock_irqrestore(&gus_lock,flags);
 			guswave_start_note2(voices[voice].dev_pending, voice,
 				      voices[voice].note_pending, voices[voice].volume_pending);
 			if (voices[voice].kill_pending)
@@ -3254,7 +3254,7 @@
 			break;
 
 		default:
-			spin_unlock_irqrestore(&lock,flags);
+			spin_unlock_irqrestore(&gus_lock,flags);
 	}
 }
 /* called in irq context */
diff -Nur -X dontdiff vanilla-2.5.66/sound/oss/ics2101.c linux-2.5.66/sound/oss/ics2101.c
--- vanilla-2.5.66/sound/oss/ics2101.c	2002-10-02 13:49:21.000000000 +0200
+++ linux-2.5.66/sound/oss/ics2101.c	2003-03-31 00:45:59.000000000 +0200
@@ -29,7 +29,7 @@
 
 extern int     *gus_osp;
 extern int      gus_base;
-extern spinlock_t lock;
+extern spinlock_t gus_lock;
 static int      volumes[ICS_MIXDEVS];
 static int      left_fix[ICS_MIXDEVS] =
 {1, 1, 1, 2, 1, 2};
@@ -87,12 +87,12 @@
 		attn_addr |= 0x03;
 	}
 
-	spin_lock_irqsave(&lock, flags);
+	spin_lock_irqsave(&gus_lock, flags);
 	outb((ctrl_addr), u_MixSelect);
 	outb((selector[dev]), u_MixData);
 	outb((attn_addr), u_MixSelect);
 	outb(((unsigned char) vol), u_MixData);
-	spin_unlock_irqrestore(&lock,flags);
+	spin_unlock_irqrestore(&gus_lock,flags);
 }
 
 static int set_volumes(int dev, int vol)
diff -Nur -X dontdiff vanilla-2.5.66/sound/oss/mad16.c linux-2.5.66/sound/oss/mad16.c
--- vanilla-2.5.66/sound/oss/mad16.c	2003-03-26 19:54:14.000000000 +0100
+++ linux-2.5.66/sound/oss/mad16.c	2003-03-30 22:18:51.000000000 +0200
@@ -537,7 +537,7 @@
 
 	for (i = 0xf8d; i <= 0xf93; i++) {
 		if (!c924pnp)
-			DDB(printk("port %03x = %02x\n", i, mad_read(i)))
+			DDB(printk("port %03x = %02x\n", i, mad_read(i)));
 		else
 			DDB(printk("port %03x = %02x\n", i-0x80, mad_read(i)));
 	}
@@ -600,7 +600,7 @@
 
 	for (i = 0xf8d; i <= 0xf93; i++) {
 		if (!c924pnp)
-			DDB(printk("port %03x after init = %02x\n", i, mad_read(i)))
+			DDB(printk("port %03x after init = %02x\n", i, mad_read(i)));
 		else
 			DDB(printk("port %03x after init = %02x\n", i-0x80, mad_read(i)));
 	}

  reply	other threads:[~2003-03-30 23:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-21 20:10 [2.5 patch] fix sound/oss/ics2101.c compilation Adrian Bunk
2003-03-23 18:11 ` Peter Waechtler
2003-03-30  9:30   ` Adrian Bunk
2003-03-31  0:04     ` Peter Waechtler [this message]
2003-03-31 10:05       ` Adrian Bunk
2003-03-31 12:14         ` [2.5 patch] typo fix for compilation Peter Waechtler

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=1049068012.2798.13.camel@picklock \
    --to=pwaechtler@mac.com \
    --cc=bunk@fs.tum.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox