aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/dpt_i2o.c
diff options
context:
space:
mode:
authorJames Bottomley <jejb@mulgrave.(none)>2005-08-08 12:51:38 -0400
committerJames Bottomley <jejb@mulgrave.(none)>2005-08-08 12:51:38 -0400
commit9c472dd9197429a37691e91c938660a062bf20b0 (patch)
treeffe17c0aa00728c0d4e1bebd203c68b9d16af58f /drivers/scsi/dpt_i2o.c
parent6fc32179de9e14c542e0b1760e412bc670611c53 (diff)
[SCSI] Bug 4940 Repeatable Kernel Panic on Adaptec 2015S I20 device on bootup
From: "Salyzyn, Mark" <mark_salyzyn@adaptec.com> Prevent driver from loading if another driver (i2o) has already claimed the resources associated with the card. Discussion associated with this bug can be referenced at http://bugzilla.kernel.org/show_bug.cgi?id=4940 where it was agreed to use pci_request_regions in both the dpt_i2o and the i2o driver to prevent both drivers loading on the same adapter(s). Signed-off-by: Mark Salyzyn <aacraid@adaptec.com> Rejections fixed up and Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/dpt_i2o.c')
-rw-r--r--drivers/scsi/dpt_i2o.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c
index e2370529c632..bc7b84c95db6 100644
--- a/drivers/scsi/dpt_i2o.c
+++ b/drivers/scsi/dpt_i2o.c
@@ -907,9 +907,13 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev
907 raptorFlag = TRUE; 907 raptorFlag = TRUE;
908 } 908 }
909 909
910 910 if (pci_request_regions(pDev)) {
911 PERROR("dpti: adpt_config_hba: pci request region failed\n");
912 return -EINVAL;
913 }
911 base_addr_virt = ioremap(base_addr0_phys,hba_map0_area_size); 914 base_addr_virt = ioremap(base_addr0_phys,hba_map0_area_size);
912 if (!base_addr_virt) { 915 if (!base_addr_virt) {
916 pci_release_regions(pDev);
913 PERROR("dpti: adpt_config_hba: io remap failed\n"); 917 PERROR("dpti: adpt_config_hba: io remap failed\n");
914 return -EINVAL; 918 return -EINVAL;
915 } 919 }
@@ -919,6 +923,7 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev
919 if (!msg_addr_virt) { 923 if (!msg_addr_virt) {
920 PERROR("dpti: adpt_config_hba: io remap failed on BAR1\n"); 924 PERROR("dpti: adpt_config_hba: io remap failed on BAR1\n");
921 iounmap(base_addr_virt); 925 iounmap(base_addr_virt);
926 pci_release_regions(pDev);
922 return -EINVAL; 927 return -EINVAL;
923 } 928 }
924 } else { 929 } else {
@@ -932,6 +937,7 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev
932 iounmap(msg_addr_virt); 937 iounmap(msg_addr_virt);
933 } 938 }
934 iounmap(base_addr_virt); 939 iounmap(base_addr_virt);
940 pci_release_regions(pDev);
935 return -ENOMEM; 941 return -ENOMEM;
936 } 942 }
937 memset(pHba, 0, sizeof(adpt_hba)); 943 memset(pHba, 0, sizeof(adpt_hba));
@@ -1027,6 +1033,7 @@ static void adpt_i2o_delete_hba(adpt_hba* pHba)
1027 up(&adpt_configuration_lock); 1033 up(&adpt_configuration_lock);
1028 1034
1029 iounmap(pHba->base_addr_virt); 1035 iounmap(pHba->base_addr_virt);
1036 pci_release_regions(pHba->pDev);
1030 if(pHba->msg_addr_virt != pHba->base_addr_virt){ 1037 if(pHba->msg_addr_virt != pHba->base_addr_virt){
1031 iounmap(pHba->msg_addr_virt); 1038 iounmap(pHba->msg_addr_virt);
1032 } 1039 }