Re: Alpha: virt_to_bus/GFP_DMA problem

Thomas Sailer (sailer@ife.ee.ethz.ch)
Fri, 10 Dec 1999 14:21:12 +0100


This is a multi-part message in MIME format.
--------------9A25DF2E7EE2A73F318600CF
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Jes Sorensen wrote:

> Time to moan at the people who did the ESS Solo1 and ask them to
> replace the card with one that is PCI 2.x compliant ;-)

Anyway, the following patch should safely disable recording
when virt_to_bus(kmalloc(GFP_DMA)) > 16M. Playback should
still work, as interestingly the playback controller
has a full 32bit address register.

Linus, please apply.

Tom
--------------9A25DF2E7EE2A73F318600CF
Content-Type: text/plain; charset=us-ascii;
name="snd-2.3.31.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="snd-2.3.31.diff"

--- drivers/sound/esssolo1.c.orig Fri Dec 10 15:00:18 1999
+++ drivers/sound/esssolo1.c Fri Dec 10 15:13:25 1999
@@ -61,6 +61,8 @@
* 07.10.99 0.9 Fix initialization; complain if sequencer writes time out
* Revised resource grabbing for the FM synthesizer
* 28.10.99 0.10 More waitqueue races fixed
+ * 09.12.99 0.11 Work around stupid Alpha port issue (virt_to_bus(kmalloc(GFP_DMA)) > 16M)
+ * Disabling recording on Alpha
*
*/

@@ -419,6 +421,14 @@
break;
if (!db->rawbuf)
return -ENOMEM;
+ /* work around a problem of the alpha port */
+ if ((gfp_mask & GFP_DMA) && (virt_to_bus(db->rawbuf) & (~0xffffffUL))) {
+ printk(KERN_ERR "solo1: requested DMA buffer below 16M but got 0x%lx, Alpha bug?\n",
+ (unsigned long)virt_to_bus(db->rawbuf));
+ kfree(db->rawbuf);
+ db->rawbuf = NULL;
+ return -ENOMEM;
+ }
db->buforder = order;
/* now mark the pages as reserved; otherwise remap_page_range doesn't do what we want */
mapend = MAP_NR(db->rawbuf + (PAGE_SIZE << db->buforder) - 1);
@@ -1555,10 +1565,6 @@
s->open_mode |= file->f_mode & (FMODE_READ | FMODE_WRITE);
up(&s->open_sem);
MOD_INC_USE_COUNT;
- if (prog_dmabuf_dac(s) || prog_dmabuf_adc(s)) {
- solo1_release(inode, file);
- return -ENOMEM;
- }
prog_codec(s);
return 0;
}
@@ -2148,7 +2154,7 @@

if (!pci_present()) /* No PCI bus in this machine! */
return -ENODEV;
- printk(KERN_INFO "solo1: version v0.10 time " __TIME__ " " __DATE__ "\n");
+ printk(KERN_INFO "solo1: version v0.11 time " __TIME__ " " __DATE__ "\n");
while (index < NR_DEVICE &&
(pcidev = pci_find_device(PCI_VENDOR_ID_ESS, PCI_DEVICE_ID_ESS_SOLO1, pcidev))) {
if (!RSRCISIOREGION(pcidev, 0) ||

--------------9A25DF2E7EE2A73F318600CF--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/