]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/scsi/megaraid.c
[SCSI] sg: do not set VM_IO flag on mmap-ed pages
[linux-2.6-omap-h63xx.git] / drivers / scsi / megaraid.c
index 6ee88c59953e36e2ac234828ccfc4253008ca5bc..6f308ebe3e797857d02baae2679c96db8fd8bfbd 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/blkdev.h>
 #include <asm/uaccess.h>
 #include <asm/io.h>
+#include <linux/completion.h>
 #include <linux/delay.h>
 #include <linux/proc_fs.h>
 #include <linux/reboot.h>
@@ -4477,8 +4478,6 @@ mega_internal_command(adapter_t *adapter, lockscope_t ls, megacmd_t *mc,
 
        scb->idx = CMDID_INT_CMDS;
 
-       scmd->state = 0;
-
        /*
         * Get the lock only if the caller has not acquired it already
         */
@@ -4488,15 +4487,7 @@ mega_internal_command(adapter_t *adapter, lockscope_t ls, megacmd_t *mc,
 
        if( ls == LOCK_INT ) spin_unlock_irqrestore(&adapter->lock, flags);
 
-       /*
-        * Wait till this command finishes. Do not use
-        * wait_event_interruptible(). It causes panic if CTRL-C is hit when
-        * dumping e.g., physical disk information through /proc interface.
-        */
-#if 0
-       wait_event_interruptible(adapter->int_waitq, scmd->state);
-#endif
-       wait_event(adapter->int_waitq, scmd->state);
+       wait_for_completion(&adapter->int_waitq);
 
        rval = scmd->result;
        mc->status = scmd->result;
@@ -4530,16 +4521,7 @@ mega_internal_done(Scsi_Cmnd *scmd)
 
        adapter = (adapter_t *)scmd->device->host->hostdata;
 
-       scmd->state = 1; /* thread waiting for its command to complete */
-
-       /*
-        * See comment in mega_internal_command() routine for
-        * wait_event_interruptible()
-        */
-#if 0
-       wake_up_interruptible(&adapter->int_waitq);
-#endif
-       wake_up(&adapter->int_waitq);
+       complete(&adapter->int_waitq);
 
 }
 
@@ -4861,7 +4843,7 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
        }
                
        init_MUTEX(&adapter->int_mtx);
-       init_waitqueue_head(&adapter->int_waitq);
+       init_completion(&adapter->int_waitq);
 
        adapter->this_id = DEFAULT_INITIATOR_ID;
        adapter->host->this_id = DEFAULT_INITIATOR_ID;
@@ -5023,9 +5005,9 @@ megaraid_remove_one(struct pci_dev *pdev)
 }
 
 static void
-megaraid_shutdown(struct device *dev)
+megaraid_shutdown(struct pci_dev *pdev)
 {
-       struct Scsi_Host *host = pci_get_drvdata(to_pci_dev(dev));
+       struct Scsi_Host *host = pci_get_drvdata(pdev);
        adapter_t *adapter = (adapter_t *)host->hostdata;
 
        __megaraid_shutdown(adapter);
@@ -5057,9 +5039,7 @@ static struct pci_driver megaraid_pci_driver = {
        .id_table       = megaraid_pci_tbl,
        .probe          = megaraid_probe_one,
        .remove         = __devexit_p(megaraid_remove_one),
-       .driver         = {
-               .shutdown = megaraid_shutdown,
-       },
+       .shutdown       = megaraid_shutdown,
 };
 
 static int __init megaraid_init(void)