linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] emu10k1 forward port (2.4.20 to 2.5.56)
@ 2003-01-11 12:40 Rui Sousa
  2003-01-15  8:07 ` Mikael Pettersson
  0 siblings, 1 reply; 4+ messages in thread
From: Rui Sousa @ 2003-01-11 12:40 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel

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


Hi,

Since the driver is still in the tree and several people already asked for
it, here is an update to the OSS emu10k1 driver in 2.5.56. This is the 
exactly same driver as in 2.4.20, it fixes a compile warning and a number 
of bugs:

0.17 Fix for mixer SOUND_MIXER_INFO ioctl.
     Fix for HIGHMEM machines (emu10k1 can only do 31 bit bus 
     master) 
     midi poll initial implementation.
     Small mixer fixes/cleanups.
     Improved support for 5.1 cards.
0.18 Fix for possible leak in pci_alloc_consistent()
     Cleaned up poll() functions (audio and midi). Don't start 
     input.
     Restrict DMA pages used to 512Mib range.
     New AC97_BOOST mixer ioctl.
0.19 Real fix for kernel with highmem support (cast dma_handle to 
     u32).
     Fix recording buffering parameters calculation.
     Use unsigned long for variables in bit ops.
0.20 Fixed recording startup
     Fixed timer rate setting (it's a 16-bit register)


Please apply,

Rui

[-- Attachment #2: emu10k1 patch --]
[-- Type: APPLICATION/x-bzip2, Size: 12861 bytes --]

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

* Re: [PATCH] emu10k1 forward port (2.4.20 to 2.5.56)
  2003-01-11 12:40 [PATCH] emu10k1 forward port (2.4.20 to 2.5.56) Rui Sousa
@ 2003-01-15  8:07 ` Mikael Pettersson
  0 siblings, 0 replies; 4+ messages in thread
From: Mikael Pettersson @ 2003-01-15  8:07 UTC (permalink / raw)
  To: Rui Sousa; +Cc: Linus Torvalds, linux-kernel

Rui Sousa writes:
 > Since the driver is still in the tree and several people already asked for
 > it, here is an update to the OSS emu10k1 driver in 2.5.56. This is the 
 > exactly same driver as in 2.4.20, it fixes a compile warning and a number 
 > of bugs:

Tested in kernel 2.5.58 with an SB Live 5.1. Works great with Quake :-)
And it killed those bitops compile warnings, so I'm happy with it.

/Mikael

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

* Re: [PATCH] emu10k1 forward port (2.4.20 to 2.5.56)
  2003-01-15 13:40 Alistair Strachan
@ 2003-01-15 14:31 ` Rui Sousa
  0 siblings, 0 replies; 4+ messages in thread
From: Rui Sousa @ 2003-01-15 14:31 UTC (permalink / raw)
  To: Alistair Strachan; +Cc: linux-kernel

On Wed, 15 Jan 2003, Alistair Strachan wrote:

I'm still not sure if I agree with this change... Couldn't be possible
that even if one __copy_from_user() fails the next one could succeed?
Is it really necessary to return at the first error?

Rui

> Hi,
> 
> This diff applies over the top of Rui's diff to provide the 
> __copy_{to,from}_user fixes present in -dj. The merging of both these diffs 
> would remove all the remaining important emu10k1 changes from -dj.
> 
> Cheers,
> Alistair Strachan.
> 


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

* Re: [PATCH] emu10k1 forward port (2.4.20 to 2.5.56)
@ 2003-01-15 13:40 Alistair Strachan
  2003-01-15 14:31 ` Rui Sousa
  0 siblings, 1 reply; 4+ messages in thread
From: Alistair Strachan @ 2003-01-15 13:40 UTC (permalink / raw)
  To: linux-kernel; +Cc: rui.sousa

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

Hi,

This diff applies over the top of Rui's diff to provide the 
__copy_{to,from}_user fixes present in -dj. The merging of both these diffs 
would remove all the remaining important emu10k1 changes from -dj.

Cheers,
Alistair Strachan.

[-- Attachment #2: emu10k1-dj-fixes.diff --]
[-- Type: text/x-diff, Size: 4052 bytes --]

diff -Nudr -U3 emu10k1-rui/audio.c emu10k1-mine/audio.c
--- emu10k1-rui/audio.c	2003-01-15 13:28:20.000000000 +0000
+++ emu10k1-mine/audio.c	2002-12-22 01:57:12.000000000 +0000
@@ -793,7 +799,7 @@
 				cinfo.blocks = 0;
 			}
 
-			if(wiinst->mmapped)
+			if (wiinst->mmapped)
 				wiinst->buffer.bytestocopy %= wiinst->buffer.fragment_size;
 
 			spin_unlock_irqrestore(&wiinst->lock, flags);
