patch-2.1.13 linux/drivers/scsi/sr.c

Next file: linux/drivers/sound/.blurb
Previous file: linux/drivers/net/ibmtr.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.12/linux/drivers/scsi/sr.c linux/drivers/scsi/sr.c
@@ -35,6 +35,7 @@
 #include <linux/interrupt.h>
 #include <linux/config.h>
 #include <asm/system.h>
+#include <asm/io.h>
 
 #define MAJOR_NR SCSI_CDROM_MAJOR
 #include <linux/blk.h>
@@ -617,7 +618,7 @@
 		    if (count+1 != SCpnt->use_sg) panic("Bad sr request list");
 		    break;
 		};
-		if (((long) sgpnt[count].address) + sgpnt[count].length - 1 >
+		if (virt_to_phys(sgpnt[count].address) + sgpnt[count].length - 1 >
 		    ISA_DMA_THRESHOLD && SCpnt->host->unchecked_isa_dma) {
 		    sgpnt[count].alt_address = sgpnt[count].address;
 		    /* We try to avoid exhausting the DMA pool, since it is easier
@@ -681,7 +682,7 @@
 	    {
 	    this_count -= this_count % 4;
 	    buffer = (unsigned char *) SCpnt->request.buffer;
-	    if (((long) buffer) + (this_count << 9) > ISA_DMA_THRESHOLD &&
+	    if (virt_to_phys(buffer) + (this_count << 9) > ISA_DMA_THRESHOLD &&
 		SCpnt->host->unchecked_isa_dma)
 		buffer = (unsigned char *) scsi_malloc(this_count << 9);
 	    }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov