]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/scsi/3w-9xxx.c
[PATCH] ata_piix: add map 01b for ICH7M
[linux-2.6-omap-h63xx.git] / drivers / scsi / 3w-9xxx.c
index 0d2b447c50ed6e9cea185bf4810a18858dd1ddc5..5a9475e56d0eb7baea0b33d0188787aaffb799c0 100644 (file)
@@ -65,6 +65,7 @@
    2.26.02.005 - Fix use_sg == 0 mapping on systems with 4GB or higher.
    2.26.02.006 - Fix 9550SX pchip reset timeout.
                  Add big endian support.
+   2.26.02.007 - Disable local interrupts during kmap/unmap_atomic().
 */
 
 #include <linux/module.h>
@@ -88,7 +89,7 @@
 #include "3w-9xxx.h"
 
 /* Globals */
-#define TW_DRIVER_VERSION "2.26.02.006"
+#define TW_DRIVER_VERSION "2.26.02.007"
 static TW_Device_Extension *twa_device_extension_list[TW_MAX_SLOT];
 static unsigned int twa_device_extension_count;
 static int twa_major = -1;
@@ -1387,7 +1388,7 @@ static int twa_map_scsi_sg_data(TW_Device_Extension *tw_dev, int request_id)
        if (cmd->use_sg == 0)
                goto out;
 
-       use_sg = pci_map_sg(pdev, cmd->buffer, cmd->use_sg, DMA_BIDIRECTIONAL);
+       use_sg = pci_map_sg(pdev, cmd->request_buffer, cmd->use_sg, DMA_BIDIRECTIONAL);
 
        if (use_sg == 0) {
                TW_PRINTK(tw_dev->host, TW_DRIVER, 0x1c, "Failed to map scatter gather list");
@@ -1942,9 +1943,13 @@ static void twa_scsiop_execute_scsi_complete(TW_Device_Extension *tw_dev, int re
                }
                if (tw_dev->srb[request_id]->use_sg == 1) {
                        struct scatterlist *sg = (struct scatterlist *)tw_dev->srb[request_id]->request_buffer;
-                       char *buf = kmap_atomic(sg->page, KM_IRQ0) + sg->offset;
+                       char *buf;
+                       unsigned long flags = 0;
+                       local_irq_save(flags);
+                       buf = kmap_atomic(sg->page, KM_IRQ0) + sg->offset;
                        memcpy(buf, tw_dev->generic_buffer_virt[request_id], sg->length);
                        kunmap_atomic(buf - sg->offset, KM_IRQ0);
+                       local_irq_restore(flags);
                }
        }
 } /* End twa_scsiop_execute_scsi_complete() */
@@ -2117,7 +2122,7 @@ static int __devinit twa_probe(struct pci_dev *pdev, const struct pci_device_id
                                     TW_PARAM_PORTCOUNT, TW_PARAM_PORTCOUNT_LENGTH)));
 
        /* Now setup the interrupt handler */
-       retval = request_irq(pdev->irq, twa_interrupt, SA_SHIRQ, "3w-9xxx", tw_dev);
+       retval = request_irq(pdev->irq, twa_interrupt, IRQF_SHARED, "3w-9xxx", tw_dev);
        if (retval) {
                TW_PRINTK(tw_dev->host, TW_DRIVER, 0x30, "Error requesting IRQ");
                goto out_remove_host;