diff -Nudr -U3 emu10k1-rui/cardwi.c emu10k1-mine/cardwi.c
--- emu10k1-rui/cardwi.c	2003-01-15 13:28:20.000000000 +0000
+++ emu10k1-mine/cardwi.c	2002-12-22 01:57:12.000000000 +0000
@@ -307,9 +307,10 @@
 
 static void copy_block(u8 *dst, u8 * src, u32 str, u32 len, u8 cov)
 {
-	if (cov == 1)
-		__copy_to_user(dst, src + str, len);
-	else {
+	if (cov == 1) {
+		if (__copy_to_user(dst, src + str, len))
+			return;
+	} else {
 		u8 byte;
 		u32 i;
 
@@ -317,7 +318,8 @@
 
 		for (i = 0; i < len; i++) {
 			byte = src[2 * i] ^ 0x80;
-			__copy_to_user(dst + i, &byte, 1);
+			if (__copy_to_user(dst + i, &byte, 1))
+				return;
 		}
 	}
 }
diff -Nudr -U3 emu10k1-rui/cardwo.c emu10k1-mine/cardwo.c
--- emu10k1-rui/cardwo.c	2003-01-15 13:28:20.000000000 +0000
+++ emu10k1-mine/cardwo.c	2002-12-22 02:20:50.000000000 +0000
@@ -408,15 +408,17 @@
 
 	if (len > PAGE_SIZE - pgoff) {
 		k = PAGE_SIZE - pgoff;
-		__copy_from_user((u8 *)dst[pg] + pgoff, src, k);
+		if (__copy_from_user((u8 *)dst[pg] + pgoff, src, k))
+			return;
 		len -= k;
 		while (len > PAGE_SIZE) {
-			__copy_from_user(dst[++pg], src + k, PAGE_SIZE);
+			if (__copy_from_user(dst[++pg], src + k, PAGE_SIZE))
+				return;
 			k += PAGE_SIZE;
 			len -= PAGE_SIZE;
 		}
-		__copy_from_user(dst[++pg], src + k, len);
-
+		if (__copy_from_user(dst[++pg], src + k, len))
+			return;
 	} else
 		__copy_from_user((u8 *)dst[pg] + pgoff, src, len);
 }
@@ -440,7 +442,8 @@
 
 	while (len) { 
 		for (voice_num = 0; voice_num < woinst->num_voices; voice_num++) {
-			__copy_from_user((u8 *)(voice[voice_num].mem.addr[pg]) + pgoff, src, woinst->format.bytespervoicesample);
+			if (__copy_from_user((u8 *)(voice[voice_num].mem.addr[pg]) + pgoff, src, woinst->format.bytespervoicesample))
+				return;
 			src += woinst->format.bytespervoicesample;
 		}
 
diff -Nudr -U3 emu10k1-rui/midi.c emu10k1-mine/midi.c
--- emu10k1-rui/midi.c	2003-01-15 13:28:20.000000000 +0000
+++ emu10k1-mine/midi.c	2002-12-22 02:26:58.000000000 +0000
@@ -122,9 +122,8 @@
 		up(&card->open_sem);
 		interruptible_sleep_on(&card->open_wait);
 
-		if (signal_pending(current)) {
+		if (signal_pending(current))
 			return -ERESTARTSYS;
-		}
 
 		down(&card->open_sem);
 	}
diff -Nudr -U3 emu10k1-rui/passthrough.c emu10k1-mine/passthrough.c
--- emu10k1-rui/passthrough.c	2003-01-15 13:28:20.000000000 +0000
+++ emu10k1-mine/passthrough.c	2002-08-31 22:05:03.000000000 +0000
@@ -165,12 +165,15 @@
 
 		DPD(3, "prepend size %d, prepending %d bytes\n", pt->prepend_size, needed);
 		if (count < needed) {
-			copy_from_user(pt->buf + pt->prepend_size, buffer, count);
+			if (copy_from_user(pt->buf + pt->prepend_size, buffer,
+					   count))
+				return -EFAULT;
 			pt->prepend_size += count;
 			DPD(3, "prepend size now %d\n", pt->prepend_size);
 			return count;
 		}
-		copy_from_user(pt->buf + pt->prepend_size, buffer, needed);
+		if (copy_from_user(pt->buf + pt->prepend_size, buffer, needed))
+			return -EFAULT;
 		r = pt_putblock(wave_dev, (u16 *) pt->buf, nonblock);
 		if (r)
 			return r;
@@ -181,7 +184,8 @@
 	blocks_copied = 0;
 	while (blocks > 0) {
 		u16 *bufptr = (u16 *) buffer + (bytes_copied/2);
-		copy_from_user(pt->buf, bufptr, PT_BLOCKSIZE);
+		if (copy_from_user(pt->buf, bufptr, PT_BLOCKSIZE))
+			return -EFAULT;
 		bufptr = (u16 *) pt->buf;
 		r = pt_putblock(wave_dev, bufptr, nonblock);
 		if (r) {
@@ -197,7 +201,8 @@
 	i = count - bytes_copied;
 	if (i) {
 		pt->prepend_size = i;
-		copy_from_user(pt->buf, buffer + bytes_copied, i);
+		if (copy_from_user(pt->buf, buffer + bytes_copied, i))
+			return -EFAULT;
 		bytes_copied += i;
 		DPD(3, "filling prepend buffer with %d bytes", i);
 	}

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

end of thread, other threads:[~2003-01-15 14:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-11 12:40 [PATCH] emu10k1 forward port (2.4.20 to 2.5.56) Rui Sousa
2003-01-15  8:07 ` Mikael Pettersson
2003-01-15 13:40 Alistair Strachan
2003-01-15 14:31 ` Rui Sousa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).