Re: [PATCH 2.6.15] I2O: move pci_request_regions() just behind pci_enable_device()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

Sincerely -- Mark Salyzyn

-----Original Message-----
From: Ryoji Kamei [mailto:kamei@xxxxxxxxxxxxxxxx] 
Sent: Thursday, January 12, 2006 5:34 AM
To: akpm@xxxxxxxx; AACRAID
Cc: Ryoji Kamei
Subject: [PATCH 2.6.15] I2O: move pci_request_regions() just behind
pci_enable_device()



Dear maintainers,

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: Ryoji Kamei <kamei@xxxxxxxxxxxxxxxx>
---
--- linux-2.6.15.orig/drivers/message/i2o/pci.c	2006-01-03
12:21:10.000000000 +0900
+++ linux-2.6.15/drivers/message/i2o/pci.c	2006-01-12
16:48:45.456399784
+0900
@@ -88,11 +88,6 @@
 	struct device *dev = &pdev->dev;
 	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++) {
 		/* Skip I/O spaces */
 		if (!(pci_resource_flags(pdev, i) & IORESOURCE_IO)) {
@@ -319,6 +314,11 @@
 		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)) {
 		printk(KERN_WARNING "i2o: no suitable DMA found for
%s\n",
 		       pci_name(pdev));
--- linux-2.6.15.orig/drivers/scsi/dpt_i2o.c	2006-01-03
12:21:10.000000000 +0900
+++ linux-2.6.15/drivers/scsi/dpt_i2o.c	2006-01-12 16:51:36.842345160
+0900
@@ -898,6 +898,12 @@
 	if(pci_enable_device(pDev)) {
 		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);
 	if (pci_set_dma_mask(pDev, 0xffffffffffffffffULL) &&
 	    pci_set_dma_mask(pDev, 0xffffffffULL))
@@ -923,10 +929,6 @@
 		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);
 	if (!base_addr_virt) {
 		pci_release_regions(pDev);
-
: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux