Commit 9638d89a authored by Salyzyn, Mark's avatar Salyzyn, Mark Committed by James Bottomley

[SCSI] I2O: move pci_request_regions() just behind pci_enable_device()

The problem in dpt_i2o could be the pci config space accesses it
triggers as it loads, dangerous to do if there is any I/O activity going
on in the other driver (probable if a boot driver I guess).

I approve this patch to dpt_i2o.c, and am applying it to the Adaptec
branch of the driver.

Thanks for the investigation Ryoji.

---

In linux 2.6.15, data transfer does hang when both dpt_i2o
and i2o_block drivers are loaded.
It seems that location of pci_request_regions() are wrong.
I moved it just behind pci_enable_device() like other drivers,
and it becomes fine.
Signed-off-by: default avatarRyoji Kamei <kamei@miraclelinux.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 560c26c8
...@@ -88,11 +88,6 @@ static int __devinit i2o_pci_alloc(struct i2o_controller *c) ...@@ -88,11 +88,6 @@ static int __devinit i2o_pci_alloc(struct i2o_controller *c)
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
int i; int i;
if (pci_request_regions(pdev, OSM_DESCRIPTION)) {
printk(KERN_ERR "%s: device already claimed\n", c->name);
return -ENODEV;
}
for (i = 0; i < 6; i++) { for (i = 0; i < 6; i++) {
/* Skip I/O spaces */ /* Skip I/O spaces */
if (!(pci_resource_flags(pdev, i) & IORESOURCE_IO)) { if (!(pci_resource_flags(pdev, i) & IORESOURCE_IO)) {
...@@ -319,6 +314,11 @@ static int __devinit i2o_pci_probe(struct pci_dev *pdev, ...@@ -319,6 +314,11 @@ static int __devinit i2o_pci_probe(struct pci_dev *pdev,
return rc; return rc;
} }
if (pci_request_regions(pdev, OSM_DESCRIPTION)) {
printk(KERN_ERR "i2o: device already claimed\n", c->name);
return -ENODEV;
}
if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) { if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
printk(KERN_WARNING "i2o: no suitable DMA found for %s\n", printk(KERN_WARNING "i2o: no suitable DMA found for %s\n",
pci_name(pdev)); pci_name(pdev));
......
...@@ -899,6 +899,12 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev ...@@ -899,6 +899,12 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev
if(pci_enable_device(pDev)) { if(pci_enable_device(pDev)) {
return -EINVAL; return -EINVAL;
} }
if (pci_request_regions(pDev, "dpt_i2o")) {
PERROR("dpti: adpt_config_hba: pci request region failed\n");
return -EINVAL;
}
pci_set_master(pDev); pci_set_master(pDev);
if (pci_set_dma_mask(pDev, 0xffffffffffffffffULL) && if (pci_set_dma_mask(pDev, 0xffffffffffffffffULL) &&
pci_set_dma_mask(pDev, 0xffffffffULL)) pci_set_dma_mask(pDev, 0xffffffffULL))
...@@ -924,10 +930,6 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev ...@@ -924,10 +930,6 @@ static int adpt_install_hba(struct scsi_host_template* sht, struct pci_dev* pDev
raptorFlag = TRUE; raptorFlag = TRUE;
} }
if (pci_request_regions(pDev, "dpt_i2o")) {
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); pci_release_regions(pDev);
......
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