]> err.no Git - linux-2.6/blobdiff - drivers/scsi/aacraid/linit.c
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
[linux-2.6] / drivers / scsi / aacraid / linit.c
index a1f9ceef0ac9080a710d04c6b4b2a496570bc159..ab383d1f59e2e29489f48e88064093d51e8773e0 100644 (file)
@@ -752,8 +752,8 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
        if (error)
                goto out;
 
-       if (pci_set_dma_mask(pdev, 0xFFFFFFFFULL) || 
-                       pci_set_consistent_dma_mask(pdev, 0xFFFFFFFFULL))
+       if (pci_set_dma_mask(pdev, DMA_32BIT_MASK) || 
+                       pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK))
                goto out;
        /*
         * If the quirk31 bit is set, the adapter needs adapter
@@ -788,8 +788,29 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
                goto out_free_host;
        spin_lock_init(&aac->fib_lock);
 
-       if ((*aac_drivers[index].init)(aac))
+       /*
+        *      Map in the registers from the adapter.
+        */
+       aac->base_size = AAC_MIN_FOOTPRINT_SIZE;
+       if ((aac->regs.sa = ioremap(
+         (unsigned long)aac->scsi_host_ptr->base, AAC_MIN_FOOTPRINT_SIZE))
+         == NULL) {    
+               printk(KERN_WARNING "%s: unable to map adapter.\n",
+                 AAC_DRIVERNAME);
                goto out_free_fibs;
+       }
+       if ((*aac_drivers[index].init)(aac))
+               goto out_unmap;
+
+       /*
+        *      Start any kernel threads needed
+        */
+       aac->thread_pid = kernel_thread((int (*)(void *))aac_command_thread,
+         aac, 0);
+       if (aac->thread_pid < 0) {
+               printk(KERN_ERR "aacraid: Unable to create command thread.\n");
+               goto out_deinit;
+       }
 
        /*
         * If we had set a smaller DMA mask earlier, set it to 4gig
@@ -797,9 +818,9 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
         * address space.
         */
        if (aac_drivers[index].quirks & AAC_QUIRK_31BIT)
-               if (pci_set_dma_mask(pdev, 0xFFFFFFFFULL))
-                       goto out_free_fibs;
-
+               if (pci_set_dma_mask(pdev, DMA_32BIT_MASK))
+                       goto out_deinit;
        aac->maximum_num_channels = aac_drivers[index].channels;
        error = aac_get_adapter_info(aac);
        if (error < 0)
@@ -866,10 +887,11 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
 
        aac_send_shutdown(aac);
        aac_adapter_disable_int(aac);
+       free_irq(pdev->irq, aac);
+ out_unmap:
        fib_map_free(aac);
        pci_free_consistent(aac->pdev, aac->comm_size, aac->comm_addr, aac->comm_phys);
        kfree(aac->queues);
-       free_irq(pdev->irq, aac);
        iounmap(aac->regs.sa);
  out_free_fibs:
        kfree(aac->fibs);
@@ -910,6 +932,7 @@ static void __devexit aac_remove_one(struct pci_dev *pdev)
        iounmap(aac->regs.sa);
        
        kfree(aac->fibs);
+       kfree(aac->fsa_dev);
        
        list_del(&aac->entry);
        scsi_host_put(shost);