aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aacraid/linit.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/aacraid/linit.c')
-rw-r--r--drivers/scsi/aacraid/linit.c37
1 files changed, 30 insertions, 7 deletions
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index a1f9ceef0ac9..ab383d1f59e2 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -752,8 +752,8 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
752 if (error) 752 if (error)
753 goto out; 753 goto out;
754 754
755 if (pci_set_dma_mask(pdev, 0xFFFFFFFFULL) || 755 if (pci_set_dma_mask(pdev, DMA_32BIT_MASK) ||
756 pci_set_consistent_dma_mask(pdev, 0xFFFFFFFFULL)) 756 pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK))
757 goto out; 757 goto out;
758 /* 758 /*
759 * If the quirk31 bit is set, the adapter needs adapter 759 * If the quirk31 bit is set, the adapter needs adapter
@@ -788,8 +788,29 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
788 goto out_free_host; 788 goto out_free_host;
789 spin_lock_init(&aac->fib_lock); 789 spin_lock_init(&aac->fib_lock);
790 790
791 if ((*aac_drivers[index].init)(aac)) 791 /*
792 * Map in the registers from the adapter.
793 */
794 aac->base_size = AAC_MIN_FOOTPRINT_SIZE;
795 if ((aac->regs.sa = ioremap(
796 (unsigned long)aac->scsi_host_ptr->base, AAC_MIN_FOOTPRINT_SIZE))
797 == NULL) {
798 printk(KERN_WARNING "%s: unable to map adapter.\n",
799 AAC_DRIVERNAME);
792 goto out_free_fibs; 800 goto out_free_fibs;
801 }
802 if ((*aac_drivers[index].init)(aac))
803 goto out_unmap;
804
805 /*
806 * Start any kernel threads needed
807 */
808 aac->thread_pid = kernel_thread((int (*)(void *))aac_command_thread,
809 aac, 0);
810 if (aac->thread_pid < 0) {
811 printk(KERN_ERR "aacraid: Unable to create command thread.\n");
812 goto out_deinit;
813 }
793 814
794 /* 815 /*
795 * If we had set a smaller DMA mask earlier, set it to 4gig 816 * 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,
797 * address space. 818 * address space.
798 */ 819 */
799 if (aac_drivers[index].quirks & AAC_QUIRK_31BIT) 820 if (aac_drivers[index].quirks & AAC_QUIRK_31BIT)
800 if (pci_set_dma_mask(pdev, 0xFFFFFFFFULL)) 821 if (pci_set_dma_mask(pdev, DMA_32BIT_MASK))
801 goto out_free_fibs; 822 goto out_deinit;
802 823
803 aac->maximum_num_channels = aac_drivers[index].channels; 824 aac->maximum_num_channels = aac_drivers[index].channels;
804 error = aac_get_adapter_info(aac); 825 error = aac_get_adapter_info(aac);
805 if (error < 0) 826 if (error < 0)
@@ -866,10 +887,11 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
866 887
867 aac_send_shutdown(aac); 888 aac_send_shutdown(aac);
868 aac_adapter_disable_int(aac); 889 aac_adapter_disable_int(aac);
890 free_irq(pdev->irq, aac);
891 out_unmap:
869 fib_map_free(aac); 892 fib_map_free(aac);
870 pci_free_consistent(aac->pdev, aac->comm_size, aac->comm_addr, aac->comm_phys); 893 pci_free_consistent(aac->pdev, aac->comm_size, aac->comm_addr, aac->comm_phys);
871 kfree(aac->queues); 894 kfree(aac->queues);
872 free_irq(pdev->irq, aac);
873 iounmap(aac->regs.sa); 895 iounmap(aac->regs.sa);
874 out_free_fibs: 896 out_free_fibs:
875 kfree(aac->fibs); 897 kfree(aac->fibs);
@@ -910,6 +932,7 @@ static void __devexit aac_remove_one(struct pci_dev *pdev)
910 iounmap(aac->regs.sa); 932 iounmap(aac->regs.sa);
911 933
912 kfree(aac->fibs); 934 kfree(aac->fibs);
935 kfree(aac->fsa_dev);
913 936
914 list_del(&aac->entry); 937 list_del(&aac->entry);
915 scsi_host_put(shost); 938 scsi_host_put(shost);