Commit 9c472dd9 authored by James Bottomley's avatar James Bottomley

[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: default avatarMark Salyzyn <aacraid@adaptec.com>

Rejections fixed up and
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 6fc32179
...@@ -907,9 +907,13 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev ...@@ -907,9 +907,13 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev
raptorFlag = TRUE; raptorFlag = TRUE;
} }
if (pci_request_regions(pDev)) {
PERROR("dpti: adpt_config_hba: pci request region failed\n");
return -EINVAL;
}
base_addr_virt = ioremap(base_addr0_phys,hba_map0_area_size); base_addr_virt = ioremap(base_addr0_phys,hba_map0_area_size);
if (!base_addr_virt) { if (!base_addr_virt) {
pci_release_regions(pDev);
PERROR("dpti: adpt_config_hba: io remap failed\n"); PERROR("dpti: adpt_config_hba: io remap failed\n");
return -EINVAL; return -EINVAL;
} }
...@@ -919,6 +923,7 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev ...@@ -919,6 +923,7 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev
if (!msg_addr_virt) { if (!msg_addr_virt) {
PERROR("dpti: adpt_config_hba: io remap failed on BAR1\n"); PERROR("dpti: adpt_config_hba: io remap failed on BAR1\n");
iounmap(base_addr_virt); iounmap(base_addr_virt);
pci_release_regions(pDev);
return -EINVAL; return -EINVAL;
} }
} else { } else {
...@@ -932,6 +937,7 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev ...@@ -932,6 +937,7 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev
iounmap(msg_addr_virt); iounmap(msg_addr_virt);
} }
iounmap(base_addr_virt); iounmap(base_addr_virt);
pci_release_regions(pDev);
return -ENOMEM; return -ENOMEM;
} }
memset(pHba, 0, sizeof(adpt_hba)); memset(pHba, 0, sizeof(adpt_hba));
...@@ -1027,6 +1033,7 @@ static void adpt_i2o_delete_hba(adpt_hba* pHba) ...@@ -1027,6 +1033,7 @@ static void adpt_i2o_delete_hba(adpt_hba* pHba)
up(&adpt_configuration_lock); up(&adpt_configuration_lock);
iounmap(pHba->base_addr_virt); iounmap(pHba->base_addr_virt);
pci_release_regions(pHba->pDev);
if(pHba->msg_addr_virt != pHba->base_addr_virt){ if(pHba->msg_addr_virt != pHba->base_addr_virt){
iounmap(pHba->msg_addr_virt); iounmap(pHba->msg_addr_virt);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment