diff options
Diffstat (limited to 'drivers/scsi/aacraid/linit.c')
-rw-r--r-- | drivers/scsi/aacraid/linit.c | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c index e42a479ce64a..359e7ddfdb47 100644 --- a/drivers/scsi/aacraid/linit.c +++ b/drivers/scsi/aacraid/linit.c | |||
@@ -82,6 +82,8 @@ static LIST_HEAD(aac_devices); | |||
82 | static int aac_cfg_major = -1; | 82 | static int aac_cfg_major = -1; |
83 | char aac_driver_version[] = AAC_DRIVER_FULL_VERSION; | 83 | char aac_driver_version[] = AAC_DRIVER_FULL_VERSION; |
84 | 84 | ||
85 | extern int expose_physicals; | ||
86 | |||
85 | /* | 87 | /* |
86 | * Because of the way Linux names scsi devices, the order in this table has | 88 | * Because of the way Linux names scsi devices, the order in this table has |
87 | * become important. Check for on-board Raid first, add-in cards second. | 89 | * become important. Check for on-board Raid first, add-in cards second. |
@@ -394,6 +396,7 @@ static int aac_slave_configure(struct scsi_device *sdev) | |||
394 | sdev->skip_ms_page_3f = 1; | 396 | sdev->skip_ms_page_3f = 1; |
395 | } | 397 | } |
396 | if ((sdev->type == TYPE_DISK) && | 398 | if ((sdev->type == TYPE_DISK) && |
399 | !expose_physicals && | ||
397 | (sdev_channel(sdev) != CONTAINER_CHANNEL)) { | 400 | (sdev_channel(sdev) != CONTAINER_CHANNEL)) { |
398 | struct aac_dev *aac = (struct aac_dev *)sdev->host->hostdata; | 401 | struct aac_dev *aac = (struct aac_dev *)sdev->host->hostdata; |
399 | if (!aac->raid_scsi_mode || (sdev_channel(sdev) != 2)) | 402 | if (!aac->raid_scsi_mode || (sdev_channel(sdev) != 2)) |
@@ -454,17 +457,17 @@ static int aac_eh_reset(struct scsi_cmnd* cmd) | |||
454 | printk(KERN_ERR "%s: Host adapter reset request. SCSI hang ?\n", | 457 | printk(KERN_ERR "%s: Host adapter reset request. SCSI hang ?\n", |
455 | AAC_DRIVERNAME); | 458 | AAC_DRIVERNAME); |
456 | aac = (struct aac_dev *)host->hostdata; | 459 | aac = (struct aac_dev *)host->hostdata; |
457 | if (aac_adapter_check_health(aac)) { | 460 | |
458 | printk(KERN_ERR "%s: Host adapter appears dead\n", | 461 | if ((count = aac_check_health(aac))) |
459 | AAC_DRIVERNAME); | 462 | return count; |
460 | return -ENODEV; | ||
461 | } | ||
462 | /* | 463 | /* |
463 | * Wait for all commands to complete to this specific | 464 | * Wait for all commands to complete to this specific |
464 | * target (block maximum 60 seconds). | 465 | * target (block maximum 60 seconds). |
465 | */ | 466 | */ |
466 | for (count = 60; count; --count) { | 467 | for (count = 60; count; --count) { |
467 | int active = 0; | 468 | int active = aac->in_reset; |
469 | |||
470 | if (active == 0) | ||
468 | __shost_for_each_device(dev, host) { | 471 | __shost_for_each_device(dev, host) { |
469 | spin_lock_irqsave(&dev->list_lock, flags); | 472 | spin_lock_irqsave(&dev->list_lock, flags); |
470 | list_for_each_entry(command, &dev->cmd_list, list) { | 473 | list_for_each_entry(command, &dev->cmd_list, list) { |
@@ -864,13 +867,6 @@ static int __devinit aac_probe_one(struct pci_dev *pdev, | |||
864 | * Map in the registers from the adapter. | 867 | * Map in the registers from the adapter. |
865 | */ | 868 | */ |
866 | aac->base_size = AAC_MIN_FOOTPRINT_SIZE; | 869 | aac->base_size = AAC_MIN_FOOTPRINT_SIZE; |
867 | if ((aac->regs.sa = ioremap( | ||
868 | (unsigned long)aac->scsi_host_ptr->base, AAC_MIN_FOOTPRINT_SIZE)) | ||
869 | == NULL) { | ||
870 | printk(KERN_WARNING "%s: unable to map adapter.\n", | ||
871 | AAC_DRIVERNAME); | ||
872 | goto out_free_fibs; | ||
873 | } | ||
874 | if ((*aac_drivers[index].init)(aac)) | 870 | if ((*aac_drivers[index].init)(aac)) |
875 | goto out_unmap; | 871 | goto out_unmap; |
876 | 872 | ||
@@ -928,12 +924,12 @@ static int __devinit aac_probe_one(struct pci_dev *pdev, | |||
928 | * all containers are on the virtual channel 0 (CONTAINER_CHANNEL) | 924 | * all containers are on the virtual channel 0 (CONTAINER_CHANNEL) |
929 | * physical channels are address by their actual physical number+1 | 925 | * physical channels are address by their actual physical number+1 |
930 | */ | 926 | */ |
931 | if (aac->nondasd_support == 1) | 927 | if ((aac->nondasd_support == 1) || expose_physicals) |
932 | shost->max_channel = aac->maximum_num_channels; | 928 | shost->max_channel = aac->maximum_num_channels; |
933 | else | 929 | else |
934 | shost->max_channel = 0; | 930 | shost->max_channel = 0; |
935 | 931 | ||
936 | aac_get_config_status(aac); | 932 | aac_get_config_status(aac, 0); |
937 | aac_get_containers(aac); | 933 | aac_get_containers(aac); |
938 | list_add(&aac->entry, insert); | 934 | list_add(&aac->entry, insert); |
939 | 935 | ||
@@ -969,8 +965,7 @@ static int __devinit aac_probe_one(struct pci_dev *pdev, | |||
969 | aac_fib_map_free(aac); | 965 | aac_fib_map_free(aac); |
970 | pci_free_consistent(aac->pdev, aac->comm_size, aac->comm_addr, aac->comm_phys); | 966 | pci_free_consistent(aac->pdev, aac->comm_size, aac->comm_addr, aac->comm_phys); |
971 | kfree(aac->queues); | 967 | kfree(aac->queues); |
972 | iounmap(aac->regs.sa); | 968 | aac_adapter_ioremap(aac, 0); |
973 | out_free_fibs: | ||
974 | kfree(aac->fibs); | 969 | kfree(aac->fibs); |
975 | kfree(aac->fsa_dev); | 970 | kfree(aac->fsa_dev); |
976 | out_free_host: | 971 | out_free_host: |
@@ -1005,7 +1000,7 @@ static void __devexit aac_remove_one(struct pci_dev *pdev) | |||
1005 | kfree(aac->queues); | 1000 | kfree(aac->queues); |
1006 | 1001 | ||
1007 | free_irq(pdev->irq, aac); | 1002 | free_irq(pdev->irq, aac); |
1008 | iounmap(aac->regs.sa); | 1003 | aac_adapter_ioremap(aac, 0); |
1009 | 1004 | ||
1010 | kfree(aac->fibs); | 1005 | kfree(aac->fibs); |
1011 | kfree(aac->fsa_dev); | 1006 | kfree(aac->fsa_dev); |
@@ -1013,6 +1008,10 @@ static void __devexit aac_remove_one(struct pci_dev *pdev) | |||
1013 | list_del(&aac->entry); | 1008 | list_del(&aac->entry); |
1014 | scsi_host_put(shost); | 1009 | scsi_host_put(shost); |
1015 | pci_disable_device(pdev); | 1010 | pci_disable_device(pdev); |
1011 | if (list_empty(&aac_devices)) { | ||
1012 | unregister_chrdev(aac_cfg_major, "aac"); | ||
1013 | aac_cfg_major = -1; | ||
1014 | } | ||
1016 | } | 1015 | } |
1017 | 1016 | ||
1018 | static struct pci_driver aac_pci_driver = { | 1017 | static struct pci_driver aac_pci_driver = { |