rpms/kernel-xen-2.6/devel linux-2.6-3w-9xxx-mem_len.patch, NONE, 1.1 kernel-xen.spec, 1.62, 1.63

Eduardo Habkost (ehabkost) fedora-extras-commits at redhat.com
Fri Sep 28 15:33:06 UTC 2007


Author: ehabkost

Update of /cvs/pkgs/rpms/kernel-xen-2.6/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv32349

Modified Files:
	kernel-xen.spec 
Added Files:
	linux-2.6-3w-9xxx-mem_len.patch 
Log Message:
Fix 3w-9xxx to use PCI resources properly and work under Xen (bug #309611)


linux-2.6-3w-9xxx-mem_len.patch:

--- NEW FILE linux-2.6-3w-9xxx-mem_len.patch ---
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Thu, 27 Sep 2007 18:37:44 -0300
Subject: 3w-9xxx: use PCI resource lenght correctly

Trying to ioremap() a larger area than pci_resource_len()
may fail (e.g. under Xen). Fixes 3w-9xxx to use pci_resource_len()
as length parameter to ioremap() instead of PAGE_SIZE.

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
Index: linux-2.6.20.i386/drivers/scsi/3w-9xxx.c
===================================================================
--- linux-2.6.20.i386.orig/drivers/scsi/3w-9xxx.c
+++ linux-2.6.20.i386/drivers/scsi/3w-9xxx.c
@@ -2052,7 +2052,8 @@ static int __devinit twa_probe(struct pc
 {
 	struct Scsi_Host *host = NULL;
 	TW_Device_Extension *tw_dev;
-	u32 mem_addr;
+	int bar;
+	unsigned long mem_addr, mem_len;
 	int retval = -ENODEV;
 
 	retval = pci_enable_device(pdev);
@@ -2096,12 +2097,15 @@ static int __devinit twa_probe(struct pc
 	}
 
 	if (pdev->device == PCI_DEVICE_ID_3WARE_9000)
-		mem_addr = pci_resource_start(pdev, 1);
+		bar = 1;
 	else
-		mem_addr = pci_resource_start(pdev, 2);
+		bar = 2;
+
+	mem_addr = pci_resource_start(pdev, bar);
+	mem_len = pci_resource_len(pdev, bar);
 
 	/* Save base address */
-	tw_dev->base_addr = ioremap(mem_addr, PAGE_SIZE);
+	tw_dev->base_addr = ioremap(mem_addr, mem_len);
 	if (!tw_dev->base_addr) {
 		TW_PRINTK(tw_dev->host, TW_DRIVER, 0x35, "Failed to ioremap");
 		goto out_release_mem_region;
@@ -2135,7 +2139,7 @@ static int __devinit twa_probe(struct pc
 
 	pci_set_drvdata(pdev, host);
 
-	printk(KERN_WARNING "3w-9xxx: scsi%d: Found a 3ware 9000 Storage Controller at 0x%x, IRQ: %d.\n",
+	printk(KERN_WARNING "3w-9xxx: scsi%d: Found a 3ware 9000 Storage Controller at 0x%lx, IRQ: %d.\n",
 	       host->host_no, mem_addr, pdev->irq);
 	printk(KERN_WARNING "3w-9xxx: scsi%d: Firmware %s, BIOS %s, Ports: %d.\n",
 	       host->host_no,


Index: kernel-xen.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/kernel-xen.spec,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -r1.62 -r1.63
--- kernel-xen.spec	27 Sep 2007 16:15:49 -0000	1.62
+++ kernel-xen.spec	28 Sep 2007 15:32:34 -0000	1.63
@@ -497,6 +497,7 @@
 # SCSI bits.
 Patch1100: linux-2.6-scsi-bounce-isa.patch
 Patch1106: linux-2.6-scsi-cpqarray-set-master.patch
+Patch1107: linux-2.6-3w-9xxx-mem_len.patch
 
 # NIC driver fixes
 Patch1300: linux-2.6-net-e1000-no-msi-warning.patch
@@ -1168,6 +1169,9 @@
 # fix cpqarray pci enable
 %patch1106 -p1
 
+# Fix 3w-9xxx to use PCI resource length correctly (bug #309611)
+%patch1107 -p1
+
 #
 # Various NFS/NFSD fixes.
 #
@@ -2362,6 +2366,9 @@
 #  - tux.
 
 %changelog
+* Thu Sep 27 2007 Eduardo Habkost <ehabkost at redhat.com>
+- Fix 3w-9xxx to use PCI resources properly and work under Xen (bug #309611)
+
 * Wed Sep 26 2007 Eduardo Habkost <ehabkost at redhat.com>
 - Disable Firewire on i686. It is not supported by the current
   Xen swiotlb implementation (bug #307461)




More information about the fedora-extras-commits mailing list