lkml.org 
[lkml]   [2002]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patches in this message
/
Date
From
Subject[PATCH] Emu10k1 HIGHMEM dma bug fix
Hi,

Attached is a patch against 2.4.18 which fixes bugs handling 64bit dma
handles (i.e. 4G or 64G HIGHMEM enabled kernels) in the emu10k1.o driver.


--
Daniel Bertrand

diff -u linux-2.4.18-orig/drivers/sound/emu10k1/main.c linux-2.4.18/drivers/sound/emu10k1/main.c
--- linux-2.4.18-orig/drivers/sound/emu10k1/main.c Mon Feb 25 11:38:06 2002
+++ linux-2.4.18/drivers/sound/emu10k1/main.c Thu Feb 28 22:39:46 2002
@@ -867,19 +867,19 @@
}

for (pagecount = 0; pagecount < MAXPAGES; pagecount++)
- ((u32 *) card->virtualpagetable.addr)[pagecount] = cpu_to_le32((card->silentpage.dma_handle * 2) | pagecount);
+ ((u32 *) card->virtualpagetable.addr)[pagecount] = cpu_to_le32(((u32)card->silentpage.dma_handle * 2) | pagecount);

/* Init page table & tank memory base register */
sblive_writeptr_tag(card, 0,
- PTB, card->virtualpagetable.dma_handle,
+ PTB, (u32)card->virtualpagetable.dma_handle,
TCB, 0,
TCBS, 0,
TAGLIST_END);

for (nCh = 0; nCh < NUM_G; nCh++) {
sblive_writeptr_tag(card, nCh,
- MAPA, MAP_PTI_MASK | (card->silentpage.dma_handle * 2),
- MAPB, MAP_PTI_MASK | (card->silentpage.dma_handle * 2),
+ MAPA, MAP_PTI_MASK |( (u32)card->silentpage.dma_handle * 2),
+ MAPB, MAP_PTI_MASK |( (u32)card->silentpage.dma_handle * 2),
TAGLIST_END);
}

diff -u linux-2.4.18-orig/drivers/sound/emu10k1/mixer.c linux-2.4.18/drivers/sound/emu10k1/mixer.c
--- linux-2.4.18-orig/drivers/sound/emu10k1/mixer.c Mon Feb 25 11:38:06 2002
+++ linux-2.4.18/drivers/sound/emu10k1/mixer.c Thu Feb 28 21:49:36 2002
@@ -558,7 +558,7 @@

card->tankmem.size = size;

- sblive_writeptr_tag(card, 0, TCB, card->tankmem.dma_handle, TCBS, size_reg, TAGLIST_END);
+ sblive_writeptr_tag(card, 0, TCB,(u32) card->tankmem.dma_handle, TCBS, size_reg, TAGLIST_END);

emu10k1_writefn0(card, HCFG_LOCKTANKCACHE, 0);
}
diff -u linux-2.4.18-orig/drivers/sound/emu10k1/recmgr.c linux-2.4.18/drivers/sound/emu10k1/recmgr.c
--- linux-2.4.18-orig/drivers/sound/emu10k1/recmgr.c Mon Feb 25 11:38:06 2002
+++ linux-2.4.18/drivers/sound/emu10k1/recmgr.c Thu Feb 28 22:09:11 2002
@@ -132,7 +132,7 @@

DPD(2, "bus addx: %#lx\n", (unsigned long) buffer->dma_handle);

- sblive_writeptr(card, buffer->addrreg, 0, buffer->dma_handle);
+ sblive_writeptr(card, buffer->addrreg, 0, (u32)buffer->dma_handle);

return;
}
diff -u linux-2.4.18-orig/drivers/sound/emu10k1/voicemgr.c linux-2.4.18/drivers/sound/emu10k1/voicemgr.c
--- linux-2.4.18-orig/drivers/sound/emu10k1/voicemgr.c Mon Feb 25 11:38:06 2002
+++ linux-2.4.18/drivers/sound/emu10k1/voicemgr.c Thu Feb 28 21:50:34 2002
@@ -66,7 +66,7 @@
DPD(2, "Virtual Addx: %p\n", mem->addr[pagecount]);

for (i = 0; i < PAGE_SIZE / EMUPAGESIZE; i++) {
- busaddx = mem->dma_handle[pagecount] + i * EMUPAGESIZE;
+ busaddx = (u32)(mem->dma_handle[pagecount]) + i * EMUPAGESIZE;

DPD(3, "Bus Addx: %#lx\n", busaddx);

@@ -102,7 +102,7 @@
for (i = 0; i < PAGE_SIZE / EMUPAGESIZE; i++) {
pageindex = mem->emupageindex + pagecount * PAGE_SIZE / EMUPAGESIZE + i;
((u32 *) card->virtualpagetable.addr)[pageindex] =
- cpu_to_le32((card->silentpage.dma_handle * 2) | pageindex);
+ cpu_to_le32(((u32)card->silentpage.dma_handle * 2) | pageindex);
}
}

@@ -231,8 +231,8 @@
Z1, 0,
Z2, 0,
/* Invalidate maps */
- MAPA, MAP_PTI_MASK | (card->silentpage.dma_handle * 2),
- MAPB, MAP_PTI_MASK | (card->silentpage.dma_handle * 2),
+ MAPA, MAP_PTI_MASK | ((u32)card->silentpage.dma_handle * 2),
+ MAPB, MAP_PTI_MASK | ((u32)card->silentpage.dma_handle * 2),
/* modulation envelope */
CVCF, 0x0000ffff,
VTFT, 0x0000ffff,
\
 
 \ /
  Last update: 2005-03-22 13:24    [W:0.048 / U:13.316 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site