Skip to contentSkip to conversation

cleanup for i810 chipset for 2.5.5-pre1. Second...

DISCUSSION Pete Zaitcev 1 participant 1 message Feb 15, 2002 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

sound/oss/i810_audio.c line 72

Quoted 12 lines

diff -ur linux-2.5.4/sound/oss/i810_audio.c linux/sound/oss/i810_audio.c

sound/oss/i810_audio.c +1 -1
@@ -66,7 +66,7 @@
  *
  *	This driver is cursed. (Ben LaHaise)
  */
- 
+
 #include <linux/module.h>
 #include <linux/version.h>
 #include <linux/string.h>

Leave the syntax sugar out, will you? It's dledford's job to clean it.

Quoted 11 lines
sound/oss/i810_audio.c +3 -2
@@ -135,14 +135,17 @@
 
 /* the 810's array of pointers to data buffers */
 
+/* Since this structure get's accessed by the AC'97 codec device, we fixup the
+ * in core layout of it by adding the packed attribute here. */
+
 struct sg_item {
 #define BUSADDR_MASK	0xFFFFFFFE
-	u32 busaddr;	
-#define CON_IOC 	0x80000000 /* interrupt on completion */

sound/oss/i810_audio.c line 151

Quoted 10 lines
sound/oss/i810_audio.c +3 -1
+	u32 bus_addr;
+#define CON_IOC		0x80000000 /* interrupt on completion */
 #define CON_BUFPAD	0x40000000 /* pad underrun with last sample, else 0 */
 #define CON_BUFLEN_MASK	0x0000ffff /* buffer length in samples */
 	u32 control;
-};
+} __attribute__ ((packed));
 
 /* an instance of the i810 channel */
 #define SG_LEN 32

Sounds like a nonsense to me. Show me one architecture that does not pack the structure correctly without ((packed)). You got Linux on CRAY-1 going?

sound/oss/i810_audio.c

Quoted 2 lines
sound/oss/i810_audio.c +1 -1
-			sg->busaddr=virt_to_bus(dmabuf->rawbuf+dmabuf->fragsize*i);
+			sg->bus_addr= dmabuf->dma_handle + dmabuf->fragsize * i;

Close, but no cigar, see below.

sound/oss/i810_audio.c line 963

Quoted 9 lines
sound/oss/i810_audio.c +1 -1
@@ -954,7 +957,7 @@
 		}
 		spin_lock_irqsave(&state->card->lock, flags);
 		outb(2, state->card->iobase+c->port+OFF_CR);   /* reset DMA machine */
-		outl(virt_to_bus(&c->sg[0]), state->card->iobase+c->port+OFF_BDBAR);
+		outl(isa_virt_to_bus(&c->sg[0]), state->card->iobase+c->port+OFF_BDBAR);
 		outb(0, state->card->iobase+c->port+OFF_CIV);
 		outb(0, state->card->iobase+c->port+OFF_LVI);
 

Why not to use pci_alloc_consistent here? I did it in 10 minutes, even posted a patch here.

sound/oss/i810_audio.c line 1678

Quoted 9 lines
sound/oss/i810_audio.c +1 -1
@@ -1669,7 +1672,7 @@
 	if (size > (PAGE_SIZE << dmabuf->buforder))
 		goto out;
 	ret = -EAGAIN;
-	if (remap_page_range(vma->vm_start, virt_to_phys(dmabuf->rawbuf),
+	if (remap_page_range(vma, vma->vm_start, virt_to_phys(dmabuf->rawbuf),
 			     size, vma->vm_page_prot))
 		goto out;
 	dmabuf->mapped = 1;

OK

sound/oss/i810_audio.c

Quoted 2 lines
sound/oss/i810_audio.c +1 -1
-			outl(virt_to_bus(&c->sg[0]), state->card->iobase+c->port+OFF_BDBAR);
+			outl(isa_virt_to_bus(&c->sg[0]), state->card->iobase+c->port+OFF_BDBAR);

Same as above - must be reworked.

-- Pete