linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC][PATCH 0/10] 64 bit resources
@ 2006-03-23 19:57 Vivek Goyal
  2006-03-23 19:59 ` [RFC][PATCH 1/10] 64 bit resources core changes Vivek Goyal
  2006-03-24  9:12 ` [RFC][PATCH 0/10] 64 bit resources Andrew Morton
  0 siblings, 2 replies; 26+ messages in thread
From: Vivek Goyal @ 2006-03-23 19:57 UTC (permalink / raw)
  To: linux kernel mailing list, Fastboot mailing list
  Cc: Linus Torvalds, Morton Andrew Morton, Eric W. Biederman, galak,
	gregkh, bcrl, Dave Jiang, arjan, Maneesh Soni, Murali

Hi,

Here is an attempt to implement support for 64 bit resources. This will
enable memory more than 4G to be exported through /proc/iomem, which is used
by kexec/kdump to determine the physical memory layout of the system.

As suggested in the last week's discussion, I picked up greg's patch and
made changes on top of that.

http://www.kernel.org/pub/linux/kernel/people/gregkh/pci/2.6/2.6.11-rc3/bk-resource-2.6.11-rc3-mm1.patch

Last discussion witnessed a divided opinion upon whether to use u64 or
something like dma_addr_t as data type. The argument is usage of dma_addr_t
will reduce code size bloat for the people who don't want to use 64 bit
resources on 32 bit platforms. But probably name dma_addr_t is not very
appropriate for usage at various places.

Implementing u64 seems to be simpler and code bloat might not be significant.

This implementation is based on u64 and I have measured code bloat on i386.

- Greg's patch already had core changes. We have maninly fixed the warnings.
  Most of them originating from printk's().

- This patch does not try to modify the users of resources who think
  that on 32 bit platforms resources can be 32 bit only. They will continue
  to work as usual as they will silently truncate the 64 bit value to 32bit.

- We did the compilation for i386, arm, sparc, sparc64, x86_64 and ppc64
  platforms and fixed the warnings.

Test Results:
------------

We used "make allyesconfig" with CONFIG_DEBUG_INFO=n on 2.6.16-mm1.

i386
----

vmlinux size without patch: 40191425
vmlinux size with path: 40244677
vmlinux size bloat: 52K (.13%)

x86_64
------

vmlinux size without patch: 42387898
vmlinux size with path: 42387945
vmlinux size bloat: 47 bytes

Thanks
Vivek

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [RFC][PATCH 1/10] 64 bit resources core changes
  2006-03-23 19:57 [RFC][PATCH 0/10] 64 bit resources Vivek Goyal
@ 2006-03-23 19:59 ` Vivek Goyal
  2006-03-23 20:01   ` [RFC][PATCH 2/10] 64 bit resources drivers pci changes Vivek Goyal
                     ` (2 more replies)
  2006-03-24  9:12 ` [RFC][PATCH 0/10] 64 bit resources Andrew Morton
  1 sibling, 3 replies; 26+ messages in thread
From: Vivek Goyal @ 2006-03-23 19:59 UTC (permalink / raw)
  To: linux kernel mailing list, Fastboot mailing list
  Cc: Linus Torvalds, Morton Andrew Morton, Eric W. Biederman, galak,
	gregkh, bcrl, Dave Jiang, arjan, Maneesh Soni, Murali



o Core changes for 64bit resources. Changes start and end field to u64
  from unsigned long.

Signed-off-by: Dave Jiang <dave.jiang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
---

 include/linux/ioport.h |   23 ++++++++++++-----------
 kernel/resource.c      |   48 +++++++++++++++++++++++++-----------------------
 2 files changed, 37 insertions(+), 34 deletions(-)

diff -puN include/linux/ioport.h~64bit-resources-core-changes include/linux/ioport.h
--- linux-2.6.16-mm1/include/linux/ioport.h~64bit-resources-core-changes	2006-03-23 11:38:53.000000000 -0500
+++ linux-2.6.16-mm1-root/include/linux/ioport.h	2006-03-23 11:38:53.000000000 -0500
@@ -9,13 +9,14 @@
 #define _LINUX_IOPORT_H
 
 #include <linux/compiler.h>
+#include <linux/types.h>
 /*
  * Resources are tree-like, allowing
  * nesting etc..
  */
 struct resource {
+	u64 start, end;
 	const char *name;
-	unsigned long start, end;
 	unsigned long flags;
 	struct resource *parent, *sibling, *child;
 };
@@ -96,31 +97,31 @@ extern struct resource * ____request_res
 extern int release_resource(struct resource *new);
 extern __deprecated_for_modules int insert_resource(struct resource *parent, struct resource *new);
 extern int allocate_resource(struct resource *root, struct resource *new,
-			     unsigned long size,
-			     unsigned long min, unsigned long max,
-			     unsigned long align,
+			     u64 size,
+			     u64 min, u64 max,
+			     u64 align,
 			     void (*alignf)(void *, struct resource *,
-					    unsigned long, unsigned long),
+					    u64, u64),
 			     void *alignf_data);
-int adjust_resource(struct resource *res, unsigned long start,
-		    unsigned long size);
+int adjust_resource(struct resource *res, u64 start,
+		    u64 size);
 
 /* Convenience shorthand with allocation */
 #define request_region(start,n,name)	__request_region(&ioport_resource, (start), (n), (name))
 #define request_mem_region(start,n,name) __request_region(&iomem_resource, (start), (n), (name))
 #define rename_region(region, newname) do { (region)->name = (newname); } while (0)
 
-extern struct resource * __request_region(struct resource *, unsigned long start, unsigned long n, const char *name);
+extern struct resource * __request_region(struct resource *, u64 start, u64 n, const char *name);
 
 /* Compatibility cruft */
 #define release_region(start,n)	__release_region(&ioport_resource, (start), (n))
 #define check_mem_region(start,n)	__check_region(&iomem_resource, (start), (n))
 #define release_mem_region(start,n)	__release_region(&iomem_resource, (start), (n))
 
-extern int __check_region(struct resource *, unsigned long, unsigned long);
-extern void __release_region(struct resource *, unsigned long, unsigned long);
+extern int __check_region(struct resource *, u64, u64);
+extern void __release_region(struct resource *, u64, u64);
 
-static inline int __deprecated check_region(unsigned long s, unsigned long n)
+static inline int __deprecated check_region(u64 s, u64 n)
 {
 	return __check_region(&ioport_resource, s, n);
 }
diff -puN kernel/resource.c~64bit-resources-core-changes kernel/resource.c
--- linux-2.6.16-mm1/kernel/resource.c~64bit-resources-core-changes	2006-03-23 11:38:53.000000000 -0500
+++ linux-2.6.16-mm1-root/kernel/resource.c	2006-03-23 11:38:53.000000000 -0500
@@ -23,7 +23,7 @@
 
 struct resource ioport_resource = {
 	.name	= "PCI IO",
-	.start	= 0x0000,
+	.start	= 0x0000ULL,
 	.end	= IO_SPACE_LIMIT,
 	.flags	= IORESOURCE_IO,
 };
@@ -32,8 +32,8 @@ EXPORT_SYMBOL(ioport_resource);
 
 struct resource iomem_resource = {
 	.name	= "PCI mem",
-	.start	= 0UL,
-	.end	= ~0UL,
+	.start	= 0ULL,
+	.end	= ~0ULL,
 	.flags	= IORESOURCE_MEM,
 };
 
@@ -83,10 +83,10 @@ static int r_show(struct seq_file *m, vo
 	for (depth = 0, p = r; depth < MAX_IORES_LEVEL; depth++, p = p->parent)
 		if (p->parent == root)
 			break;
-	seq_printf(m, "%*s%0*lx-%0*lx : %s\n",
+	seq_printf(m, "%*s%0*llx-%0*llx : %s\n",
 			depth * 2, "",
-			width, r->start,
-			width, r->end,
+			width, (unsigned long long) r->start,
+			width, (unsigned long long) r->end,
 			r->name ? r->name : "<BAD>");
 	return 0;
 }
@@ -151,8 +151,8 @@ __initcall(ioresources_init);
 /* Return the conflict entry if you can't request it */
 static struct resource * __request_resource(struct resource *root, struct resource *new)
 {
-	unsigned long start = new->start;
-	unsigned long end = new->end;
+	u64 start = new->start;
+	u64 end = new->end;
 	struct resource *tmp, **p;
 
 	if (end < start)
@@ -246,11 +246,11 @@ EXPORT_SYMBOL(release_resource);
  * Find empty slot in the resource tree given range and alignment.
  */
 static int find_resource(struct resource *root, struct resource *new,
-			 unsigned long size,
-			 unsigned long min, unsigned long max,
-			 unsigned long align,
+			 u64 size,
+			 u64 min, u64 max,
+			 u64 align,
 			 void (*alignf)(void *, struct resource *,
-					unsigned long, unsigned long),
+					u64, u64),
 			 void *alignf_data)
 {
 	struct resource *this = root->child;
@@ -292,11 +292,11 @@ static int find_resource(struct resource
  * Allocate empty slot in the resource tree given range and alignment.
  */
 int allocate_resource(struct resource *root, struct resource *new,
-		      unsigned long size,
-		      unsigned long min, unsigned long max,
-		      unsigned long align,
+		      u64 size,
+		      u64 min, u64 max,
+		      u64 align,
 		      void (*alignf)(void *, struct resource *,
-				     unsigned long, unsigned long),
+				     u64, u64),
 		      void *alignf_data)
 {
 	int err;
@@ -388,10 +388,10 @@ EXPORT_SYMBOL(insert_resource);
  * arguments.  Returns -EBUSY if it can't fit.  Existing children of
  * the resource are assumed to be immutable.
  */
-int adjust_resource(struct resource *res, unsigned long start, unsigned long size)
+int adjust_resource(struct resource *res, u64 start, u64 size)
 {
 	struct resource *tmp, *parent = res->parent;
-	unsigned long end = start + size - 1;
+	u64 end = start + size - 1;
 	int result = -EBUSY;
 
 	write_lock(&resource_lock);
@@ -438,7 +438,7 @@ EXPORT_SYMBOL(adjust_resource);
  *
  * Release-region releases a matching busy region.
  */
-struct resource * __request_region(struct resource *parent, unsigned long start, unsigned long n, const char *name)
+struct resource * __request_region(struct resource *parent, u64 start, u64 n, const char *name)
 {
 	struct resource *res = kzalloc(sizeof(*res), GFP_KERNEL);
 
@@ -474,7 +474,7 @@ struct resource * __request_region(struc
 
 EXPORT_SYMBOL(__request_region);
 
-int __check_region(struct resource *parent, unsigned long start, unsigned long n)
+int __check_region(struct resource *parent, u64 start, u64 n)
 {
 	struct resource * res;
 
@@ -489,10 +489,10 @@ int __check_region(struct resource *pare
 
 EXPORT_SYMBOL(__check_region);
 
-void __release_region(struct resource *parent, unsigned long start, unsigned long n)
+void __release_region(struct resource *parent, u64 start, u64 n)
 {
 	struct resource **p;
-	unsigned long end;
+	u64 end;
 
 	p = &parent->child;
 	end = start + n - 1;
@@ -521,7 +521,9 @@ void __release_region(struct resource *p
 
 	write_unlock(&resource_lock);
 
-	printk(KERN_WARNING "Trying to free nonexistent resource <%08lx-%08lx>\n", start, end);
+	printk(KERN_WARNING "Trying to free nonexistent resource "
+		"<%16llx-%16llx>\n", (unsigned long long)start,
+		(unsigned long long) end);
 }
 
 EXPORT_SYMBOL(__release_region);
_

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [RFC][PATCH 2/10] 64 bit resources drivers pci changes
  2006-03-23 19:59 ` [RFC][PATCH 1/10] 64 bit resources core changes Vivek Goyal
@ 2006-03-23 20:01   ` Vivek Goyal
  2006-03-23 20:02     ` [RFC][PATCH 3/10] 64 bit resources drivers ide changes Vivek Goyal
  2006-03-23 20:22   ` [RFC][PATCH 1/10] 64 bit resources core changes Arjan van de Ven
  2006-04-14 21:07   ` Matthieu CASTET
  2 siblings, 1 reply; 26+ messages in thread
From: Vivek Goyal @ 2006-03-23 20:01 UTC (permalink / raw)
  To: linux kernel mailing list, Fastboot mailing list
  Cc: Linus Torvalds, Morton Andrew Morton, Eric W. Biederman, galak,
	gregkh, bcrl, Dave Jiang, arjan, Maneesh Soni, Murali



o Changes required in drivers/pci/* to support 64bit resources.

Signed-off-by: Dave Jiang <dave.jiang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Maneesh Soni <maneesh@in.ibm.com>
Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
---

 drivers/pci/bus.c                   |    4 ++--
 drivers/pci/hotplug/cpcihp_zt5550.c |    9 +++++----
 drivers/pci/hotplug/cpqphp_core.c   |   10 +++++-----
 drivers/pci/hotplug/pciehp_hpc.c    |    5 +++--
 drivers/pci/hotplug/shpchp_sysfs.c  |   18 ++++++++++++------
 drivers/pci/pci.c                   |    6 ++++--
 drivers/pci/pci.h                   |    6 +++---
 drivers/pci/proc.c                  |   16 +++++-----------
 drivers/pci/rom.c                   |   10 +++++-----
 drivers/pci/setup-bus.c             |    6 ++++--
 drivers/pci/setup-res.c             |   34 ++++++++++++++++++++--------------
 include/linux/pci.h                 |    8 ++++----
 12 files changed, 72 insertions(+), 60 deletions(-)

diff -puN drivers/pci/bus.c~64bit-resources-drivers-pci-changes drivers/pci/bus.c
--- linux-2.6.16-mm1/drivers/pci/bus.c~64bit-resources-drivers-pci-changes	2006-03-23 11:38:58.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/pci/bus.c	2006-03-23 11:38:58.000000000 -0500
@@ -34,10 +34,10 @@
  */
 int
 pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res,
-	unsigned long size, unsigned long align, unsigned long min,
+	u64 size, u64 align, u64 min,
 	unsigned int type_mask,
 	void (*alignf)(void *, struct resource *,
-			unsigned long, unsigned long),
+			u64, u64),
 	void *alignf_data)
 {
 	int i, ret = -ENOMEM;
diff -puN drivers/pci/hotplug/cpcihp_zt5550.c~64bit-resources-drivers-pci-changes drivers/pci/hotplug/cpcihp_zt5550.c
--- linux-2.6.16-mm1/drivers/pci/hotplug/cpcihp_zt5550.c~64bit-resources-drivers-pci-changes	2006-03-23 11:38:58.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/pci/hotplug/cpcihp_zt5550.c	2006-03-23 11:38:58.000000000 -0500
@@ -95,8 +95,8 @@ static int zt5550_hc_config(struct pci_d
 
 	hc_dev = pdev;
 	dbg("hc_dev = %p", hc_dev);
-	dbg("pci resource start %lx", pci_resource_start(hc_dev, 1));
-	dbg("pci resource len %lx", pci_resource_len(hc_dev, 1));
+	dbg("pci resource start %llx", (unsigned long long)pci_resource_start(hc_dev, 1));
+	dbg("pci resource len %llx", (unsigned long long)pci_resource_len(hc_dev, 1));
 
 	if(!request_mem_region(pci_resource_start(hc_dev, 1),
 				pci_resource_len(hc_dev, 1), MY_NAME)) {
@@ -108,8 +108,9 @@ static int zt5550_hc_config(struct pci_d
 	hc_registers =
 	    ioremap(pci_resource_start(hc_dev, 1), pci_resource_len(hc_dev, 1));
 	if(!hc_registers) {
-		err("cannot remap MMIO region %lx @ %lx",
-		    pci_resource_len(hc_dev, 1), pci_resource_start(hc_dev, 1));
+		err("cannot remap MMIO region %llx @ %llx",
+			(unsigned long long)pci_resource_len(hc_dev, 1),
+			(unsigned long long)pci_resource_start(hc_dev, 1));
 		ret = -ENODEV;
 		goto exit_release_region;
 	}
diff -puN drivers/pci/hotplug/cpqphp_core.c~64bit-resources-drivers-pci-changes drivers/pci/hotplug/cpqphp_core.c
--- linux-2.6.16-mm1/drivers/pci/hotplug/cpqphp_core.c~64bit-resources-drivers-pci-changes	2006-03-23 11:38:58.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/pci/hotplug/cpqphp_core.c	2006-03-23 11:38:58.000000000 -0500
@@ -1089,8 +1089,8 @@ static int cpqhpc_probe(struct pci_dev *
 	}
 	
 	dbg("pdev = %p\n", pdev);
-	dbg("pci resource start %lx\n", pci_resource_start(pdev, 0));
-	dbg("pci resource len %lx\n", pci_resource_len(pdev, 0));
+	dbg("pci resource start %llx\n", (unsigned long long)pci_resource_start(pdev, 0));
+	dbg("pci resource len %llx\n", (unsigned long long)pci_resource_len(pdev, 0));
 
 	if (!request_mem_region(pci_resource_start(pdev, 0),
 				pci_resource_len(pdev, 0), MY_NAME)) {
@@ -1102,9 +1102,9 @@ static int cpqhpc_probe(struct pci_dev *
 	ctrl->hpc_reg = ioremap(pci_resource_start(pdev, 0),
 					pci_resource_len(pdev, 0));
 	if (!ctrl->hpc_reg) {
-		err("cannot remap MMIO region %lx @ %lx\n",
-				pci_resource_len(pdev, 0),
-				pci_resource_start(pdev, 0));
+		err("cannot remap MMIO region %llx @ %llx\n",
+		    (unsigned long long)pci_resource_len(pdev, 0),
+		    (unsigned long long)pci_resource_start(pdev, 0));
 		rc = -ENODEV;
 		goto err_free_mem_region;
 	}
diff -puN drivers/pci/hotplug/pciehp_hpc.c~64bit-resources-drivers-pci-changes drivers/pci/hotplug/pciehp_hpc.c
--- linux-2.6.16-mm1/drivers/pci/hotplug/pciehp_hpc.c~64bit-resources-drivers-pci-changes	2006-03-23 11:38:58.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/pci/hotplug/pciehp_hpc.c	2006-03-23 11:38:58.000000000 -0500
@@ -1398,8 +1398,9 @@ int pcie_init(struct controller * ctrl, 
 
 	for ( rc = 0; rc < DEVICE_COUNT_RESOURCE; rc++)
 		if (pci_resource_len(pdev, rc) > 0)
-			dbg("pci resource[%d] start=0x%lx(len=0x%lx)\n", rc,
-				pci_resource_start(pdev, rc), pci_resource_len(pdev, rc));
+			dbg("pci resource[%d] start=0x%llx(len=0x%llx)\n", rc,
+			    (unsigned long long)pci_resource_start(pdev, rc),
+			    (unsigned long long)pci_resource_len(pdev, rc));
 
 	info("HPC vendor_id %x device_id %x ss_vid %x ss_did %x\n", pdev->vendor, pdev->device, 
 		pdev->subsystem_vendor, pdev->subsystem_device);
diff -puN drivers/pci/hotplug/shpchp_sysfs.c~64bit-resources-drivers-pci-changes drivers/pci/hotplug/shpchp_sysfs.c
--- linux-2.6.16-mm1/drivers/pci/hotplug/shpchp_sysfs.c~64bit-resources-drivers-pci-changes	2006-03-23 11:38:58.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/pci/hotplug/shpchp_sysfs.c	2006-03-23 11:38:58.000000000 -0500
@@ -51,8 +51,10 @@ static ssize_t show_ctrl (struct device 
 		res = bus->resource[index];
 		if (res && (res->flags & IORESOURCE_MEM) &&
 				!(res->flags & IORESOURCE_PREFETCH)) {
-			out += sprintf(out, "start = %8.8lx, length = %8.8lx\n",
-					res->start, (res->end - res->start));
+			out += sprintf(out, "start = %8.8llx, "
+					"length = %8.8llx\n",
+					(unsigned long long)res->start,
+					(unsigned long long)(res->end - res->start));
 		}
 	}
 	out += sprintf(out, "Free resources: prefetchable memory\n");
@@ -60,16 +62,20 @@ static ssize_t show_ctrl (struct device 
 		res = bus->resource[index];
 		if (res && (res->flags & IORESOURCE_MEM) &&
 			       (res->flags & IORESOURCE_PREFETCH)) {
-			out += sprintf(out, "start = %8.8lx, length = %8.8lx\n",
-					res->start, (res->end - res->start));
+			out += sprintf(out, "start = %8.8llx, "
+					"length = %8.8llx\n",
+					(unsigned long long)res->start,
+					(unsigned long long)(res->end - res->start));
 		}
 	}
 	out += sprintf(out, "Free resources: IO\n");
 	for (index = 0; index < PCI_BUS_NUM_RESOURCES; index++) {
 		res = bus->resource[index];
 		if (res && (res->flags & IORESOURCE_IO)) {
-			out += sprintf(out, "start = %8.8lx, length = %8.8lx\n",
-					res->start, (res->end - res->start));
+			out += sprintf(out, "start = %8.8llx, "
+					"length = %8.8llx\n",
+					(unsigned long long)res->start,
+					(unsigned long long)(res->end - res->start));
 		}
 	}
 	out += sprintf(out, "Free resources: bus numbers\n");
diff -puN drivers/pci/pci.c~64bit-resources-drivers-pci-changes drivers/pci/pci.c
--- linux-2.6.16-mm1/drivers/pci/pci.c~64bit-resources-drivers-pci-changes	2006-03-23 11:38:58.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/pci/pci.c	2006-03-23 11:38:58.000000000 -0500
@@ -669,10 +669,12 @@ int pci_request_region(struct pci_dev *p
 	return 0;
 
 err_out:
-	printk (KERN_WARNING "PCI: Unable to reserve %s region #%d:%lx@%lx for device %s\n",
+	printk (KERN_WARNING "PCI: Unable to reserve %s region #%d:%llx@%llx "
+		"for device %s\n",
 		pci_resource_flags(pdev, bar) & IORESOURCE_IO ? "I/O" : "mem",
 		bar + 1, /* PCI BAR # */
-		pci_resource_len(pdev, bar), pci_resource_start(pdev, bar),
+		(unsigned long long)pci_resource_len(pdev, bar),
+		(unsigned long long)pci_resource_start(pdev, bar),
 		pci_name(pdev));
 	return -EBUSY;
 }
diff -puN drivers/pci/pci.h~64bit-resources-drivers-pci-changes drivers/pci/pci.h
--- linux-2.6.16-mm1/drivers/pci/pci.h~64bit-resources-drivers-pci-changes	2006-03-23 11:38:58.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/pci/pci.h	2006-03-23 11:38:58.000000000 -0500
@@ -6,10 +6,10 @@ extern int pci_create_sysfs_dev_files(st
 extern void pci_remove_sysfs_dev_files(struct pci_dev *pdev);
 extern void pci_cleanup_rom(struct pci_dev *dev);
 extern int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res,
-				  unsigned long size, unsigned long align,
-				  unsigned long min, unsigned int type_mask,
+				  u64 size, u64 align,
+				  u64 min, unsigned int type_mask,
 				  void (*alignf)(void *, struct resource *,
-					  	 unsigned long, unsigned long),
+					  	 u64, u64),
 				  void *alignf_data);
 /* Firmware callbacks */
 extern int (*platform_pci_choose_state)(struct pci_dev *dev, pm_message_t state);
diff -puN drivers/pci/proc.c~64bit-resources-drivers-pci-changes drivers/pci/proc.c
--- linux-2.6.16-mm1/drivers/pci/proc.c~64bit-resources-drivers-pci-changes	2006-03-23 11:38:58.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/pci/proc.c	2006-03-23 11:38:58.000000000 -0500
@@ -302,12 +302,6 @@ static struct file_operations proc_bus_p
 #endif /* HAVE_PCI_MMAP */
 };
 
-#if BITS_PER_LONG == 32
-#define LONG_FORMAT "\t%08lx"
-#else
-#define LONG_FORMAT "\t%16lx"
-#endif
-
 /* iterator */
 static void *pci_seq_start(struct seq_file *m, loff_t *pos)
 {
@@ -358,16 +352,16 @@ static int show_device(struct seq_file *
 	for (i=0; i<7; i++) {
 		u64 start, end;
 		pci_resource_to_user(dev, i, &dev->resource[i], &start, &end);
-		seq_printf(m, LONG_FORMAT,
-			((unsigned long)start) |
-			(dev->resource[i].flags & PCI_REGION_FLAG_MASK));
+		seq_printf(m, "\t%16llx",
+			(unsigned long long)(start |
+			(dev->resource[i].flags & PCI_REGION_FLAG_MASK)));
 	}
 	for (i=0; i<7; i++) {
 		u64 start, end;
 		pci_resource_to_user(dev, i, &dev->resource[i], &start, &end);
-		seq_printf(m, LONG_FORMAT,
+		seq_printf(m, "\t%16llx",
 			dev->resource[i].start < dev->resource[i].end ?
-			(unsigned long)(end - start) + 1 : 0);
+			(unsigned long long)(end - start) + 1 : 0);
 	}
 	seq_putc(m, '\t');
 	if (drv)
diff -puN drivers/pci/rom.c~64bit-resources-drivers-pci-changes drivers/pci/rom.c
--- linux-2.6.16-mm1/drivers/pci/rom.c~64bit-resources-drivers-pci-changes	2006-03-23 11:38:58.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/pci/rom.c	2006-03-23 11:38:58.000000000 -0500
@@ -80,8 +80,8 @@ void __iomem *pci_map_rom(struct pci_dev
 	} else {
 		if (res->flags & IORESOURCE_ROM_COPY) {
 			*size = pci_resource_len(pdev, PCI_ROM_RESOURCE);
-			return (void __iomem *)pci_resource_start(pdev,
-							     PCI_ROM_RESOURCE);
+			return (void __iomem *)(unsigned long)
+				pci_resource_start(pdev, PCI_ROM_RESOURCE);
 		} else {
 			/* assign the ROM an address if it doesn't have one */
 			if (res->parent == NULL &&
@@ -170,11 +170,11 @@ void __iomem *pci_map_rom_copy(struct pc
 		return rom;
 
 	res->end = res->start + *size;
-	memcpy_fromio((void*)res->start, rom, *size);
+	memcpy_fromio((void*)(unsigned long)res->start, rom, *size);
 	pci_unmap_rom(pdev, rom);
 	res->flags |= IORESOURCE_ROM_COPY;
 
-	return (void __iomem *)res->start;
+	return (void __iomem *)(unsigned long)res->start;
 }
 
 /**
@@ -227,7 +227,7 @@ void pci_cleanup_rom(struct pci_dev *pde
 {
 	struct resource *res = &pdev->resource[PCI_ROM_RESOURCE];
 	if (res->flags & IORESOURCE_ROM_COPY) {
-		kfree((void*)res->start);
+		kfree((void*)(unsigned long)res->start);
 		res->flags &= ~IORESOURCE_ROM_COPY;
 		res->start = 0;
 		res->end = 0;
diff -puN drivers/pci/setup-bus.c~64bit-resources-drivers-pci-changes drivers/pci/setup-bus.c
--- linux-2.6.16-mm1/drivers/pci/setup-bus.c~64bit-resources-drivers-pci-changes	2006-03-23 11:38:58.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/pci/setup-bus.c	2006-03-23 11:38:58.000000000 -0500
@@ -356,8 +356,10 @@ pbus_size_mem(struct pci_bus *bus, unsig
 			order = __ffs(align) - 20;
 			if (order > 11) {
 				printk(KERN_WARNING "PCI: region %s/%d "
-				       "too large: %lx-%lx\n",
-				       pci_name(dev), i, r->start, r->end);
+				       "too large: %llx-%llx\n",
+					pci_name(dev), i,
+					(unsigned long long)r->start,
+					(unsigned long long)r->end);
 				r->flags = 0;
 				continue;
 			}
diff -puN drivers/pci/setup-res.c~64bit-resources-drivers-pci-changes drivers/pci/setup-res.c
--- linux-2.6.16-mm1/drivers/pci/setup-res.c~64bit-resources-drivers-pci-changes	2006-03-23 11:38:58.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/pci/setup-res.c	2006-03-23 11:38:58.000000000 -0500
@@ -40,8 +40,9 @@ pci_update_resource(struct pci_dev *dev,
 
 	pcibios_resource_to_bus(dev, &region, res);
 
-	pr_debug("  got res [%lx:%lx] bus [%lx:%lx] flags %lx for "
-		 "BAR %d of %s\n", res->start, res->end,
+	pr_debug("  got res [%llx:%llx] bus [%lx:%lx] flags %lx for "
+		 "BAR %d of %s\n", (unsigned long long)res->start,
+		 (unsigned long long)res->end,
 		 region.start, region.end, res->flags, resno, pci_name(dev));
 
 	new = region.start | (res->flags & PCI_REGION_FLAG_MASK);
@@ -104,10 +105,12 @@ pci_claim_resource(struct pci_dev *dev, 
 		err = insert_resource(root, res);
 
 	if (err) {
-		printk(KERN_ERR "PCI: %s region %d of %s %s [%lx:%lx]\n",
-		       root ? "Address space collision on" :
-			      "No parent found for",
-		       resource, dtype, pci_name(dev), res->start, res->end);
+		printk(KERN_ERR "PCI: %s region %d of %s %s [%llx:%llx]\n",
+			root ? "Address space collision on" :
+				"No parent found for",
+			resource, dtype, pci_name(dev),
+			(unsigned long long)res->start,
+			(unsigned long long)res->end);
 	}
 
 	return err;
@@ -118,7 +121,7 @@ int pci_assign_resource(struct pci_dev *
 {
 	struct pci_bus *bus = dev->bus;
 	struct resource *res = dev->resource + resno;
-	unsigned long size, min, align;
+	u64 size, min, align;
 	int ret;
 
 	size = res->end - res->start + 1;
@@ -145,9 +148,11 @@ int pci_assign_resource(struct pci_dev *
 	}
 
 	if (ret) {
-		printk(KERN_ERR "PCI: Failed to allocate %s resource #%d:%lx@%lx for %s\n",
-		       res->flags & IORESOURCE_IO ? "I/O" : "mem",
-		       resno, size, res->start, pci_name(dev));
+		printk(KERN_ERR "PCI: Failed to allocate %s resource "
+			"#%d:%llx@%llx for %s\n",
+			res->flags & IORESOURCE_IO ? "I/O" : "mem",
+			resno, (unsigned long long)size,
+			(unsigned long long)res->start, pci_name(dev));
 	} else if (resno < PCI_BRIDGE_RESOURCES) {
 		pci_update_resource(dev, res, resno);
 	}
@@ -164,7 +169,7 @@ pdev_sort_resources(struct pci_dev *dev,
 	for (i = 0; i < PCI_NUM_RESOURCES; i++) {
 		struct resource *r;
 		struct resource_list *list, *tmp;
-		unsigned long r_align;
+		u64 r_align;
 
 		r = &dev->resource[i];
 		r_align = r->end - r->start;
@@ -173,13 +178,14 @@ pdev_sort_resources(struct pci_dev *dev,
 			continue;
 		if (!r_align) {
 			printk(KERN_WARNING "PCI: Ignore bogus resource %d "
-					    "[%lx:%lx] of %s\n",
-					    i, r->start, r->end, pci_name(dev));
+				"[%llx:%llx] of %s\n",
+				i, (unsigned long long)r->start,
+				(unsigned long long)r->end, pci_name(dev));
 			continue;
 		}
 		r_align = (i < PCI_BRIDGE_RESOURCES) ? r_align + 1 : r->start;
 		for (list = head; ; list = list->next) {
-			unsigned long align = 0;
+			u64 align = 0;
 			struct resource_list *ln = list->next;
 			int idx;
 
diff -puN include/linux/pci.h~64bit-resources-drivers-pci-changes include/linux/pci.h
--- linux-2.6.16-mm1/include/linux/pci.h~64bit-resources-drivers-pci-changes	2006-03-23 11:38:58.000000000 -0500
+++ linux-2.6.16-mm1-root/include/linux/pci.h	2006-03-23 11:38:58.000000000 -0500
@@ -403,7 +403,7 @@ char *pcibios_setup (char *str);
 
 /* Used only when drivers/pci/setup.c is used */
 void pcibios_align_resource(void *, struct resource *,
-			    unsigned long, unsigned long);
+			    u64, u64);
 void pcibios_update_irq(struct pci_dev *, int irq);
 
 /* Generic PCI functions used internally */
@@ -528,10 +528,10 @@ void pci_release_region(struct pci_dev *
 
 /* drivers/pci/bus.c */
 int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res,
-			   unsigned long size, unsigned long align,
-			   unsigned long min, unsigned int type_mask,
+			   u64 size, u64 align,
+			   u64 min, unsigned int type_mask,
 			   void (*alignf)(void *, struct resource *,
-					  unsigned long, unsigned long),
+					  u64, u64),
 			   void *alignf_data);
 void pci_enable_bridges(struct pci_bus *bus);
 
_

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [RFC][PATCH 3/10] 64 bit resources drivers ide changes
  2006-03-23 20:01   ` [RFC][PATCH 2/10] 64 bit resources drivers pci changes Vivek Goyal
@ 2006-03-23 20:02     ` Vivek Goyal
  2006-03-23 20:03       ` [RFC][PATCH 4/10] 64 bit resources drivers media changes Vivek Goyal
  2006-03-24 12:15       ` [RFC][PATCH 3/10] 64 bit resources drivers ide changes Alan Cox
  0 siblings, 2 replies; 26+ messages in thread
From: Vivek Goyal @ 2006-03-23 20:02 UTC (permalink / raw)
  To: linux kernel mailing list, Fastboot mailing list
  Cc: Linus Torvalds, Morton Andrew Morton, Eric W. Biederman, galak,
	gregkh, bcrl, Dave Jiang, arjan, Maneesh Soni, Murali



o Changes required under drivers/ide/* for 64bit resources.

Signed-off-by: Dave Jiang <dave.jiang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
---

 drivers/ide/pci/aec62xx.c      |    3 ++-
 drivers/ide/pci/cmd64x.c       |    3 ++-
 drivers/ide/pci/hpt34x.c       |    4 ++--
 drivers/ide/pci/pdc202xx_new.c |    4 ++--
 drivers/ide/pci/pdc202xx_old.c |    4 ++--
 5 files changed, 10 insertions(+), 8 deletions(-)

diff -puN drivers/ide/pci/aec62xx.c~64bit-resources-drivers-ide-changes drivers/ide/pci/aec62xx.c
--- linux-2.6.16-mm1/drivers/ide/pci/aec62xx.c~64bit-resources-drivers-ide-changes	2006-03-23 11:39:01.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/ide/pci/aec62xx.c	2006-03-23 11:39:01.000000000 -0500
@@ -254,7 +254,8 @@ static unsigned int __devinit init_chips
 
 	if (dev->resource[PCI_ROM_RESOURCE].start) {
 		pci_write_config_dword(dev, PCI_ROM_ADDRESS, dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE);
-		printk(KERN_INFO "%s: ROM enabled at 0x%08lx\n", name, dev->resource[PCI_ROM_RESOURCE].start);
+		printk(KERN_INFO "%s: ROM enabled at 0x%016llx\n", name,
+			(unsigned long long)dev->resource[PCI_ROM_RESOURCE].start);
 	}
 
 	if (bus_speed <= 33)
diff -puN drivers/ide/pci/cmd64x.c~64bit-resources-drivers-ide-changes drivers/ide/pci/cmd64x.c
--- linux-2.6.16-mm1/drivers/ide/pci/cmd64x.c~64bit-resources-drivers-ide-changes	2006-03-23 11:39:01.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/ide/pci/cmd64x.c	2006-03-23 11:39:01.000000000 -0500
@@ -609,7 +609,8 @@ static unsigned int __devinit init_chips
 #ifdef __i386__
 	if (dev->resource[PCI_ROM_RESOURCE].start) {
 		pci_write_config_dword(dev, PCI_ROM_ADDRESS, dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE);
-		printk(KERN_INFO "%s: ROM enabled at 0x%08lx\n", name, dev->resource[PCI_ROM_RESOURCE].start);
+		printk(KERN_INFO "%s: ROM enabled at 0x%016llx\n", name,
+			(unsigned long long)dev->resource[PCI_ROM_RESOURCE].start);
 	}
 #endif
 
diff -puN drivers/ide/pci/hpt34x.c~64bit-resources-drivers-ide-changes drivers/ide/pci/hpt34x.c
--- linux-2.6.16-mm1/drivers/ide/pci/hpt34x.c~64bit-resources-drivers-ide-changes	2006-03-23 11:39:01.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/ide/pci/hpt34x.c	2006-03-23 11:39:01.000000000 -0500
@@ -175,8 +175,8 @@ static unsigned int __devinit init_chips
 		if (pci_resource_start(dev, PCI_ROM_RESOURCE)) {
 			pci_write_config_dword(dev, PCI_ROM_ADDRESS,
 				dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE);
-			printk(KERN_INFO "HPT345: ROM enabled at 0x%08lx\n",
-				dev->resource[PCI_ROM_RESOURCE].start);
+			printk(KERN_INFO "HPT345: ROM enabled at 0x%016llx\n",
+				(unsigned long long)dev->resource[PCI_ROM_RESOURCE].start);
 		}
 		pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0xF0);
 	} else {
diff -puN drivers/ide/pci/pdc202xx_new.c~64bit-resources-drivers-ide-changes drivers/ide/pci/pdc202xx_new.c
--- linux-2.6.16-mm1/drivers/ide/pci/pdc202xx_new.c~64bit-resources-drivers-ide-changes	2006-03-23 11:39:01.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/ide/pci/pdc202xx_new.c	2006-03-23 11:39:01.000000000 -0500
@@ -313,8 +313,8 @@ static unsigned int __devinit init_chips
 	if (dev->resource[PCI_ROM_RESOURCE].start) {
 		pci_write_config_dword(dev, PCI_ROM_ADDRESS,
 			dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE);
-		printk(KERN_INFO "%s: ROM enabled at 0x%08lx\n",
-			name, dev->resource[PCI_ROM_RESOURCE].start);
+		printk(KERN_INFO "%s: ROM enabled at 0x%016llx\n", name,
+			(unsigned long long)dev->resource[PCI_ROM_RESOURCE].start);
 	}
 
 #ifdef CONFIG_PPC_PMAC
diff -puN drivers/ide/pci/pdc202xx_old.c~64bit-resources-drivers-ide-changes drivers/ide/pci/pdc202xx_old.c
--- linux-2.6.16-mm1/drivers/ide/pci/pdc202xx_old.c~64bit-resources-drivers-ide-changes	2006-03-23 11:39:01.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/ide/pci/pdc202xx_old.c	2006-03-23 11:39:01.000000000 -0500
@@ -580,8 +580,8 @@ static unsigned int __devinit init_chips
 	if (dev->resource[PCI_ROM_RESOURCE].start) {
 		pci_write_config_dword(dev, PCI_ROM_ADDRESS,
 			dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE);
-		printk(KERN_INFO "%s: ROM enabled at 0x%08lx\n",
-			name, dev->resource[PCI_ROM_RESOURCE].start);
+		printk(KERN_INFO "%s: ROM enabled at 0x%016llx\n", name,
+			(unsigned long long)dev->resource[PCI_ROM_RESOURCE].start);
 	}
 
 	/*
_

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [RFC][PATCH 4/10] 64 bit resources drivers media changes
  2006-03-23 20:02     ` [RFC][PATCH 3/10] 64 bit resources drivers ide changes Vivek Goyal
@ 2006-03-23 20:03       ` Vivek Goyal
  2006-03-23 20:04         ` [RFC][PATCH 5/10] 64 bit resources drivers net changes Vivek Goyal
  2006-03-24 12:15       ` [RFC][PATCH 3/10] 64 bit resources drivers ide changes Alan Cox
  1 sibling, 1 reply; 26+ messages in thread
From: Vivek Goyal @ 2006-03-23 20:03 UTC (permalink / raw)
  To: linux kernel mailing list, Fastboot mailing list
  Cc: Linus Torvalds, Morton Andrew Morton, Eric W. Biederman, galak,
	gregkh, bcrl, Dave Jiang, arjan, Maneesh Soni, Murali



o Changes required under drivers/media/* for 64bit resources.

Signed-off-by: Murali M Chakravarthy <muralim@in.ibm.com>
Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
---

 drivers/media/video/bttv-driver.c          |   10 ++++++----
 drivers/media/video/cx88/cx88-alsa.c       |    8 ++++----
 drivers/media/video/cx88/cx88-core.c       |    4 ++--
 drivers/media/video/cx88/cx88-mpeg.c       |    4 ++--
 drivers/media/video/cx88/cx88-video.c      |    4 ++--
 drivers/media/video/saa7134/saa7134-core.c |    8 ++++----
 6 files changed, 20 insertions(+), 18 deletions(-)

diff -puN drivers/media/video/cx88/cx88-alsa.c~64bit-resources-drivers-media-chages drivers/media/video/cx88/cx88-alsa.c
--- linux-2.6.16-mm1/drivers/media/video/cx88/cx88-alsa.c~64bit-resources-drivers-media-chages	2006-03-23 11:39:04.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/media/video/cx88/cx88-alsa.c	2006-03-23 11:39:04.000000000 -0500
@@ -713,9 +713,9 @@ static int __devinit snd_cx88_create(str
 	pci_read_config_byte(pci, PCI_LATENCY_TIMER,  &chip->pci_lat);
 
 	dprintk(1,"ALSA %s/%i: found at %s, rev: %d, irq: %d, "
-	       "latency: %d, mmio: 0x%lx\n", core->name, devno,
+	       "latency: %d, mmio: 0x%llx\n", core->name, devno,
 	       pci_name(pci), chip->pci_rev, pci->irq,
-	       chip->pci_lat,pci_resource_start(pci,0));
+	       chip->pci_lat,(unsigned long long)pci_resource_start(pci,0));
 
 	chip->irq = pci->irq;
 	synchronize_irq(chip->irq);
@@ -767,8 +767,8 @@ static int __devinit cx88_audio_initdev(
 
 	strcpy (card->driver, "CX88x");
 	sprintf(card->shortname, "Conexant CX%x", pci->device);
-	sprintf(card->longname, "%s at %#lx",
-		card->shortname, pci_resource_start(pci, 0));
+	sprintf(card->longname, "%s at %#llx",
+		card->shortname,(unsigned long long)pci_resource_start(pci, 0));
 	strcpy (card->mixername, "CX88");
 
 	dprintk (0, "%s/%i: ALSA support for cx2388x boards\n",
diff -puN drivers/media/video/cx88/cx88-core.c~64bit-resources-drivers-media-chages drivers/media/video/cx88/cx88-core.c
--- linux-2.6.16-mm1/drivers/media/video/cx88/cx88-core.c~64bit-resources-drivers-media-chages	2006-03-23 11:39:04.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/media/video/cx88/cx88-core.c	2006-03-23 11:39:04.000000000 -0500
@@ -1027,8 +1027,8 @@ static int get_ressources(struct cx88_co
 			       pci_resource_len(pci,0),
 			       core->name))
 		return 0;
-	printk(KERN_ERR "%s: can't get MMIO memory @ 0x%lx\n",
-	       core->name,pci_resource_start(pci,0));
+	printk(KERN_ERR "%s: can't get MMIO memory @ 0x%llx\n",
+	       core->name,(unsigned long long)pci_resource_start(pci,0));
 	return -EBUSY;
 }
 
diff -puN drivers/media/video/cx88/cx88-mpeg.c~64bit-resources-drivers-media-chages drivers/media/video/cx88/cx88-mpeg.c
--- linux-2.6.16-mm1/drivers/media/video/cx88/cx88-mpeg.c~64bit-resources-drivers-media-chages	2006-03-23 11:39:04.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/media/video/cx88/cx88-mpeg.c	2006-03-23 11:39:04.000000000 -0500
@@ -386,9 +386,9 @@ int cx8802_init_common(struct cx8802_dev
 	pci_read_config_byte(dev->pci, PCI_CLASS_REVISION, &dev->pci_rev);
 	pci_read_config_byte(dev->pci, PCI_LATENCY_TIMER,  &dev->pci_lat);
 	printk(KERN_INFO "%s/2: found at %s, rev: %d, irq: %d, "
-	       "latency: %d, mmio: 0x%lx\n", dev->core->name,
+	       "latency: %d, mmio: 0x%llx\n", dev->core->name,
 	       pci_name(dev->pci), dev->pci_rev, dev->pci->irq,
-	       dev->pci_lat,pci_resource_start(dev->pci,0));
+	       dev->pci_lat,(unsigned long long)pci_resource_start(dev->pci,0));
 
 	/* initialize driver struct */
 	spin_lock_init(&dev->slock);
diff -puN drivers/media/video/cx88/cx88-video.c~64bit-resources-drivers-media-chages drivers/media/video/cx88/cx88-video.c
--- linux-2.6.16-mm1/drivers/media/video/cx88/cx88-video.c~64bit-resources-drivers-media-chages	2006-03-23 11:39:04.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/media/video/cx88/cx88-video.c	2006-03-23 11:39:04.000000000 -0500
@@ -1828,9 +1828,9 @@ static int __devinit cx8800_initdev(stru
 	pci_read_config_byte(pci_dev, PCI_CLASS_REVISION, &dev->pci_rev);
 	pci_read_config_byte(pci_dev, PCI_LATENCY_TIMER,  &dev->pci_lat);
 	printk(KERN_INFO "%s/0: found at %s, rev: %d, irq: %d, "
-	       "latency: %d, mmio: 0x%lx\n", core->name,
+	       "latency: %d, mmio: 0x%llx\n", core->name,
 	       pci_name(pci_dev), dev->pci_rev, pci_dev->irq,
-	       dev->pci_lat,pci_resource_start(pci_dev,0));
+	       dev->pci_lat,(unsigned long long)pci_resource_start(pci_dev,0));
 
 	pci_set_master(pci_dev);
 	if (!pci_dma_supported(pci_dev,0xffffffff)) {
diff -puN drivers/media/video/saa7134/saa7134-core.c~64bit-resources-drivers-media-chages drivers/media/video/saa7134/saa7134-core.c
--- linux-2.6.16-mm1/drivers/media/video/saa7134/saa7134-core.c~64bit-resources-drivers-media-chages	2006-03-23 11:39:04.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/media/video/saa7134/saa7134-core.c	2006-03-23 11:39:04.000000000 -0500
@@ -866,9 +866,9 @@ static int __devinit saa7134_initdev(str
 	pci_read_config_byte(pci_dev, PCI_CLASS_REVISION, &dev->pci_rev);
 	pci_read_config_byte(pci_dev, PCI_LATENCY_TIMER,  &dev->pci_lat);
 	printk(KERN_INFO "%s: found at %s, rev: %d, irq: %d, "
-	       "latency: %d, mmio: 0x%lx\n", dev->name,
+	       "latency: %d, mmio: 0x%llx\n", dev->name,
 	       pci_name(pci_dev), dev->pci_rev, pci_dev->irq,
-	       dev->pci_lat,pci_resource_start(pci_dev,0));
+	       dev->pci_lat,(unsigned long long)pci_resource_start(pci_dev,0));
 	pci_set_master(pci_dev);
 	if (!pci_dma_supported(pci_dev,0xffffffff)) {
 		printk("%s: Oops: no 32bit PCI DMA ???\n",dev->name);
@@ -900,8 +900,8 @@ static int __devinit saa7134_initdev(str
 				pci_resource_len(pci_dev,0),
 				dev->name)) {
 		err = -EBUSY;
-		printk(KERN_ERR "%s: can't get MMIO memory @ 0x%lx\n",
-		       dev->name,pci_resource_start(pci_dev,0));
+		printk(KERN_ERR "%s: can't get MMIO memory @ 0x%llx\n",
+		       dev->name,(unsigned long long)pci_resource_start(pci_dev,0));
 		goto fail1;
 	}
 	dev->lmmio = ioremap(pci_resource_start(pci_dev,0), 0x1000);
diff -puN drivers/media/video/bttv-driver.c~64bit-resources-drivers-media-chages drivers/media/video/bttv-driver.c
--- linux-2.6.16-mm1/drivers/media/video/bttv-driver.c~64bit-resources-drivers-media-chages	2006-03-23 11:39:04.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/media/video/bttv-driver.c	2006-03-23 11:39:04.000000000 -0500
@@ -3956,8 +3956,9 @@ static int __devinit bttv_probe(struct p
 	if (!request_mem_region(pci_resource_start(dev,0),
 				pci_resource_len(dev,0),
 				btv->c.name)) {
-		printk(KERN_WARNING "bttv%d: can't request iomem (0x%lx).\n",
-		       btv->c.nr, pci_resource_start(dev,0));
+		printk(KERN_WARNING "bttv%d: can't request iomem (0x%llx).\n",
+		       btv->c.nr,
+		       (unsigned long long)pci_resource_start(dev,0));
 		return -EBUSY;
 	}
 	pci_set_master(dev);
@@ -3968,8 +3969,9 @@ static int __devinit bttv_probe(struct p
 	pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat);
 	printk(KERN_INFO "bttv%d: Bt%d (rev %d) at %s, ",
 	       bttv_num,btv->id, btv->revision, pci_name(dev));
-	printk("irq: %d, latency: %d, mmio: 0x%lx\n",
-	       btv->c.pci->irq, lat, pci_resource_start(dev,0));
+	printk("irq: %d, latency: %d, mmio: 0x%llx\n",
+	       btv->c.pci->irq, lat,
+	       (unsigned long long)pci_resource_start(dev,0));
 	schedule();
 
 	btv->bt848_mmio=ioremap(pci_resource_start(dev,0), 0x1000);
_

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [RFC][PATCH 5/10] 64 bit resources drivers net changes
  2006-03-23 20:03       ` [RFC][PATCH 4/10] 64 bit resources drivers media changes Vivek Goyal
@ 2006-03-23 20:04         ` Vivek Goyal
  2006-03-23 20:06           ` [RFC][PATCH 6/10] 64 bit resources drivers pcmcia changes Vivek Goyal
  0 siblings, 1 reply; 26+ messages in thread
From: Vivek Goyal @ 2006-03-23 20:04 UTC (permalink / raw)
  To: linux kernel mailing list, Fastboot mailing list
  Cc: Linus Torvalds, Morton Andrew Morton, Eric W. Biederman, galak,
	gregkh, bcrl, Dave Jiang, arjan, Maneesh Soni, Murali



o Changes required under drivers/net/* for 64bit resources.

Signed-off-by: Dave Jiang <dave.jiang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Murali M Chakravarthy <muralim@in.ibm.com>
Signed-off-by: Maneesh Soni <maneesh@in.ibm.com>
Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
---

 drivers/net/3c59x.c            |    6 ++++--
 drivers/net/8139cp.c           |   11 ++++++-----
 drivers/net/8139too.c          |    6 +++---
 drivers/net/e100.c             |    4 ++--
 drivers/net/skge.c             |    4 ++--
 drivers/net/sky2.c             |    6 +++---
 drivers/net/tulip/de2104x.c    |    9 +++++----
 drivers/net/tulip/tulip_core.c |    6 +++---
 drivers/net/typhoon.c          |    5 +++--
 drivers/net/wan/dscc4.c        |   12 ++++++------
 drivers/net/wan/pc300_drv.c    |    4 ++--
 11 files changed, 39 insertions(+), 34 deletions(-)

diff -puN drivers/net/3c59x.c~64bit-resources-drivers-net-changes drivers/net/3c59x.c
--- linux-2.6.16-mm1/drivers/net/3c59x.c~64bit-resources-drivers-net-changes	2006-03-23 11:39:08.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/net/3c59x.c	2006-03-23 11:39:08.000000000 -0500
@@ -1413,8 +1413,10 @@ static int __devinit vortex_probe1(struc
 		}
 
 		if (print_info) {
-			printk(KERN_INFO "%s: CardBus functions mapped %8.8lx->%p\n",
-				print_name, pci_resource_start(pdev, 2),
+			printk(KERN_INFO "%s: CardBus functions mapped "
+				"%16.16llx->%p\n",
+				print_name,
+				(unsigned long long)pci_resource_start(pdev, 2),
 				vp->cb_fn_base);
 		}
 		EL3WINDOW(2);
diff -puN drivers/net/8139cp.c~64bit-resources-drivers-net-changes drivers/net/8139cp.c
--- linux-2.6.16-mm1/drivers/net/8139cp.c~64bit-resources-drivers-net-changes	2006-03-23 11:39:08.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/net/8139cp.c	2006-03-23 11:39:08.000000000 -0500
@@ -1671,7 +1671,7 @@ static int cp_init_one (struct pci_dev *
 	struct cp_private *cp;
 	int rc;
 	void __iomem *regs;
-	long pciaddr;
+	u64 pciaddr;
 	unsigned int addr_len, i, pci_using_dac;
 	u8 pci_rev;
 
@@ -1731,8 +1731,8 @@ static int cp_init_one (struct pci_dev *
 	}
 	if (pci_resource_len(pdev, 1) < CP_REGS_SIZE) {
 		rc = -EIO;
-		printk(KERN_ERR PFX "MMIO resource (%lx) too small on pci dev %s\n",
-		       pci_resource_len(pdev, 1), pci_name(pdev));
+		printk(KERN_ERR PFX "MMIO resource (%llx) too small on pci dev %s\n",
+		       (unsigned long long)pci_resource_len(pdev, 1), pci_name(pdev));
 		goto err_out_res;
 	}
 
@@ -1764,8 +1764,9 @@ static int cp_init_one (struct pci_dev *
 	regs = ioremap(pciaddr, CP_REGS_SIZE);
 	if (!regs) {
 		rc = -EIO;
-		printk(KERN_ERR PFX "Cannot map PCI MMIO (%lx@%lx) on pci dev %s\n",
-		       pci_resource_len(pdev, 1), pciaddr, pci_name(pdev));
+		printk(KERN_ERR PFX "Cannot map PCI MMIO (%llx@%llx) on pci dev %s\n",
+			(unsigned long long)pci_resource_len(pdev, 1),
+			(unsigned long long)pciaddr, pci_name(pdev));
 		goto err_out_res;
 	}
 	dev->base_addr = (unsigned long) regs;
diff -puN drivers/net/8139too.c~64bit-resources-drivers-net-changes drivers/net/8139too.c
--- linux-2.6.16-mm1/drivers/net/8139too.c~64bit-resources-drivers-net-changes	2006-03-23 11:39:08.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/net/8139too.c	2006-03-23 11:39:08.000000000 -0500
@@ -1341,9 +1341,9 @@ static int rtl8139_open (struct net_devi
 	netif_start_queue (dev);
 
 	if (netif_msg_ifup(tp))
-		printk(KERN_DEBUG "%s: rtl8139_open() ioaddr %#lx IRQ %d"
-			" GP Pins %2.2x %s-duplex.\n",
-			dev->name, pci_resource_start (tp->pci_dev, 1),
+		printk(KERN_DEBUG "%s: rtl8139_open() ioaddr %#llx IRQ %d"
+			" GP Pins %2.2x %s-duplex.\n", dev->name,
+			(unsigned long long)pci_resource_start (tp->pci_dev, 1),
 			dev->irq, RTL_R8 (MediaStatus),
 			tp->mii.full_duplex ? "full" : "half");
 
diff -puN drivers/net/e100.c~64bit-resources-drivers-net-changes drivers/net/e100.c
--- linux-2.6.16-mm1/drivers/net/e100.c~64bit-resources-drivers-net-changes	2006-03-23 11:39:08.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/net/e100.c	2006-03-23 11:39:08.000000000 -0500
@@ -2624,9 +2624,9 @@ static int __devinit e100_probe(struct p
 		goto err_out_free;
 	}
 
-	DPRINTK(PROBE, INFO, "addr 0x%lx, irq %d, "
+	DPRINTK(PROBE, INFO, "addr 0x%llx, irq %d, "
 		"MAC addr %02X:%02X:%02X:%02X:%02X:%02X\n",
-		pci_resource_start(pdev, 0), pdev->irq,
+		(unsigned long long)pci_resource_start(pdev, 0), pdev->irq,
 		netdev->dev_addr[0], netdev->dev_addr[1], netdev->dev_addr[2],
 		netdev->dev_addr[3], netdev->dev_addr[4], netdev->dev_addr[5]);
 
diff -puN drivers/net/skge.c~64bit-resources-drivers-net-changes drivers/net/skge.c
--- linux-2.6.16-mm1/drivers/net/skge.c~64bit-resources-drivers-net-changes	2006-03-23 11:39:08.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/net/skge.c	2006-03-23 11:39:08.000000000 -0500
@@ -3324,8 +3324,8 @@ static int __devinit skge_probe(struct p
 	if (err)
 		goto err_out_free_irq;
 
-	printk(KERN_INFO PFX DRV_VERSION " addr 0x%lx irq %d chip %s rev %d\n",
-	       pci_resource_start(pdev, 0), pdev->irq,
+	printk(KERN_INFO PFX DRV_VERSION " addr 0x%llx irq %d chip %s rev %d\n",
+	       (unsigned long long)pci_resource_start(pdev, 0), pdev->irq,
 	       skge_board_name(hw), hw->chip_rev);
 
 	if ((dev = skge_devinit(hw, 0, using_dac)) == NULL)
diff -puN drivers/net/sky2.c~64bit-resources-drivers-net-changes drivers/net/sky2.c
--- linux-2.6.16-mm1/drivers/net/sky2.c~64bit-resources-drivers-net-changes	2006-03-23 11:39:08.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/net/sky2.c	2006-03-23 11:39:08.000000000 -0500
@@ -3214,9 +3214,9 @@ static int __devinit sky2_probe(struct p
 	if (err)
 		goto err_out_iounmap;
 
-	printk(KERN_INFO PFX "v%s addr 0x%lx irq %d Yukon-%s (0x%x) rev %d\n",
-	       DRV_VERSION, pci_resource_start(pdev, 0), pdev->irq,
-	       yukon2_name[hw->chip_id - CHIP_ID_YUKON_XL],
+	printk(KERN_INFO PFX "v%s addr 0x%llx irq %d Yukon-%s (0x%x) rev %d\n",
+	       DRV_VERSION, (unsigned long long)pci_resource_start(pdev, 0),
+	       pdev->irq, yukon2_name[hw->chip_id - CHIP_ID_YUKON_XL],
 	       hw->chip_id, hw->chip_rev);
 
 	dev = sky2_init_netdev(hw, 0, using_dac);
diff -puN drivers/net/tulip/de2104x.c~64bit-resources-drivers-net-changes drivers/net/tulip/de2104x.c
--- linux-2.6.16-mm1/drivers/net/tulip/de2104x.c~64bit-resources-drivers-net-changes	2006-03-23 11:39:08.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/net/tulip/de2104x.c	2006-03-23 11:39:08.000000000 -0500
@@ -2007,8 +2007,8 @@ static int __init de_init_one (struct pc
 	}
 	if (pci_resource_len(pdev, 1) < DE_REGS_SIZE) {
 		rc = -EIO;
-		printk(KERN_ERR PFX "MMIO resource (%lx) too small on pci dev %s\n",
-		       pci_resource_len(pdev, 1), pci_name(pdev));
+		printk(KERN_ERR PFX "MMIO resource (%llx) too small on pci dev %s\n",
+		       (unsigned long long)pci_resource_len(pdev, 1), pci_name(pdev));
 		goto err_out_res;
 	}
 
@@ -2016,8 +2016,9 @@ static int __init de_init_one (struct pc
 	regs = ioremap_nocache(pciaddr, DE_REGS_SIZE);
 	if (!regs) {
 		rc = -EIO;
-		printk(KERN_ERR PFX "Cannot map PCI MMIO (%lx@%lx) on pci dev %s\n",
-		       pci_resource_len(pdev, 1), pciaddr, pci_name(pdev));
+		printk(KERN_ERR PFX "Cannot map PCI MMIO (%llx@%lx) on pci dev %s\n",
+			(unsigned long long)pci_resource_len(pdev, 1),
+			pciaddr, pci_name(pdev));
 		goto err_out_res;
 	}
 	dev->base_addr = (unsigned long) regs;
diff -puN drivers/net/tulip/tulip_core.c~64bit-resources-drivers-net-changes drivers/net/tulip/tulip_core.c
--- linux-2.6.16-mm1/drivers/net/tulip/tulip_core.c~64bit-resources-drivers-net-changes	2006-03-23 11:39:08.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/net/tulip/tulip_core.c	2006-03-23 11:39:08.000000000 -0500
@@ -1350,10 +1350,10 @@ static int __devinit tulip_init_one (str
 	SET_MODULE_OWNER(dev);
 	SET_NETDEV_DEV(dev, &pdev->dev);
 	if (pci_resource_len (pdev, 0) < tulip_tbl[chip_idx].io_size) {
-		printk (KERN_ERR PFX "%s: I/O region (0x%lx@0x%lx) too small, "
+		printk (KERN_ERR PFX "%s: I/O region (0x%llx@0x%llx) too small, "
 			"aborting\n", pci_name(pdev),
-			pci_resource_len (pdev, 0),
-			pci_resource_start (pdev, 0));
+			(unsigned long long)pci_resource_len (pdev, 0),
+			(unsigned long long)pci_resource_start (pdev, 0));
 		goto err_out_free_netdev;
 	}
 
diff -puN drivers/net/typhoon.c~64bit-resources-drivers-net-changes drivers/net/typhoon.c
--- linux-2.6.16-mm1/drivers/net/typhoon.c~64bit-resources-drivers-net-changes	2006-03-23 11:39:08.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/net/typhoon.c	2006-03-23 11:39:08.000000000 -0500
@@ -2568,9 +2568,10 @@ typhoon_init_one(struct pci_dev *pdev, c
 
 	pci_set_drvdata(pdev, dev);
 
-	printk(KERN_INFO "%s: %s at %s 0x%lx, ",
+	printk(KERN_INFO "%s: %s at %s 0x%llx, ",
 	       dev->name, typhoon_card_info[card_id].name,
-	       use_mmio ? "MMIO" : "IO", pci_resource_start(pdev, use_mmio));
+	       use_mmio ? "MMIO" : "IO",
+	       (unsigned long long)pci_resource_start(pdev, use_mmio));
 	for(i = 0; i < 5; i++)
 		printk("%2.2x:", dev->dev_addr[i]);
 	printk("%2.2x\n", dev->dev_addr[i]);
diff -puN drivers/net/wan/dscc4.c~64bit-resources-drivers-net-changes drivers/net/wan/dscc4.c
--- linux-2.6.16-mm1/drivers/net/wan/dscc4.c~64bit-resources-drivers-net-changes	2006-03-23 11:39:08.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/net/wan/dscc4.c	2006-03-23 11:39:08.000000000 -0500
@@ -732,15 +732,15 @@ static int __devinit dscc4_init_one(stru
 	ioaddr = ioremap(pci_resource_start(pdev, 0),
 					pci_resource_len(pdev, 0));
 	if (!ioaddr) {
-		printk(KERN_ERR "%s: cannot remap MMIO region %lx @ %lx\n",
-			DRV_NAME, pci_resource_len(pdev, 0),
-			pci_resource_start(pdev, 0));
+		printk(KERN_ERR "%s: cannot remap MMIO region %llx @ %llx\n",
+			DRV_NAME, (unsigned long long)pci_resource_len(pdev, 0),
+			(unsigned long long)pci_resource_start(pdev, 0));
 		rc = -EIO;
 		goto err_free_mmio_regions_2;
 	}
-	printk(KERN_DEBUG "Siemens DSCC4, MMIO at %#lx (regs), %#lx (lbi), IRQ %d\n",
-	        pci_resource_start(pdev, 0),
-	        pci_resource_start(pdev, 1), pdev->irq);
+	printk(KERN_DEBUG "Siemens DSCC4, MMIO at %#llx (regs), %#llx (lbi), IRQ %d\n",
+	        (unsigned long long)pci_resource_start(pdev, 0),
+	        (unsigned long long)pci_resource_start(pdev, 1), pdev->irq);
 
 	/* Cf errata DS5 p.2 */
 	pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0xf8);
diff -puN drivers/net/wan/pc300_drv.c~64bit-resources-drivers-net-changes drivers/net/wan/pc300_drv.c
--- linux-2.6.16-mm1/drivers/net/wan/pc300_drv.c~64bit-resources-drivers-net-changes	2006-03-23 11:39:08.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/net/wan/pc300_drv.c	2006-03-23 11:39:08.000000000 -0500
@@ -3445,9 +3445,9 @@ cpc_init_one(struct pci_dev *pdev, const
 
 	card = (pc300_t *) kmalloc(sizeof(pc300_t), GFP_KERNEL);
 	if (card == NULL) {
-		printk("PC300 found at RAM 0x%08lx, "
+		printk("PC300 found at RAM 0x%016llx, "
 		       "but could not allocate card structure.\n",
-		       pci_resource_start(pdev, 3));
+		       (unsigned long long)pci_resource_start(pdev, 3));
 		err = -ENOMEM;
 		goto err_disable_dev;
 	}
_

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [RFC][PATCH 6/10] 64 bit resources drivers pcmcia changes
  2006-03-23 20:04         ` [RFC][PATCH 5/10] 64 bit resources drivers net changes Vivek Goyal
@ 2006-03-23 20:06           ` Vivek Goyal
  2006-03-23 20:07             ` [RFC][PATCH 7/10] 64 bit resources drivers others changes Vivek Goyal
  0 siblings, 1 reply; 26+ messages in thread
From: Vivek Goyal @ 2006-03-23 20:06 UTC (permalink / raw)
  To: linux kernel mailing list, Fastboot mailing list
  Cc: Linus Torvalds, Morton Andrew Morton, Eric W. Biederman, galak,
	gregkh, bcrl, Dave Jiang, arjan, Maneesh Soni, Murali



o Changes required in drivers/pcmcia/* to support 64 bit resources.

Signed-off-by: Maneesh Soni <maneesh@in.ibm.com>
Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
---

 drivers/pcmcia/i82365.c         |    5 +++--
 drivers/pcmcia/pd6729.c         |    3 ++-
 drivers/pcmcia/rsrc_nonstatic.c |   25 +++++++++++++------------
 drivers/pcmcia/tcic.c           |    5 +++--
 4 files changed, 21 insertions(+), 17 deletions(-)

diff -puN drivers/pcmcia/i82365.c~64bit-resources-drivers-pcmcia-changes drivers/pcmcia/i82365.c
--- linux-2.6.16-mm1/drivers/pcmcia/i82365.c~64bit-resources-drivers-pcmcia-changes	2006-03-23 11:39:11.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/pcmcia/i82365.c	2006-03-23 11:39:11.000000000 -0500
@@ -1083,9 +1083,10 @@ static int i365_set_mem_map(u_short sock
     u_short base, i;
     u_char map;
     
-    debug(1, "SetMemMap(%d, %d, %#2.2x, %d ns, %#lx-%#lx, "
+    debug(1, "SetMemMap(%d, %d, %#2.2x, %d ns, %#llx-%#llx, "
 	  "%#x)\n", sock, mem->map, mem->flags, mem->speed,
-	  mem->res->start, mem->res->end, mem->card_start);
+	  (unsigned long long)mem->res->start,
+	  (unsigned long long)mem->res->end, mem->card_start);
 
     map = mem->map;
     if ((map > 4) || (mem->card_start > 0x3ffffff) ||
diff -puN drivers/pcmcia/pd6729.c~64bit-resources-drivers-pcmcia-changes drivers/pcmcia/pd6729.c
--- linux-2.6.16-mm1/drivers/pcmcia/pd6729.c~64bit-resources-drivers-pcmcia-changes	2006-03-23 11:39:11.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/pcmcia/pd6729.c	2006-03-23 11:39:11.000000000 -0500
@@ -642,7 +642,8 @@ static int __devinit pd6729_pci_probe(st
 		goto err_out_free_mem;
 
 	printk(KERN_INFO "pd6729: Cirrus PD6729 PCI to PCMCIA Bridge "
-		"at 0x%lx on irq %d\n",	pci_resource_start(dev, 0), dev->irq);
+		"at 0x%llx on irq %d\n",
+		(unsigned long long)pci_resource_start(dev, 0), dev->irq);
  	/*
 	 * Since we have no memory BARs some firmware may not
 	 * have had PCI_COMMAND_MEMORY enabled, yet the device needs it.
diff -puN drivers/pcmcia/rsrc_nonstatic.c~64bit-resources-drivers-pcmcia-changes drivers/pcmcia/rsrc_nonstatic.c
--- linux-2.6.16-mm1/drivers/pcmcia/rsrc_nonstatic.c~64bit-resources-drivers-pcmcia-changes	2006-03-23 11:39:11.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/pcmcia/rsrc_nonstatic.c	2006-03-23 11:39:11.000000000 -0500
@@ -72,7 +72,7 @@ static DEFINE_MUTEX(rsrc_mutex);
 ======================================================================*/
 
 static struct resource *
-make_resource(unsigned long b, unsigned long n, int flags, char *name)
+make_resource(u64 b, u64 n, int flags, char *name)
 {
 	struct resource *res = kzalloc(sizeof(*res), GFP_KERNEL);
 
@@ -86,8 +86,7 @@ make_resource(unsigned long b, unsigned 
 }
 
 static struct resource *
-claim_region(struct pcmcia_socket *s, unsigned long base, unsigned long size,
-	     int type, char *name)
+claim_region(struct pcmcia_socket *s, u64 base, u64 size, int type, char *name)
 {
 	struct resource *res, *parent;
 
@@ -518,11 +517,10 @@ struct pcmcia_align_data {
 };
 
 static void
-pcmcia_common_align(void *align_data, struct resource *res,
-		    unsigned long size, unsigned long align)
+pcmcia_common_align(void *align_data, struct resource *res, u64 size, u64 align)
 {
 	struct pcmcia_align_data *data = align_data;
-	unsigned long start;
+	u64 start;
 	/*
 	 * Ensure that we have the correct start address
 	 */
@@ -533,8 +531,7 @@ pcmcia_common_align(void *align_data, st
 }
 
 static void
-pcmcia_align(void *align_data, struct resource *res,
-	     unsigned long size, unsigned long align)
+pcmcia_align(void *align_data, struct resource *res, u64 size, u64 align)
 {
 	struct pcmcia_align_data *data = align_data;
 	struct resource_map *m;
@@ -808,8 +805,10 @@ static int nonstatic_autoadd_resources(s
 		if (res->flags & IORESOURCE_IO) {
 			if (res == &ioport_resource)
 				continue;
-			printk(KERN_INFO "pcmcia: parent PCI bridge I/O window: 0x%lx - 0x%lx\n",
-			       res->start, res->end);
+			printk(KERN_INFO "pcmcia: parent PCI bridge I/O "
+				"window: 0x%llx - 0x%llx\n",
+				(unsigned long long)res->start,
+				(unsigned long long)res->end);
 			if (!adjust_io(s, ADD_MANAGED_RESOURCE, res->start, res->end))
 				done |= IORESOURCE_IO;
 
@@ -818,8 +817,10 @@ static int nonstatic_autoadd_resources(s
 		if (res->flags & IORESOURCE_MEM) {
 			if (res == &iomem_resource)
 				continue;
-			printk(KERN_INFO "pcmcia: parent PCI bridge Memory window: 0x%lx - 0x%lx\n",
-			       res->start, res->end);
+			printk(KERN_INFO "pcmcia: parent PCI bridge Memory "
+				"window: 0x%llx - 0x%llx\n",
+				(unsigned long long)res->start,
+				(unsigned long long)res->end);
 			if (!adjust_memory(s, ADD_MANAGED_RESOURCE, res->start, res->end))
 				done |= IORESOURCE_MEM;
 		}
diff -puN drivers/pcmcia/tcic.c~64bit-resources-drivers-pcmcia-changes drivers/pcmcia/tcic.c
--- linux-2.6.16-mm1/drivers/pcmcia/tcic.c~64bit-resources-drivers-pcmcia-changes	2006-03-23 11:39:11.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/pcmcia/tcic.c	2006-03-23 11:39:11.000000000 -0500
@@ -756,8 +756,9 @@ static int tcic_set_mem_map(struct pcmci
     u_long base, len, mmap;
 
     debug(1, "SetMemMap(%d, %d, %#2.2x, %d ns, "
-	  "%#lx-%#lx, %#x)\n", psock, mem->map, mem->flags,
-	  mem->speed, mem->res->start, mem->res->end, mem->card_start);
+	  "%#llx-%#llx, %#x)\n", psock, mem->map, mem->flags,
+	  mem->speed, (unsigned long long)mem->res->start,
+	  (unsigned long long)mem->res->end, mem->card_start);
     if ((mem->map > 3) || (mem->card_start > 0x3ffffff) ||
 	(mem->res->start > 0xffffff) || (mem->res->end > 0xffffff) ||
 	(mem->res->start > mem->res->end) || (mem->speed > 1000))
_

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [RFC][PATCH 7/10] 64 bit resources drivers others changes
  2006-03-23 20:06           ` [RFC][PATCH 6/10] 64 bit resources drivers pcmcia changes Vivek Goyal
@ 2006-03-23 20:07             ` Vivek Goyal
  2006-03-23 20:09               ` [RFC][PATCH 8/10] 64 bit resources sound changes Vivek Goyal
  0 siblings, 1 reply; 26+ messages in thread
From: Vivek Goyal @ 2006-03-23 20:07 UTC (permalink / raw)
  To: linux kernel mailing list, Fastboot mailing list
  Cc: Linus Torvalds, Morton Andrew Morton, Eric W. Biederman, galak,
	gregkh, bcrl, Dave Jiang, arjan, Maneesh Soni, Murali



o various drivers/* changes required to support 64 bit resources. This
  excludes the changes to drivers/ide/*, drivers/media/*, drivers/net/*, 
  drivers/pci/* drivers/pcmcia/*, which have been covered in separate patches

Signed-off-by: Dave Jiang <dave.jiang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Maneesh Soni <maneesh@in.ibm.com>
Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
---

 drivers/amba/bus.c                       |    5 +++--
 drivers/atm/ambassador.c                 |    3 ++-
 drivers/atm/firestream.c                 |    5 +++--
 drivers/block/sx8.c                      |    5 +++--
 drivers/char/applicom.c                  |    9 ++++++---
 drivers/ieee1394/ohci1394.c              |   17 +++++++++--------
 drivers/infiniband/hw/mthca/mthca_main.c |    5 +++--
 drivers/input/serio/ct82c710.c           |    6 +++---
 drivers/isdn/hisax/hfc_pci.c             |    2 +-
 drivers/isdn/hisax/telespci.c            |    5 +++--
 drivers/message/i2o/iop.c                |   14 ++++++++------
 drivers/mmc/mmci.c                       |    4 ++--
 drivers/mtd/devices/pmc551.c             |    8 ++++----
 drivers/mtd/maps/amd76xrom.c             |    5 +++--
 drivers/mtd/maps/ichxrom.c               |    5 +++--
 drivers/mtd/maps/scx200_docflash.c       |    5 +++--
 drivers/mtd/maps/sun_uflash.c            |   10 ++++++----
 drivers/pnp/manager.c                    |   14 +++++++++-----
 drivers/pnp/resource.c                   |    8 ++++----
 drivers/scsi/sata_via.c                  |    8 ++++----
 drivers/serial/8250_pci.c                |    4 ++--
 drivers/usb/host/sl811-hcd.c             |   10 +++++++---
 drivers/video/console/vgacon.c           |   12 ++++++------
 include/linux/pnp.h                      |    4 ++--
 24 files changed, 99 insertions(+), 74 deletions(-)

diff -puN drivers/amba/bus.c~64bit-resources-drivers-others-changes drivers/amba/bus.c
--- linux-2.6.16-mm1/drivers/amba/bus.c~64bit-resources-drivers-others-changes	2006-03-23 11:39:14.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/amba/bus.c	2006-03-23 11:39:14.000000000 -0500
@@ -180,8 +180,9 @@ static DEVICE_ATTR(name, S_IRUGO, show_#
 amba_attr(id, "%08x\n", dev->periphid);
 amba_attr(irq0, "%u\n", dev->irq[0]);
 amba_attr(irq1, "%u\n", dev->irq[1]);
-amba_attr(resource, "\t%08lx\t%08lx\t%08lx\n",
-	  dev->res.start, dev->res.end, dev->res.flags);
+amba_attr(resource, "\t%016llx\t%016llx\t%016llx\n",
+	 (unsigned long long)dev->res.start, (unsigned long long)dev->res.end,
+	 dev->res.flags);
 
 /**
  *	amba_device_register - register an AMBA device
diff -puN drivers/atm/ambassador.c~64bit-resources-drivers-others-changes drivers/atm/ambassador.c
--- linux-2.6.16-mm1/drivers/atm/ambassador.c~64bit-resources-drivers-others-changes	2006-03-23 11:39:14.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/atm/ambassador.c	2006-03-23 11:39:14.000000000 -0500
@@ -2257,7 +2257,8 @@ static int __devinit amb_probe(struct pc
 	}
 
 	PRINTD (DBG_INFO, "found Madge ATM adapter (amb) at"
-		" IO %lx, IRQ %u, MEM %p", pci_resource_start(pci_dev, 1),
+		" IO %llx, IRQ %u, MEM %p",
+		(unsigned long long)pci_resource_start(pci_dev, 1),
 		irq, bus_to_virt(pci_resource_start(pci_dev, 0)));
 
 	// check IO region
diff -puN drivers/atm/firestream.c~64bit-resources-drivers-others-changes drivers/atm/firestream.c
--- linux-2.6.16-mm1/drivers/atm/firestream.c~64bit-resources-drivers-others-changes	2006-03-23 11:39:14.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/atm/firestream.c	2006-03-23 11:39:14.000000000 -0500
@@ -1657,9 +1657,10 @@ static int __devinit fs_init (struct fs_
 	func_enter ();
 	pci_dev = dev->pci_dev;
 
-	printk (KERN_INFO "found a FireStream %d card, base %08lx, irq%d.\n", 
+	printk (KERN_INFO "found a FireStream %d card, base %16llx, irq%d.\n",
 		IS_FS50(dev)?50:155,
-		pci_resource_start(pci_dev, 0), dev->pci_dev->irq);
+		(unsigned long long)pci_resource_start(pci_dev, 0),
+		dev->pci_dev->irq);
 
 	if (fs_debug & FS_DEBUG_INIT)
 		my_hd ((unsigned char *) dev, sizeof (*dev));
diff -puN drivers/block/sx8.c~64bit-resources-drivers-others-changes drivers/block/sx8.c
--- linux-2.6.16-mm1/drivers/block/sx8.c~64bit-resources-drivers-others-changes	2006-03-23 11:39:14.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/block/sx8.c	2006-03-23 11:39:14.000000000 -0500
@@ -1694,9 +1694,10 @@ static int carm_init_one (struct pci_dev
 	DPRINTK("waiting for probe_comp\n");
 	wait_for_completion(&host->probe_comp);
 
-	printk(KERN_INFO "%s: pci %s, ports %d, io %lx, irq %u, major %d\n",
+	printk(KERN_INFO "%s: pci %s, ports %d, io %llx, irq %u, major %d\n",
 	       host->name, pci_name(pdev), (int) CARM_MAX_PORTS,
-	       pci_resource_start(pdev, 0), pdev->irq, host->major);
+	       (unsigned long long)pci_resource_start(pdev, 0),
+		   pdev->irq, host->major);
 
 	carm_host_id++;
 	pci_set_drvdata(pdev, host);
diff -puN drivers/char/applicom.c~64bit-resources-drivers-others-changes drivers/char/applicom.c
--- linux-2.6.16-mm1/drivers/char/applicom.c~64bit-resources-drivers-others-changes	2006-03-23 11:39:14.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/char/applicom.c	2006-03-23 11:39:14.000000000 -0500
@@ -215,13 +215,16 @@ int __init applicom_init(void)
 		RamIO = ioremap(dev->resource[0].start, LEN_RAM_IO);
 
 		if (!RamIO) {
-			printk(KERN_INFO "ac.o: Failed to ioremap PCI memory space at 0x%lx\n", dev->resource[0].start);
+			printk(KERN_INFO "ac.o: Failed to ioremap PCI memory "
+				"space at 0x%llx\n",
+				(unsigned long long)dev->resource[0].start);
 			pci_disable_device(dev);
 			return -EIO;
 		}
 
-		printk(KERN_INFO "Applicom %s found at mem 0x%lx, irq %d\n",
-		       applicom_pci_devnames[dev->device-1], dev->resource[0].start, 
+		printk(KERN_INFO "Applicom %s found at mem 0x%llx, irq %d\n",
+		       applicom_pci_devnames[dev->device-1],
+			   (unsigned long long)dev->resource[0].start,
 		       dev->irq);
 
 		boardno = ac_register_board(dev->resource[0].start, RamIO,0);
diff -puN drivers/ieee1394/ohci1394.c~64bit-resources-drivers-others-changes drivers/ieee1394/ohci1394.c
--- linux-2.6.16-mm1/drivers/ieee1394/ohci1394.c~64bit-resources-drivers-others-changes	2006-03-23 11:39:14.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/ieee1394/ohci1394.c	2006-03-23 11:39:14.000000000 -0500
@@ -592,11 +592,11 @@ static void ohci_initialize(struct ti_oh
 	sprintf (irq_buf, "%s", __irq_itoa(ohci->dev->irq));
 #endif
 	PRINT(KERN_INFO, "OHCI-1394 %d.%d (PCI): IRQ=[%s]  "
-	      "MMIO=[%lx-%lx]  Max Packet=[%d]  IR/IT contexts=[%d/%d]",
+	      "MMIO=[%llx-%llx]  Max Packet=[%d]  IR/IT contexts=[%d/%d]",
 	      ((((buf) >> 16) & 0xf) + (((buf) >> 20) & 0xf) * 10),
 	      ((((buf) >> 4) & 0xf) + ((buf) & 0xf) * 10), irq_buf,
-	      pci_resource_start(ohci->dev, 0),
-	      pci_resource_start(ohci->dev, 0) + OHCI1394_REGISTER_SIZE - 1,
+	      (unsigned long long)pci_resource_start(ohci->dev, 0),
+	      (unsigned long long)pci_resource_start(ohci->dev, 0) + OHCI1394_REGISTER_SIZE - 1,
 	      ohci->max_packet_size,
 	      ohci->nb_iso_rcv_ctx, ohci->nb_iso_xmit_ctx);
 
@@ -3210,7 +3210,7 @@ static int __devinit ohci1394_pci_probe(
 {
 	struct hpsb_host *host;
 	struct ti_ohci *ohci;	/* shortcut to currently handled device */
-	unsigned long ohci_base;
+	u64 ohci_base;
 
         if (pci_enable_device(dev))
 		FAIL(-ENXIO, "Failed to enable OHCI hardware");
@@ -3263,15 +3263,16 @@ static int __devinit ohci1394_pci_probe(
 	 * clearly says it's 2kb, so this shouldn't be a problem. */
 	ohci_base = pci_resource_start(dev, 0);
 	if (pci_resource_len(dev, 0) < OHCI1394_REGISTER_SIZE)
-		PRINT(KERN_WARNING, "PCI resource length of 0x%lx too small!",
-		      pci_resource_len(dev, 0));
+		PRINT(KERN_WARNING, "PCI resource length of 0x%llx too small!",
+		      (unsigned long long)pci_resource_len(dev, 0));
 
 	/* Seems PCMCIA handles this internally. Not sure why. Seems
 	 * pretty bogus to force a driver to special case this.  */
 #ifndef PCMCIA
 	if (!request_mem_region (ohci_base, OHCI1394_REGISTER_SIZE, OHCI1394_DRIVER_NAME))
-		FAIL(-ENOMEM, "MMIO resource (0x%lx - 0x%lx) unavailable",
-		     ohci_base, ohci_base + OHCI1394_REGISTER_SIZE);
+		FAIL(-ENOMEM, "MMIO resource (0x%llx - 0x%llx) unavailable",
+			(unsigned long long)ohci_base,
+			(unsigned long long)ohci_base + OHCI1394_REGISTER_SIZE);
 #endif
 	ohci->init_state = OHCI_INIT_HAVE_MEM_REGION;
 
diff -puN drivers/infiniband/hw/mthca/mthca_main.c~64bit-resources-drivers-others-changes drivers/infiniband/hw/mthca/mthca_main.c
--- linux-2.6.16-mm1/drivers/infiniband/hw/mthca/mthca_main.c~64bit-resources-drivers-others-changes	2006-03-23 11:39:14.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/infiniband/hw/mthca/mthca_main.c	2006-03-23 11:39:14.000000000 -0500
@@ -157,8 +157,9 @@ static int __devinit mthca_dev_lim(struc
 
 	if (dev_lim->uar_size > pci_resource_len(mdev->pdev, 2)) {
 		mthca_err(mdev, "HCA reported UAR size of 0x%x bigger than "
-			  "PCI resource 2 size of 0x%lx, aborting.\n",
-			  dev_lim->uar_size, pci_resource_len(mdev->pdev, 2));
+			  "PCI resource 2 size of 0x%llx, aborting.\n",
+			  dev_lim->uar_size,
+			  (unsigned long long)pci_resource_len(mdev->pdev, 2));
 		return -ENODEV;
 	}
 
diff -puN drivers/input/serio/ct82c710.c~64bit-resources-drivers-others-changes drivers/input/serio/ct82c710.c
--- linux-2.6.16-mm1/drivers/input/serio/ct82c710.c~64bit-resources-drivers-others-changes	2006-03-23 11:39:14.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/input/serio/ct82c710.c	2006-03-23 11:39:14.000000000 -0500
@@ -189,7 +189,7 @@ static int __devinit ct82c710_probe(stru
 	strlcpy(ct82c710_port->name, "C&T 82c710 mouse port",
 		sizeof(ct82c710_port->name));
 	snprintf(ct82c710_port->phys, sizeof(ct82c710_port->phys),
-		 "isa%04lx/serio0", CT82C710_DATA);
+		 "isa%16llx/serio0", (unsigned long long)CT82C710_DATA);
 
 	serio_register_port(ct82c710_port);
 
@@ -241,8 +241,8 @@ static int __init ct82c710_init(void)
 
 	serio_register_port(ct82c710_port);
 
-	printk(KERN_INFO "serio: C&T 82c710 mouse port at %#lx irq %d\n",
-		CT82C710_DATA, CT82C710_IRQ);
+	printk(KERN_INFO "serio: C&T 82c710 mouse port at %#llx irq %d\n",
+		(unsigned long long)CT82C710_DATA, CT82C710_IRQ);
 
 	return 0;
 
diff -puN drivers/isdn/hisax/hfc_pci.c~64bit-resources-drivers-others-changes drivers/isdn/hisax/hfc_pci.c
--- linux-2.6.16-mm1/drivers/isdn/hisax/hfc_pci.c~64bit-resources-drivers-others-changes	2006-03-23 11:39:14.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/isdn/hisax/hfc_pci.c	2006-03-23 11:39:14.000000000 -0500
@@ -1688,7 +1688,7 @@ setup_hfcpci(struct IsdnCard *card)
 				printk(KERN_WARNING "HFC-PCI: No IRQ for PCI card found\n");
 				return (0);
 			}
-			cs->hw.hfcpci.pci_io = (char *) dev_hfcpci->resource[ 1].start;
+			cs->hw.hfcpci.pci_io = (char *)(unsigned long)dev_hfcpci->resource[1].start;
 			printk(KERN_INFO "HiSax: HFC-PCI card manufacturer: %s card name: %s\n", id_list[i].vendor_name, id_list[i].card_name);
 		} else {
 			printk(KERN_WARNING "HFC-PCI: No PCI card found\n");
diff -puN drivers/isdn/hisax/telespci.c~64bit-resources-drivers-others-changes drivers/isdn/hisax/telespci.c
--- linux-2.6.16-mm1/drivers/isdn/hisax/telespci.c~64bit-resources-drivers-others-changes	2006-03-23 11:39:14.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/isdn/hisax/telespci.c	2006-03-23 11:39:14.000000000 -0500
@@ -311,8 +311,9 @@ setup_telespci(struct IsdnCard *card)
 		}
 		cs->hw.teles0.membase = ioremap(pci_resource_start(dev_tel, 0),
 			PAGE_SIZE);
-		printk(KERN_INFO "Found: Zoran, base-address: 0x%lx, irq: 0x%x\n",
-			pci_resource_start(dev_tel, 0), dev_tel->irq);
+		printk(KERN_INFO "Found: Zoran, base-address: 0x%llx, irq: 0x%x\n",
+			(unsigned long long)pci_resource_start(dev_tel, 0),
+			dev_tel->irq);
 	} else {
 		printk(KERN_WARNING "TelesPCI: No PCI card found\n");
 		return(0);
diff -puN drivers/message/i2o/iop.c~64bit-resources-drivers-others-changes drivers/message/i2o/iop.c
--- linux-2.6.16-mm1/drivers/message/i2o/iop.c~64bit-resources-drivers-others-changes	2006-03-23 11:39:14.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/message/i2o/iop.c	2006-03-23 11:39:14.000000000 -0500
@@ -683,9 +683,10 @@ static int i2o_iop_systab_set(struct i2o
 			c->mem_alloc = 1;
 			sb->current_mem_size = 1 + res->end - res->start;
 			sb->current_mem_base = res->start;
-			osm_info("%s: allocated %ld bytes of PCI memory at "
-				 "0x%08lX.\n", c->name,
-				 1 + res->end - res->start, res->start);
+			osm_info("%s: allocated %llu bytes of PCI memory at "
+				"0x%016llX.\n", c->name,
+				(unsigned long long)(1 + res->end - res->start),
+				(unsigned long long)res->start);
 		}
 	}
 
@@ -704,9 +705,10 @@ static int i2o_iop_systab_set(struct i2o
 			c->io_alloc = 1;
 			sb->current_io_size = 1 + res->end - res->start;
 			sb->current_mem_base = res->start;
-			osm_info("%s: allocated %ld bytes of PCI I/O at 0x%08lX"
-				 ".\n", c->name, 1 + res->end - res->start,
-				 res->start);
+			osm_info("%s: allocated %llu bytes of PCI I/O at "
+				"0x%016llX.\n", c->name,
+				(unsigned long long)(1 + res->end - res->start),
+				(unsigned long long)res->start);
 		}
 	}
 
diff -puN drivers/mmc/mmci.c~64bit-resources-drivers-others-changes drivers/mmc/mmci.c
--- linux-2.6.16-mm1/drivers/mmc/mmci.c~64bit-resources-drivers-others-changes	2006-03-23 11:39:14.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/mmc/mmci.c	2006-03-23 11:39:14.000000000 -0500
@@ -553,9 +553,9 @@ static int mmci_probe(struct amba_device
 
 	mmc_add_host(mmc);
 
-	printk(KERN_INFO "%s: MMCI rev %x cfg %02x at 0x%08lx irq %d,%d\n",
+	printk(KERN_INFO "%s: MMCI rev %x cfg %02x at 0x%016llx irq %d,%d\n",
 		mmc_hostname(mmc), amba_rev(dev), amba_config(dev),
-		dev->res.start, dev->irq[0], dev->irq[1]);
+		(unsigned long long)dev->res.start, dev->irq[0], dev->irq[1]);
 
 	init_timer(&host->timer);
 	host->timer.data = (unsigned long)host;
diff -puN drivers/mtd/devices/pmc551.c~64bit-resources-drivers-others-changes drivers/mtd/devices/pmc551.c
--- linux-2.6.16-mm1/drivers/mtd/devices/pmc551.c~64bit-resources-drivers-others-changes	2006-03-23 11:39:14.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/mtd/devices/pmc551.c	2006-03-23 11:39:14.000000000 -0500
@@ -551,11 +551,11 @@ static u32 fixup_pmc551 (struct pci_dev 
         /*
          * Some screen fun
          */
-        printk(KERN_DEBUG "pmc551: %d%c (0x%x) of %sprefetchable memory at 0x%lx\n",
+        printk(KERN_DEBUG "pmc551: %d%c (0x%x) of %sprefetchable memory at 0x%llx\n",
 	       (size<1024)?size:(size<1048576)?size>>10:size>>20,
                (size<1024)?'B':(size<1048576)?'K':'M',
 	       size, ((dcmd&(0x1<<3)) == 0)?"non-":"",
-               (dev->resource[0].start)&PCI_BASE_ADDRESS_MEM_MASK );
+               (unsigned long long)((dev->resource[0].start)&PCI_BASE_ADDRESS_MEM_MASK));
 
         /*
          * Check to see the state of the memory
@@ -685,8 +685,8 @@ static int __init init_pmc551(void)
                         break;
                 }
 
-                printk(KERN_NOTICE "pmc551: Found PCI V370PDC at 0x%lX\n",
-				    PCI_Device->resource[0].start);
+                printk(KERN_NOTICE "pmc551: Found PCI V370PDC at 0x%llx\n",
+				    (unsigned long long)PCI_Device->resource[0].start);
 
                 /*
                  * The PMC551 device acts VERY weird if you don't init it
diff -puN drivers/mtd/maps/amd76xrom.c~64bit-resources-drivers-others-changes drivers/mtd/maps/amd76xrom.c
--- linux-2.6.16-mm1/drivers/mtd/maps/amd76xrom.c~64bit-resources-drivers-others-changes	2006-03-23 11:39:14.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/mtd/maps/amd76xrom.c	2006-03-23 11:39:14.000000000 -0500
@@ -123,9 +123,10 @@ static int __devinit amd76xrom_init_one 
 		window->rsrc.parent = NULL;
 		printk(KERN_ERR MOD_NAME
 			" %s(): Unable to register resource"
-			" 0x%.08lx-0x%.08lx - kernel bug?\n",
+			" 0x%.16llx-0x%.16llx - kernel bug?\n",
 			__func__,
-			window->rsrc.start, window->rsrc.end);
+			(unsigned long long)window->rsrc.start,
+			(unsigned long long)window->rsrc.end);
 	}
 
 #if 0
diff -puN drivers/mtd/maps/ichxrom.c~64bit-resources-drivers-others-changes drivers/mtd/maps/ichxrom.c
--- linux-2.6.16-mm1/drivers/mtd/maps/ichxrom.c~64bit-resources-drivers-others-changes	2006-03-23 11:39:14.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/mtd/maps/ichxrom.c	2006-03-23 11:39:14.000000000 -0500
@@ -177,9 +177,10 @@ static int __devinit ichxrom_init_one (s
 		window->rsrc.parent = NULL;
 		printk(KERN_DEBUG MOD_NAME
 			": %s(): Unable to register resource"
-			" 0x%.08lx-0x%.08lx - kernel bug?\n",
+			" 0x%.16llx-0x%.16llx - kernel bug?\n",
 			__func__,
-			window->rsrc.start, window->rsrc.end);
+			(unsigned long long)window->rsrc.start,
+			(unsigned long long)window->rsrc.end);
 	}
 
 	/* Map the firmware hub into my address space. */
diff -puN drivers/mtd/maps/scx200_docflash.c~64bit-resources-drivers-others-changes drivers/mtd/maps/scx200_docflash.c
--- linux-2.6.16-mm1/drivers/mtd/maps/scx200_docflash.c~64bit-resources-drivers-others-changes	2006-03-23 11:39:14.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/mtd/maps/scx200_docflash.c	2006-03-23 11:39:14.000000000 -0500
@@ -164,8 +164,9 @@ static int __init init_scx200_docflash(v
 		outl(pmr, scx200_cb_base + SCx200_PMR);
 	}
 
-       	printk(KERN_INFO NAME ": DOCCS mapped at 0x%lx-0x%lx, width %d\n",
-	       docmem.start, docmem.end, width);
+       	printk(KERN_INFO NAME ": DOCCS mapped at 0x%llx-0x%llx, width %d\n",
+			(unsigned long long)docmem.start,
+			(unsigned long long)docmem.end, width);
 
 	scx200_docflash_map.size = size;
 	if (width == 8)
diff -puN drivers/mtd/maps/sun_uflash.c~64bit-resources-drivers-others-changes drivers/mtd/maps/sun_uflash.c
--- linux-2.6.16-mm1/drivers/mtd/maps/sun_uflash.c~64bit-resources-drivers-others-changes	2006-03-23 11:39:14.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/mtd/maps/sun_uflash.c	2006-03-23 11:39:14.000000000 -0500
@@ -74,9 +74,10 @@ int uflash_devinit(struct linux_ebus_dev
 		/* Non-CFI userflash device-- once I find one we
 		 * can work on supporting it.
 		 */
-		printk("%s: unsupported device at 0x%lx (%d regs): " \
+		printk("%s: unsupported device at 0x%llx (%d regs): " \
 			"email ebrower@usa.net\n",
-			UFLASH_DEVNAME, edev->resource[0].start, nregs);
+			UFLASH_DEVNAME,
+			(unsigned long long)edev->resource[0].start, nregs);
 		return -ENODEV;
 	}
 
@@ -132,8 +133,9 @@ static int __init uflash_init(void)
 		for_each_ebusdev(edev, ebus) {
 			if (!strcmp(edev->prom_name, UFLASH_OBPNAME)) {
 				if(0 > prom_getproplen(edev->prom_node, "user")) {
-					DEBUG(2, "%s: ignoring device at 0x%lx\n",
-							UFLASH_DEVNAME, edev->resource[0].start);
+					DEBUG(2, "%s: ignoring device at 0x%llx\n",
+						UFLASH_DEVNAME,
+						(unsigned long long)edev->resource[0].start);
 				} else {
 					uflash_devinit(edev);
 				}
diff -puN drivers/pnp/manager.c~64bit-resources-drivers-others-changes drivers/pnp/manager.c
--- linux-2.6.16-mm1/drivers/pnp/manager.c~64bit-resources-drivers-others-changes	2006-03-23 11:39:14.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/pnp/manager.c	2006-03-23 11:39:14.000000000 -0500
@@ -20,7 +20,8 @@ DECLARE_MUTEX(pnp_res_mutex);
 
 static int pnp_assign_port(struct pnp_dev *dev, struct pnp_port *rule, int idx)
 {
-	unsigned long *start, *end, *flags;
+	u64 *start, *end;
+	unsigned long *flags;
 
 	if (!dev || !rule)
 		return -EINVAL;
@@ -63,7 +64,8 @@ static int pnp_assign_port(struct pnp_de
 
 static int pnp_assign_mem(struct pnp_dev *dev, struct pnp_mem *rule, int idx)
 {
-	unsigned long *start, *end, *flags;
+	u64 *start, *end;
+	unsigned long *flags;
 
 	if (!dev || !rule)
 		return -EINVAL;
@@ -116,7 +118,8 @@ static int pnp_assign_mem(struct pnp_dev
 
 static int pnp_assign_irq(struct pnp_dev * dev, struct pnp_irq *rule, int idx)
 {
-	unsigned long *start, *end, *flags;
+	u64 *start, *end;
+	unsigned long *flags;
 	int i;
 
 	/* IRQ priority: this table is good for i386 */
@@ -168,7 +171,8 @@ static int pnp_assign_irq(struct pnp_dev
 
 static int pnp_assign_dma(struct pnp_dev *dev, struct pnp_dma *rule, int idx)
 {
-	unsigned long *start, *end, *flags;
+	u64 *start, *end;
+	unsigned long *flags;
 	int i;
 
 	/* DMA priority: this table is good for i386 */
@@ -582,7 +586,7 @@ int pnp_disable_dev(struct pnp_dev *dev)
  * @size: size of region
  *
  */
-void pnp_resource_change(struct resource *resource, unsigned long start, unsigned long size)
+void pnp_resource_change(struct resource *resource, u64 start, u64 size)
 {
 	if (resource == NULL)
 		return;
diff -puN drivers/pnp/resource.c~64bit-resources-drivers-others-changes drivers/pnp/resource.c
--- linux-2.6.16-mm1/drivers/pnp/resource.c~64bit-resources-drivers-others-changes	2006-03-23 11:39:14.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/pnp/resource.c	2006-03-23 11:39:14.000000000 -0500
@@ -241,7 +241,7 @@ int pnp_check_port(struct pnp_dev * dev,
 {
 	int tmp;
 	struct pnp_dev *tdev;
-	unsigned long *port, *end, *tport, *tend;
+	u64 *port, *end, *tport, *tend;
 	port = &dev->res.port_resource[idx].start;
 	end = &dev->res.port_resource[idx].end;
 
@@ -297,7 +297,7 @@ int pnp_check_mem(struct pnp_dev * dev, 
 {
 	int tmp;
 	struct pnp_dev *tdev;
-	unsigned long *addr, *end, *taddr, *tend;
+	u64 *addr, *end, *taddr, *tend;
 	addr = &dev->res.mem_resource[idx].start;
 	end = &dev->res.mem_resource[idx].end;
 
@@ -358,7 +358,7 @@ int pnp_check_irq(struct pnp_dev * dev, 
 {
 	int tmp;
 	struct pnp_dev *tdev;
-	unsigned long * irq = &dev->res.irq_resource[idx].start;
+	u64 * irq = &dev->res.irq_resource[idx].start;
 
 	/* if the resource doesn't exist, don't complain about it */
 	if (cannot_compare(dev->res.irq_resource[idx].flags))
@@ -423,7 +423,7 @@ int pnp_check_dma(struct pnp_dev * dev, 
 #ifndef CONFIG_IA64
 	int tmp;
 	struct pnp_dev *tdev;
-	unsigned long * dma = &dev->res.dma_resource[idx].start;
+	u64 * dma = &dev->res.dma_resource[idx].start;
 
 	/* if the resource doesn't exist, don't complain about it */
 	if (cannot_compare(dev->res.dma_resource[idx].flags))
diff -puN drivers/scsi/sata_via.c~64bit-resources-drivers-others-changes drivers/scsi/sata_via.c
--- linux-2.6.16-mm1/drivers/scsi/sata_via.c~64bit-resources-drivers-others-changes	2006-03-23 11:39:14.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/scsi/sata_via.c	2006-03-23 11:39:14.000000000 -0500
@@ -334,10 +334,10 @@ static int svia_init_one (struct pci_dev
 		if ((pci_resource_start(pdev, i) == 0) ||
 		    (pci_resource_len(pdev, i) < bar_sizes[i])) {
 			dev_printk(KERN_ERR, &pdev->dev,
-				   "invalid PCI BAR %u (sz 0x%lx, val 0x%lx)\n",
-				   i,
-			           pci_resource_start(pdev, i),
-			           pci_resource_len(pdev, i));
+				"invalid PCI BAR %u (sz 0x%llx, val 0x%llx)\n",
+				i,
+			        (unsigned long long)pci_resource_start(pdev, i),
+			        (unsigned long long)pci_resource_len(pdev, i));
 			rc = -ENODEV;
 			goto err_out_regions;
 		}
diff -puN drivers/serial/8250_pci.c~64bit-resources-drivers-others-changes drivers/serial/8250_pci.c
--- linux-2.6.16-mm1/drivers/serial/8250_pci.c~64bit-resources-drivers-others-changes	2006-03-23 11:39:14.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/serial/8250_pci.c	2006-03-23 11:39:14.000000000 -0500
@@ -594,8 +594,8 @@ pci_default_setup(struct serial_private 
 	else
 		offset += idx * board->uart_offset;
 
-	maxnr = (pci_resource_len(priv->dev, bar) - board->first_offset) /
-		(8 << board->reg_shift);
+	maxnr = (pci_resource_len(priv->dev, bar) - board->first_offset) >>
+		(board->reg_shift + 3);
 
 	if (board->flags & FL_REGION_SZ_CAP && idx >= maxnr)
 		return 1;
diff -puN drivers/usb/host/sl811-hcd.c~64bit-resources-drivers-others-changes drivers/usb/host/sl811-hcd.c
--- linux-2.6.16-mm1/drivers/usb/host/sl811-hcd.c~64bit-resources-drivers-others-changes	2006-03-23 11:39:14.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/usb/host/sl811-hcd.c	2006-03-23 11:39:14.000000000 -0500
@@ -1684,9 +1684,13 @@ sl811h_probe(struct platform_device *dev
 		if (!addr || !data)
 			return -ENODEV;
 		ioaddr = 1;
-
-		addr_reg = (void __iomem *) addr->start;
-		data_reg = (void __iomem *) data->start;
+		/*
+		 * NOTE: 64-bit resource->start is getting truncated
+		 * to avoid compiler warning, assuming that ->start
+		 * is always 32-bit for this case
+		 */
+		addr_reg = (void __iomem *) (unsigned long) addr->start;
+		data_reg = (void __iomem *) (unsigned long) data->start;
 	} else {
 		addr_reg = ioremap(addr->start, 1);
 		if (addr_reg == NULL) {
diff -puN drivers/video/console/vgacon.c~64bit-resources-drivers-others-changes drivers/video/console/vgacon.c
--- linux-2.6.16-mm1/drivers/video/console/vgacon.c~64bit-resources-drivers-others-changes	2006-03-23 11:39:14.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/video/console/vgacon.c	2006-03-23 11:39:14.000000000 -0500
@@ -389,7 +389,7 @@ static const char __init *vgacon_startup
 		vga_video_port_val = VGA_CRT_DM;
 		if ((ORIG_VIDEO_EGA_BX & 0xff) != 0x10) {
 			static struct resource ega_console_resource =
-			    { "ega", 0x3B0, 0x3BF };
+			    { .name = "ega", .start = 0x3B0, .end = 0x3BF };
 			vga_video_type = VIDEO_TYPE_EGAM;
 			vga_vram_end = 0xb8000;
 			display_desc = "EGA+";
@@ -397,9 +397,9 @@ static const char __init *vgacon_startup
 					 &ega_console_resource);
 		} else {
 			static struct resource mda1_console_resource =
-			    { "mda", 0x3B0, 0x3BB };
+			    { .name = "mda", .start = 0x3B0, .end = 0x3BB };
 			static struct resource mda2_console_resource =
-			    { "mda", 0x3BF, 0x3BF };
+			    { .name = "mda", .start = 0x3BF, .end = 0x3BF };
 			vga_video_type = VIDEO_TYPE_MDA;
 			vga_vram_end = 0xb2000;
 			display_desc = "*MDA";
@@ -422,14 +422,14 @@ static const char __init *vgacon_startup
 
 			if (!ORIG_VIDEO_ISVGA) {
 				static struct resource ega_console_resource
-				    = { "ega", 0x3C0, 0x3DF };
+				    = { .name = "ega", .start = 0x3C0, .end = 0x3DF };
 				vga_video_type = VIDEO_TYPE_EGAC;
 				display_desc = "EGA";
 				request_resource(&ioport_resource,
 						 &ega_console_resource);
 			} else {
 				static struct resource vga_console_resource
-				    = { "vga+", 0x3C0, 0x3DF };
+				    = { .name = "vga+", .start = 0x3C0, .end = 0x3DF };
 				vga_video_type = VIDEO_TYPE_VGAC;
 				display_desc = "VGA+";
 				request_resource(&ioport_resource,
@@ -473,7 +473,7 @@ static const char __init *vgacon_startup
 			}
 		} else {
 			static struct resource cga_console_resource =
-			    { "cga", 0x3D4, 0x3D5 };
+			    { .name = "cga", .start = 0x3D4, .end = 0x3D5 };
 			vga_video_type = VIDEO_TYPE_CGA;
 			vga_vram_end = 0xba000;
 			display_desc = "*CGA";
diff -puN include/linux/pnp.h~64bit-resources-drivers-others-changes include/linux/pnp.h
--- linux-2.6.16-mm1/include/linux/pnp.h~64bit-resources-drivers-others-changes	2006-03-23 11:39:14.000000000 -0500
+++ linux-2.6.16-mm1-root/include/linux/pnp.h	2006-03-23 11:39:14.000000000 -0500
@@ -389,7 +389,7 @@ int pnp_start_dev(struct pnp_dev *dev);
 int pnp_stop_dev(struct pnp_dev *dev);
 int pnp_activate_dev(struct pnp_dev *dev);
 int pnp_disable_dev(struct pnp_dev *dev);
-void pnp_resource_change(struct resource *resource, unsigned long start, unsigned long size);
+void pnp_resource_change(struct resource *resource, u64 start, u64 size);
 
 /* protocol helpers */
 int pnp_is_active(struct pnp_dev * dev);
@@ -434,7 +434,7 @@ static inline int pnp_start_dev(struct p
 static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; }
 static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; }
 static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; }
-static inline void pnp_resource_change(struct resource *resource, unsigned long start, unsigned long size) { }
+static inline void pnp_resource_change(struct resource *resource, u64 start, u64 size) { }
 
 /* protocol helpers */
 static inline int pnp_is_active(struct pnp_dev * dev) { return 0; }
_

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [RFC][PATCH 8/10] 64 bit resources sound changes
  2006-03-23 20:07             ` [RFC][PATCH 7/10] 64 bit resources drivers others changes Vivek Goyal
@ 2006-03-23 20:09               ` Vivek Goyal
  2006-03-23 20:10                 ` [RFC][PATCH 9/10] 64 bit resources arch changes Vivek Goyal
  0 siblings, 1 reply; 26+ messages in thread
From: Vivek Goyal @ 2006-03-23 20:09 UTC (permalink / raw)
  To: linux kernel mailing list, Fastboot mailing list
  Cc: Linus Torvalds, Morton Andrew Morton, Eric W. Biederman, galak,
	gregkh, bcrl, Dave Jiang, arjan, Maneesh Soni, Murali



o Changes required in sound/* to support 64bit resources.

Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
---

 sound/arm/aaci.c              |    5 +++--
 sound/drivers/mpu401/mpu401.c |    5 +++--
 sound/isa/es18xx.c            |    3 ++-
 sound/isa/gus/interwave.c     |    8 ++++----
 sound/isa/sb/sb16.c           |    3 ++-
 sound/oss/forte.c             |    5 +++--
 sound/pci/bt87x.c             |    5 +++--
 sound/pci/sonicvibes.c        |    4 ++--
 sound/sparc/cs4231.c          |    4 ++--
 sound/sparc/dbri.c            |    5 +++--
 10 files changed, 27 insertions(+), 20 deletions(-)

diff -puN sound/arm/aaci.c~64bit-resources-sound-changes sound/arm/aaci.c
--- linux-2.6.16-mm1/sound/arm/aaci.c~64bit-resources-sound-changes	2006-03-23 11:39:17.000000000 -0500
+++ linux-2.6.16-mm1-root/sound/arm/aaci.c	2006-03-23 11:39:18.000000000 -0500
@@ -779,8 +779,9 @@ static struct aaci * __devinit aaci_init
 	strlcpy(card->driver, DRIVER_NAME, sizeof(card->driver));
 	strlcpy(card->shortname, "ARM AC'97 Interface", sizeof(card->shortname));
 	snprintf(card->longname, sizeof(card->longname),
-		 "%s at 0x%08lx, irq %d",
-		 card->shortname, dev->res.start, dev->irq[0]);
+		 "%s at 0x%016llx, irq %d",
+		 card->shortname, (unsigned long long)dev->res.start,
+		 dev->irq[0]);
 
 	aaci = card->private_data;
 	mutex_init(&aaci->ac97_sem);
diff -puN sound/drivers/mpu401/mpu401.c~64bit-resources-sound-changes sound/drivers/mpu401/mpu401.c
--- linux-2.6.16-mm1/sound/drivers/mpu401/mpu401.c~64bit-resources-sound-changes	2006-03-23 11:39:17.000000000 -0500
+++ linux-2.6.16-mm1-root/sound/drivers/mpu401/mpu401.c	2006-03-23 11:39:18.000000000 -0500
@@ -160,8 +160,9 @@ static int __init snd_mpu401_pnp(int dev
 		return -ENODEV;
 	}
 	if (pnp_port_len(device, 0) < IO_EXTENT) {
-		snd_printk(KERN_ERR "PnP port length is %ld, expected %d\n",
-			   pnp_port_len(device, 0), IO_EXTENT);
+		snd_printk(KERN_ERR "PnP port length is %llu, expected %d\n",
+			   (unsigned long long)pnp_port_len(device, 0),
+			   IO_EXTENT);
 		return -ENODEV;
 	}
 	port[dev] = pnp_port_start(device, 0);
diff -puN sound/isa/es18xx.c~64bit-resources-sound-changes sound/isa/es18xx.c
--- linux-2.6.16-mm1/sound/isa/es18xx.c~64bit-resources-sound-changes	2006-03-23 11:39:17.000000000 -0500
+++ linux-2.6.16-mm1-root/sound/isa/es18xx.c	2006-03-23 11:39:18.000000000 -0500
@@ -2086,7 +2086,8 @@ static int __devinit snd_audiodrive_pnp(
 		kfree(cfg);
 		return -EAGAIN;
 	}
-	snd_printdd("pnp: port=0x%lx\n", pnp_port_start(acard->devc, 0));
+	snd_printdd("pnp: port=0x%llx\n",
+			(unsigned long long)pnp_port_start(acard->devc, 0));
 	/* PnP initialization */
 	pdev = acard->dev;
 	pnp_init_resource_table(cfg);
diff -puN sound/isa/gus/interwave.c~64bit-resources-sound-changes sound/isa/gus/interwave.c
--- linux-2.6.16-mm1/sound/isa/gus/interwave.c~64bit-resources-sound-changes	2006-03-23 11:39:17.000000000 -0500
+++ linux-2.6.16-mm1-root/sound/isa/gus/interwave.c	2006-03-23 11:39:18.000000000 -0500
@@ -611,10 +611,10 @@ static int __devinit snd_interwave_pnp(i
 	if (dma2[dev] >= 0)
 		dma2[dev] = pnp_dma(pdev, 1);
 	irq[dev] = pnp_irq(pdev, 0);
-	snd_printdd("isapnp IW: sb port=0x%lx, gf1 port=0x%lx, codec port=0x%lx\n",
-				pnp_port_start(pdev, 0),
-				pnp_port_start(pdev, 1),
-				pnp_port_start(pdev, 2));
+	snd_printdd("isapnp IW: sb port=0x%llx, gf1 port=0x%llx, codec port=0x%llx\n",
+			(unsigned long long)pnp_port_start(pdev, 0),
+			(unsigned long long)pnp_port_start(pdev, 1),
+			(unsigned long long)pnp_port_start(pdev, 2));
 	snd_printdd("isapnp IW: dma1=%i, dma2=%i, irq=%i\n", dma1[dev], dma2[dev], irq[dev]);
 #ifdef SNDRV_STB
 	/* Tone Control initialization */
diff -puN sound/isa/sb/sb16.c~64bit-resources-sound-changes sound/isa/sb/sb16.c
--- linux-2.6.16-mm1/sound/isa/sb/sb16.c~64bit-resources-sound-changes	2006-03-23 11:39:17.000000000 -0500
+++ linux-2.6.16-mm1-root/sound/isa/sb/sb16.c	2006-03-23 11:39:18.000000000 -0500
@@ -327,7 +327,8 @@ static int __devinit snd_card_sb16_pnp(i
 			goto __wt_error; 
 		} 
 		awe_port[dev] = pnp_port_start(pdev, 0);
-		snd_printdd("pnp SB16: wavetable port=0x%lx\n", pnp_port_start(pdev, 0));
+		snd_printdd("pnp SB16: wavetable port=0x%llx\n",
+				(unsigned long long)pnp_port_start(pdev, 0));
 	} else {
 __wt_error:
 		if (pdev) {
diff -puN sound/oss/forte.c~64bit-resources-sound-changes sound/oss/forte.c
--- linux-2.6.16-mm1/sound/oss/forte.c~64bit-resources-sound-changes	2006-03-23 11:39:17.000000000 -0500
+++ linux-2.6.16-mm1-root/sound/oss/forte.c	2006-03-23 11:39:18.000000000 -0500
@@ -2035,8 +2035,9 @@ forte_probe (struct pci_dev *pci_dev, co
 	
 	pci_set_drvdata (pci_dev, chip);
 
-	printk (KERN_INFO PFX "FM801 chip found at 0x%04lX-0x%04lX IRQ %u\n", 
-		chip->iobase, pci_resource_end (pci_dev, 0), chip->irq);
+	printk (KERN_INFO PFX "FM801 chip found at 0x%04lX-0x%16llX IRQ %u\n",
+		chip->iobase, (unsigned long long)pci_resource_end (pci_dev, 0),
+		chip->irq);
 
 	/* Power it up */
 	if ((ret = forte_chip_init (chip)) == 0)
diff -puN sound/pci/bt87x.c~64bit-resources-sound-changes sound/pci/bt87x.c
--- linux-2.6.16-mm1/sound/pci/bt87x.c~64bit-resources-sound-changes	2006-03-23 11:39:17.000000000 -0500
+++ linux-2.6.16-mm1-root/sound/pci/bt87x.c	2006-03-23 11:39:18.000000000 -0500
@@ -886,8 +886,9 @@ static int __devinit snd_bt87x_probe(str
 
 	strcpy(card->driver, "Bt87x");
 	sprintf(card->shortname, "Brooktree Bt%x", pci->device);
-	sprintf(card->longname, "%s at %#lx, irq %i",
-		card->shortname, pci_resource_start(pci, 0), chip->irq);
+	sprintf(card->longname, "%s at %#llx, irq %i",
+		card->shortname, (unsigned long long)pci_resource_start(pci, 0),
+		chip->irq);
 	strcpy(card->mixername, "Bt87x");
 
 	err = snd_card_register(card);
diff -puN sound/pci/sonicvibes.c~64bit-resources-sound-changes sound/pci/sonicvibes.c
--- linux-2.6.16-mm1/sound/pci/sonicvibes.c~64bit-resources-sound-changes	2006-03-23 11:39:18.000000000 -0500
+++ linux-2.6.16-mm1-root/sound/pci/sonicvibes.c	2006-03-23 11:39:18.000000000 -0500
@@ -1441,10 +1441,10 @@ static int __devinit snd_sonic_probe(str
 
 	strcpy(card->driver, "SonicVibes");
 	strcpy(card->shortname, "S3 SonicVibes");
-	sprintf(card->longname, "%s rev %i at 0x%lx, irq %i",
+	sprintf(card->longname, "%s rev %i at 0x%llx, irq %i",
 		card->shortname,
 		sonic->revision,
-		pci_resource_start(pci, 1),
+		(unsigned long long)pci_resource_start(pci, 1),
 		sonic->irq);
 
 	if ((err = snd_sonicvibes_pcm(sonic, 0, NULL)) < 0) {
diff -puN sound/sparc/cs4231.c~64bit-resources-sound-changes sound/sparc/cs4231.c
--- linux-2.6.16-mm1/sound/sparc/cs4231.c~64bit-resources-sound-changes	2006-03-23 11:39:18.000000000 -0500
+++ linux-2.6.16-mm1-root/sound/sparc/cs4231.c	2006-03-23 11:39:18.000000000 -0500
@@ -2040,10 +2040,10 @@ static int __init cs4231_sbus_attach(str
 	if (err)
 		return err;
 
-	sprintf(card->longname, "%s at 0x%02lx:0x%08lx, irq %s",
+	sprintf(card->longname, "%s at 0x%02lx:0x%016llx, irq %s",
 		card->shortname,
 		rp->flags & 0xffL,
-		rp->start,
+		(unsigned long long)rp->start,
 		__irq_itoa(sdev->irqs[0]));
 
 	if ((err = snd_cs4231_sbus_create(card, sdev, dev, &cp)) < 0) {
diff -puN sound/sparc/dbri.c~64bit-resources-sound-changes sound/sparc/dbri.c
--- linux-2.6.16-mm1/sound/sparc/dbri.c~64bit-resources-sound-changes	2006-03-23 11:39:18.000000000 -0500
+++ linux-2.6.16-mm1-root/sound/sparc/dbri.c	2006-03-23 11:39:18.000000000 -0500
@@ -2645,9 +2645,10 @@ static int __init dbri_attach(int prom_n
 	strcpy(card->driver, "DBRI");
 	strcpy(card->shortname, "Sun DBRI");
 	rp = &sdev->resource[0];
-	sprintf(card->longname, "%s at 0x%02lx:0x%08lx, irq %s",
+	sprintf(card->longname, "%s at 0x%02lx:0x%016llx, irq %s",
 		card->shortname,
-		rp->flags & 0xffL, rp->start, __irq_itoa(irq.pri));
+		rp->flags & 0xffL, (unsigned long long)rp->start,
+		__irq_itoa(irq.pri));
 
 	if ((err = snd_dbri_create(card, sdev, &irq, dev)) < 0) {
 		snd_card_free(card);
_

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [RFC][PATCH 9/10] 64 bit resources arch changes
  2006-03-23 20:09               ` [RFC][PATCH 8/10] 64 bit resources sound changes Vivek Goyal
@ 2006-03-23 20:10                 ` Vivek Goyal
  2006-03-23 20:11                   ` [RFC][PATCH 10/10] i386: export memory more than 4G through /proc/iomem Vivek Goyal
  0 siblings, 1 reply; 26+ messages in thread
From: Vivek Goyal @ 2006-03-23 20:10 UTC (permalink / raw)
  To: linux kernel mailing list, Fastboot mailing list
  Cc: Linus Torvalds, Morton Andrew Morton, Eric W. Biederman, galak,
	gregkh, bcrl, Dave Jiang, arjan, Maneesh Soni, Murali



o Changes required for various arch/, for 64 bit resources.

Signed-off-by: Dave Jiang <dave.jiang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
---

 arch/arm/kernel/bios32.c   |    6 ++---
 arch/arm/kernel/setup.c    |   42 +++++++++++++++++++++++++++++++++++------
 arch/i386/kernel/efi.c     |    6 +++--
 arch/i386/pci/i386.c       |    4 +--
 arch/ppc/kernel/pci.c      |   46 ++++++++++++++++++++++++++-------------------
 arch/sparc/kernel/ioport.c |    8 ++++---
 include/asm-arm/mach/pci.h |    2 -
 7 files changed, 78 insertions(+), 36 deletions(-)

diff -puN arch/arm/kernel/bios32.c~64bit-resources-arch-changes arch/arm/kernel/bios32.c
--- linux-2.6.16-mm1/arch/arm/kernel/bios32.c~64bit-resources-arch-changes	2006-03-23 11:39:21.000000000 -0500
+++ linux-2.6.16-mm1-root/arch/arm/kernel/bios32.c	2006-03-23 11:39:21.000000000 -0500
@@ -304,7 +304,7 @@ static inline int pdev_bad_for_parity(st
 static void __devinit
 pdev_fixup_device_resources(struct pci_sys_data *root, struct pci_dev *dev)
 {
-	unsigned long offset;
+	u64 offset;
 	int i;
 
 	for (i = 0; i < PCI_NUM_RESOURCES; i++) {
@@ -634,9 +634,9 @@ char * __init pcibios_setup(char *str)
  * which might be mirrored at 0x0100-0x03ff..
  */
 void pcibios_align_resource(void *data, struct resource *res,
-			    unsigned long size, unsigned long align)
+			    u64 size, u64 align)
 {
-	unsigned long start = res->start;
+	u64 start = res->start;
 
 	if (res->flags & IORESOURCE_IO && start & 0x300)
 		start = (start + 0x3ff) & ~0x3ff;
diff -puN arch/arm/kernel/setup.c~64bit-resources-arch-changes arch/arm/kernel/setup.c
--- linux-2.6.16-mm1/arch/arm/kernel/setup.c~64bit-resources-arch-changes	2006-03-23 11:39:21.000000000 -0500
+++ linux-2.6.16-mm1-root/arch/arm/kernel/setup.c	2006-03-23 11:39:21.000000000 -0500
@@ -119,9 +119,24 @@ DEFINE_PER_CPU(struct cpuinfo_arm, cpu_d
  * Standard memory resources
  */
 static struct resource mem_res[] = {
-	{ "Video RAM",   0,     0,     IORESOURCE_MEM			},
-	{ "Kernel text", 0,     0,     IORESOURCE_MEM			},
-	{ "Kernel data", 0,     0,     IORESOURCE_MEM			}
+	{
+		.name = "Video RAM",
+		.start = 0,
+		.end = 0,
+		.flags = IORESOURCE_MEM
+	},
+	{
+		.name = "Kernel text",
+		.start = 0,
+		.end = 0,
+		.flags = IORESOURCE_MEM
+	},
+	{
+		.name = "Kernel data",
+		.start = 0,
+		.end = 0,
+		.flags = IORESOURCE_MEM
+	}
 };
 
 #define video_ram   mem_res[0]
@@ -129,9 +144,24 @@ static struct resource mem_res[] = {
 #define kernel_data mem_res[2]
 
 static struct resource io_res[] = {
-	{ "reserved",    0x3bc, 0x3be, IORESOURCE_IO | IORESOURCE_BUSY },
-	{ "reserved",    0x378, 0x37f, IORESOURCE_IO | IORESOURCE_BUSY },
-	{ "reserved",    0x278, 0x27f, IORESOURCE_IO | IORESOURCE_BUSY }
+	{
+		.name = "reserved",
+		.start = 0x3bc,
+		.end = 0x3be,
+		.flags = IORESOURCE_IO | IORESOURCE_BUSY
+	},
+	{
+		.name = "reserved",
+		.start = 0x378,
+		.end = 0x37f,
+		.flags = IORESOURCE_IO | IORESOURCE_BUSY
+	},
+	{
+		.name = "reserved",
+		.start = 0x278,
+		.end = 0x27f,
+		.flags = IORESOURCE_IO | IORESOURCE_BUSY
+	}
 };
 
 #define lp0 io_res[0]
diff -puN arch/i386/kernel/efi.c~64bit-resources-arch-changes arch/i386/kernel/efi.c
--- linux-2.6.16-mm1/arch/i386/kernel/efi.c~64bit-resources-arch-changes	2006-03-23 11:39:21.000000000 -0500
+++ linux-2.6.16-mm1-root/arch/i386/kernel/efi.c	2006-03-23 11:39:21.000000000 -0500
@@ -601,8 +601,10 @@ efi_initialize_iomem_resources(struct re
 		res->end = res->start + ((md->num_pages << EFI_PAGE_SHIFT) - 1);
 		res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
 		if (request_resource(&iomem_resource, res) < 0)
-			printk(KERN_ERR PFX "Failed to allocate res %s : 0x%lx-0x%lx\n",
-				res->name, res->start, res->end);
+			printk(KERN_ERR PFX "Failed to allocate res %s : "
+				"0x%llx-0x%llx\n", res->name,
+				(unsigned long long)res->start,
+				(unsigned long long)res->end);
 		/*
 		 * We don't know which region contains kernel data so we try
 		 * it repeatedly and let the resource manager test it.
diff -puN arch/i386/pci/i386.c~64bit-resources-arch-changes arch/i386/pci/i386.c
--- linux-2.6.16-mm1/arch/i386/pci/i386.c~64bit-resources-arch-changes	2006-03-23 11:39:21.000000000 -0500
+++ linux-2.6.16-mm1-root/arch/i386/pci/i386.c	2006-03-23 11:39:21.000000000 -0500
@@ -48,10 +48,10 @@
  */
 void
 pcibios_align_resource(void *data, struct resource *res,
-		       unsigned long size, unsigned long align)
+		       u64 size, u64 align)
 {
 	if (res->flags & IORESOURCE_IO) {
-		unsigned long start = res->start;
+		u64 start = res->start;
 
 		if (start & 0x300) {
 			start = (start + 0x3ff) & ~0x3ff;
diff -puN arch/ppc/kernel/pci.c~64bit-resources-arch-changes arch/ppc/kernel/pci.c
--- linux-2.6.16-mm1/arch/ppc/kernel/pci.c~64bit-resources-arch-changes	2006-03-23 11:39:21.000000000 -0500
+++ linux-2.6.16-mm1-root/arch/ppc/kernel/pci.c	2006-03-23 11:39:21.000000000 -0500
@@ -98,8 +98,10 @@ pcibios_fixup_resources(struct pci_dev *
 		if (!res->flags)
 			continue;
 		if (res->end == 0xffffffff) {
-			DBG("PCI:%s Resource %d [%08lx-%08lx] is unassigned\n",
-			    pci_name(dev), i, res->start, res->end);
+			DBG("PCI:%s Resource %d [%016llx-%016llx] is unassigned\n",
+				pci_name(dev), i,
+				(unsigned long long)res->start,
+				(unsigned long long)res->end);
 			res->end -= res->start;
 			res->start = 0;
 			res->flags |= IORESOURCE_UNSET;
@@ -172,18 +174,18 @@ EXPORT_SYMBOL(pcibios_bus_to_resource);
  * but we want to try to avoid allocating at 0x2900-0x2bff
  * which might have be mirrored at 0x0100-0x03ff..
  */
-void pcibios_align_resource(void *data, struct resource *res, unsigned long size,
-		       unsigned long align)
+void pcibios_align_resource(void *data, struct resource *res, u64 size,
+		       u64 align)
 {
 	struct pci_dev *dev = data;
 
 	if (res->flags & IORESOURCE_IO) {
-		unsigned long start = res->start;
+		u64 start = res->start;
 
 		if (size > 0x100) {
 			printk(KERN_ERR "PCI: I/O Region %s/%d too large"
-			       " (%ld bytes)\n", pci_name(dev),
-			       dev->resource - res, size);
+			       " (%lld bytes)\n", pci_name(dev),
+			       dev->resource - res, (unsigned long long)size);
 		}
 
 		if (start & 0x300) {
@@ -254,8 +256,9 @@ pcibios_allocate_bus_resources(struct li
 				}
 			}
 
-			DBG("PCI: bridge rsrc %lx..%lx (%lx), parent %p\n",
-			    res->start, res->end, res->flags, pr);
+			DBG("PCI: bridge rsrc %llx..%llx (%lx), parent %p\n",
+				(unsigned long long)res->start,
+				(unsigned long long)res->end, res->flags, pr);
 			if (pr) {
 				if (request_resource(pr, res) == 0)
 					continue;
@@ -305,8 +308,9 @@ reparent_resources(struct resource *pare
 	*pp = NULL;
 	for (p = res->child; p != NULL; p = p->sibling) {
 		p->parent = res;
-		DBG(KERN_INFO "PCI: reparented %s [%lx..%lx] under %s\n",
-		    p->name, p->start, p->end, res->name);
+		DBG(KERN_INFO "PCI: reparented %s [%llx..%llx] under %s\n",
+			p->name, (unsigned long long)p->start,
+			(unsigned long long)p->end, res->name);
 	}
 	return 0;
 }
@@ -361,13 +365,15 @@ pci_relocate_bridge_resource(struct pci_
 		try = conflict->start - 1;
 	}
 	if (request_resource(pr, res)) {
-		DBG(KERN_ERR "PCI: huh? couldn't move to %lx..%lx\n",
-		    res->start, res->end);
+		DBG(KERN_ERR "PCI: huh? couldn't move to %llx..%llx\n",
+			(unsigned long long)res->start,
+			(unsigned long long)res->end);
 		return -1;		/* "can't happen" */
 	}
 	update_bridge_base(bus, i);
-	printk(KERN_INFO "PCI: bridge %d resource %d moved to %lx..%lx\n",
-	       bus->number, i, res->start, res->end);
+	printk(KERN_INFO "PCI: bridge %d resource %d moved to %llx..%llx\n",
+		bus->number, i, (unsigned long long)res->start,
+		(unsigned long long)res->end);
 	return 0;
 }
 
@@ -478,15 +484,17 @@ static inline void alloc_resource(struct
 {
 	struct resource *pr, *r = &dev->resource[idx];
 
-	DBG("PCI:%s: Resource %d: %08lx-%08lx (f=%lx)\n",
-	    pci_name(dev), idx, r->start, r->end, r->flags);
+	DBG("PCI:%s: Resource %d: %016llx-%016llx (f=%lx)\n",
+	    pci_name(dev), idx, (unsigned long long)r->start,
+	    (unsigned long long)r->end, r->flags);
 	pr = pci_find_parent_resource(dev, r);
 	if (!pr || request_resource(pr, r) < 0) {
 		printk(KERN_ERR "PCI: Cannot allocate resource region %d"
 		       " of device %s\n", idx, pci_name(dev));
 		if (pr)
-			DBG("PCI:  parent is %p: %08lx-%08lx (f=%lx)\n",
-			    pr, pr->start, pr->end, pr->flags);
+			DBG("PCI:  parent is %p: %016llx-%016llx (f=%lx)\n",
+				pr, (unsigned long long)pr->start,
+				(unsigned long long)pr->end, pr->flags);
 		/* We'll assign a new address later */
 		r->flags |= IORESOURCE_UNSET;
 		r->end -= r->start;
diff -puN arch/sparc/kernel/ioport.c~64bit-resources-arch-changes arch/sparc/kernel/ioport.c
--- linux-2.6.16-mm1/arch/sparc/kernel/ioport.c~64bit-resources-arch-changes	2006-03-23 11:39:21.000000000 -0500
+++ linux-2.6.16-mm1-root/arch/sparc/kernel/ioport.c	2006-03-23 11:39:21.000000000 -0500
@@ -206,7 +206,7 @@ _sparc_ioremap(struct resource *res, u32
 	pa &= PAGE_MASK;
 	sparc_mapiorange(bus, pa, res->start, res->end - res->start + 1);
 
-	return (void __iomem *) (res->start + offset);
+	return (void __iomem *)(unsigned long)(res->start + offset);
 }
 
 /*
@@ -274,7 +274,7 @@ void *sbus_alloc_consistent(struct sbus_
 	if (mmu_map_dma_area(dma_addrp, va, res->start, len_total) != 0)
 		goto err_noiommu;
 
-	return (void *)res->start;
+	return (void *)(unsigned long)res->start;
 
 err_noiommu:
 	release_resource(res);
@@ -685,7 +685,9 @@ _sparc_io_get_info(char *buf, char **sta
 		if (p + 32 >= e)	/* Better than nothing */
 			break;
 		if ((nm = r->name) == 0) nm = "???";
-		p += sprintf(p, "%08lx-%08lx: %s\n", r->start, r->end, nm);
+		p += sprintf(p, "%016llx-%016llx: %s\n",
+				(unsigned long long)r->start,
+				(unsigned long long)r->end, nm);
 	}
 
 	return p-buf;
diff -puN include/asm-arm/mach/pci.h~64bit-resources-arch-changes include/asm-arm/mach/pci.h
--- linux-2.6.16-mm1/include/asm-arm/mach/pci.h~64bit-resources-arch-changes	2006-03-23 11:39:21.000000000 -0500
+++ linux-2.6.16-mm1-root/include/asm-arm/mach/pci.h	2006-03-23 11:39:21.000000000 -0500
@@ -28,7 +28,7 @@ struct hw_pci {
 struct pci_sys_data {
 	struct list_head node;
 	int		busnr;		/* primary bus number			*/
-	unsigned long	mem_offset;	/* bus->cpu memory mapping offset	*/
+	u64		mem_offset;	/* bus->cpu memory mapping offset	*/
 	unsigned long	io_offset;	/* bus->cpu IO mapping offset		*/
 	struct pci_bus	*bus;		/* PCI bus				*/
 	struct resource *resource[3];	/* Primary PCI bus resources		*/
_

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [RFC][PATCH 10/10] i386: export memory more than 4G through /proc/iomem
  2006-03-23 20:10                 ` [RFC][PATCH 9/10] 64 bit resources arch changes Vivek Goyal
@ 2006-03-23 20:11                   ` Vivek Goyal
  0 siblings, 0 replies; 26+ messages in thread
From: Vivek Goyal @ 2006-03-23 20:11 UTC (permalink / raw)
  To: linux kernel mailing list, Fastboot mailing list
  Cc: Linus Torvalds, Morton Andrew Morton, Eric W. Biederman, galak,
	gregkh, bcrl, Dave Jiang, arjan, Maneesh Soni, Murali



o Currently /proc/iomem exports physical memory also apart from io device
  memory. But on i386, it truncates any memory more than 4GB. This leads
  to problems for kexec/kdump.

o Kexec reads /proc/iomem to determine the system memory layout and prepares
  a memory map based on that and passes it to the kernel being kexeced. Given
  the fact that memory more than 4GB has been truncated, new kernel never
  gets to see and use that memory.

o Kdump also reads /proc/iomem to determine the physical memory layout of
  the system and encodes this informaiton in ELF headers. After a crash
  new kernel parses these ELF headers being used by previous kernel and
  vmcore is prepared accordingly. As memory more than 4GB has been truncated,
  kdump never sees that memory and never prepares ELF headers for it. Hence
  vmcore is truncated and limited to 4GB even if there is more physical
  memory in the system.

o This patch exports memory more than 4GB through /proc/iomem on i386.

Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
---

 arch/i386/kernel/setup.c |    2 --
 1 files changed, 2 deletions(-)

diff -puN arch/i386/kernel/setup.c~i386-export-mem-more-than-4G-through-proc-iomem arch/i386/kernel/setup.c
--- linux-2.6.16-mm1/arch/i386/kernel/setup.c~i386-export-mem-more-than-4G-through-proc-iomem	2006-03-23 11:39:24.000000000 -0500
+++ linux-2.6.16-mm1-root/arch/i386/kernel/setup.c	2006-03-23 11:39:24.000000000 -0500
@@ -1295,8 +1295,6 @@ legacy_init_iomem_resources(struct resou
 	probe_roms();
 	for (i = 0; i < e820.nr_map; i++) {
 		struct resource *res;
-		if (e820.map[i].addr + e820.map[i].size > 0x100000000ULL)
-			continue;
 		res = kzalloc(sizeof(struct resource), GFP_ATOMIC);
 		switch (e820.map[i].type) {
 		case E820_RAM:	res->name = "System RAM"; break;
_

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [RFC][PATCH 1/10] 64 bit resources core changes
  2006-03-23 19:59 ` [RFC][PATCH 1/10] 64 bit resources core changes Vivek Goyal
  2006-03-23 20:01   ` [RFC][PATCH 2/10] 64 bit resources drivers pci changes Vivek Goyal
@ 2006-03-23 20:22   ` Arjan van de Ven
  2006-03-23 20:41     ` Vivek Goyal
  2006-03-23 20:52     ` Linus Torvalds
  2006-04-14 21:07   ` Matthieu CASTET
  2 siblings, 2 replies; 26+ messages in thread
From: Arjan van de Ven @ 2006-03-23 20:22 UTC (permalink / raw)
  To: vgoyal
  Cc: linux kernel mailing list, Fastboot mailing list, Linus Torvalds,
	Morton Andrew Morton, Eric W. Biederman, galak, gregkh, bcrl,
	Dave Jiang, Maneesh Soni, Murali

On Thu, 2006-03-23 at 14:59 -0500, Vivek Goyal wrote:


> +			width, (unsigned long long) r->start,
> +			width, (unsigned long long) r->end,


hmmmm are there any platforms where unsigned long long is > 64 bits?
(and yes it would be nice if there was a u64 printf flag ;)




^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [RFC][PATCH 1/10] 64 bit resources core changes
  2006-03-23 20:22   ` [RFC][PATCH 1/10] 64 bit resources core changes Arjan van de Ven
@ 2006-03-23 20:41     ` Vivek Goyal
  2006-03-23 20:52     ` Linus Torvalds
  1 sibling, 0 replies; 26+ messages in thread
From: Vivek Goyal @ 2006-03-23 20:41 UTC (permalink / raw)
  To: Arjan van de Ven
  Cc: linux kernel mailing list, Fastboot mailing list, Linus Torvalds,
	Morton Andrew Morton, Eric W. Biederman, galak, gregkh, bcrl,
	Dave Jiang, Maneesh Soni, Murali

On Thu, Mar 23, 2006 at 09:22:15PM +0100, Arjan van de Ven wrote:
> On Thu, 2006-03-23 at 14:59 -0500, Vivek Goyal wrote:
> 
> 
> > +			width, (unsigned long long) r->start,
> > +			width, (unsigned long long) r->end,
> 
> 
> hmmmm are there any platforms where unsigned long long is > 64 bits?

At least I am not aware of. Got to typecast it because ppc64 defines
u64 as unsigned long and compiler starts spitting warnings.

-Vivek

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [RFC][PATCH 1/10] 64 bit resources core changes
  2006-03-23 20:22   ` [RFC][PATCH 1/10] 64 bit resources core changes Arjan van de Ven
  2006-03-23 20:41     ` Vivek Goyal
@ 2006-03-23 20:52     ` Linus Torvalds
  2006-03-23 20:56       ` Arjan van de Ven
  2006-03-23 21:01       ` Al Viro
  1 sibling, 2 replies; 26+ messages in thread
From: Linus Torvalds @ 2006-03-23 20:52 UTC (permalink / raw)
  To: Arjan van de Ven
  Cc: vgoyal, linux kernel mailing list, Fastboot mailing list,
	Morton Andrew Morton, Eric W. Biederman, galak, gregkh, bcrl,
	Dave Jiang, Maneesh Soni, Murali



On Thu, 23 Mar 2006, Arjan van de Ven wrote:
> 
> hmmmm are there any platforms where unsigned long long is > 64 bits?
> (and yes it would be nice if there was a u64 printf flag ;)

Adding a new printf flag is technically _trivial_.

The problem is getting gcc not to warn about it every time it sees it 
(while not losing the gcc format string checking entirely). Do newer gcc's 
allow some way of saying "this flag takes this type" for extended format 
definitions?

		Linus

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [RFC][PATCH 1/10] 64 bit resources core changes
  2006-03-23 20:52     ` Linus Torvalds
@ 2006-03-23 20:56       ` Arjan van de Ven
  2006-03-23 21:02         ` Al Viro
  2006-03-23 21:01       ` Al Viro
  1 sibling, 1 reply; 26+ messages in thread
From: Arjan van de Ven @ 2006-03-23 20:56 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: vgoyal, linux kernel mailing list, Fastboot mailing list,
	Morton Andrew Morton, Eric W. Biederman, galak, gregkh, bcrl,
	Dave Jiang, Maneesh Soni, Murali

On Thu, 2006-03-23 at 12:52 -0800, Linus Torvalds wrote:
> 
> On Thu, 23 Mar 2006, Arjan van de Ven wrote:
> > 
> > hmmmm are there any platforms where unsigned long long is > 64 bits?
> > (and yes it would be nice if there was a u64 printf flag ;)
> 
> Adding a new printf flag is technically _trivial_.
> 
> The problem is getting gcc not to warn about it every time it sees it 
> (while not losing the gcc format string checking entirely). Do newer gcc's 
> allow some way of saying "this flag takes this type" for extended format 
> definitions?

afaics there is none... even if there was a "just don't warn about this
one" would be nice.. but I don't see that either.



^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [RFC][PATCH 1/10] 64 bit resources core changes
  2006-03-23 20:52     ` Linus Torvalds
  2006-03-23 20:56       ` Arjan van de Ven
@ 2006-03-23 21:01       ` Al Viro
  1 sibling, 0 replies; 26+ messages in thread
From: Al Viro @ 2006-03-23 21:01 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Arjan van de Ven, vgoyal, linux kernel mailing list,
	Fastboot mailing list, Morton Andrew Morton, Eric W. Biederman,
	galak, gregkh, bcrl, Dave Jiang, Maneesh Soni, Murali

On Thu, Mar 23, 2006 at 12:52:42PM -0800, Linus Torvalds wrote:
> 
> 
> On Thu, 23 Mar 2006, Arjan van de Ven wrote:
> > 
> > hmmmm are there any platforms where unsigned long long is > 64 bits?
> > (and yes it would be nice if there was a u64 printf flag ;)
> 
> Adding a new printf flag is technically _trivial_.
> 
> The problem is getting gcc not to warn about it every time it sees it 
> (while not losing the gcc format string checking entirely). Do newer gcc's 
> allow some way of saying "this flag takes this type" for extended format 
> definitions?

Well...  We could implement that in sparse and tell gcc to stop bothering
with that warning.  At which point it becomes trivial to extend...

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [RFC][PATCH 1/10] 64 bit resources core changes
  2006-03-23 20:56       ` Arjan van de Ven
@ 2006-03-23 21:02         ` Al Viro
  2006-03-23 21:07           ` Arjan van de Ven
  0 siblings, 1 reply; 26+ messages in thread
From: Al Viro @ 2006-03-23 21:02 UTC (permalink / raw)
  To: Arjan van de Ven
  Cc: Linus Torvalds, vgoyal, linux kernel mailing list,
	Fastboot mailing list, Morton Andrew Morton, Eric W. Biederman,
	galak, gregkh, bcrl, Dave Jiang, Maneesh Soni, Murali

On Thu, Mar 23, 2006 at 09:56:59PM +0100, Arjan van de Ven wrote:
> On Thu, 2006-03-23 at 12:52 -0800, Linus Torvalds wrote:
> > 
> > On Thu, 23 Mar 2006, Arjan van de Ven wrote:
> > > 
> > > hmmmm are there any platforms where unsigned long long is > 64 bits?
> > > (and yes it would be nice if there was a u64 printf flag ;)
> > 
> > Adding a new printf flag is technically _trivial_.
> > 
> > The problem is getting gcc not to warn about it every time it sees it 
> > (while not losing the gcc format string checking entirely). Do newer gcc's 
> > allow some way of saying "this flag takes this type" for extended format 
> > definitions?
> 
> afaics there is none... even if there was a "just don't warn about this
> one" would be nice.. but I don't see that either.

-Wformat is what enables those, so we can turn them all off.

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [RFC][PATCH 1/10] 64 bit resources core changes
  2006-03-23 21:02         ` Al Viro
@ 2006-03-23 21:07           ` Arjan van de Ven
  2006-03-23 21:21             ` Al Viro
  0 siblings, 1 reply; 26+ messages in thread
From: Arjan van de Ven @ 2006-03-23 21:07 UTC (permalink / raw)
  To: Al Viro
  Cc: Linus Torvalds, vgoyal, linux kernel mailing list,
	Fastboot mailing list, Morton Andrew Morton, Eric W. Biederman,
	galak, gregkh, bcrl, Dave Jiang, Maneesh Soni, Murali

On Thu, 2006-03-23 at 21:02 +0000, Al Viro wrote:
> On Thu, Mar 23, 2006 at 09:56:59PM +0100, Arjan van de Ven wrote:
> > On Thu, 2006-03-23 at 12:52 -0800, Linus Torvalds wrote:
> > > 
> > > On Thu, 23 Mar 2006, Arjan van de Ven wrote:
> > > > 
> > > > hmmmm are there any platforms where unsigned long long is > 64 bits?
> > > > (and yes it would be nice if there was a u64 printf flag ;)
> > > 
> > > Adding a new printf flag is technically _trivial_.
> > > 
> > > The problem is getting gcc not to warn about it every time it sees it 
> > > (while not losing the gcc format string checking entirely). Do newer gcc's 
> > > allow some way of saying "this flag takes this type" for extended format 
> > > definitions?
> > 
> > afaics there is none... even if there was a "just don't warn about this
> > one" would be nice.. but I don't see that either.
> 
> -Wformat is what enables those, so we can turn them all off.

sure it's all or nothing. not "all but the u64 one"


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [RFC][PATCH 1/10] 64 bit resources core changes
  2006-03-23 21:07           ` Arjan van de Ven
@ 2006-03-23 21:21             ` Al Viro
  0 siblings, 0 replies; 26+ messages in thread
From: Al Viro @ 2006-03-23 21:21 UTC (permalink / raw)
  To: Arjan van de Ven
  Cc: Linus Torvalds, vgoyal, linux kernel mailing list,
	Fastboot mailing list, Morton Andrew Morton, Eric W. Biederman,
	galak, gregkh, bcrl, Dave Jiang, Maneesh Soni, Murali

On Thu, Mar 23, 2006 at 10:07:19PM +0100, Arjan van de Ven wrote:

> sure it's all or nothing. not "all but the u64 one"

It's "bugger off and leave them to sparse; it'll do better job" ;-)

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [RFC][PATCH 0/10] 64 bit resources
  2006-03-23 19:57 [RFC][PATCH 0/10] 64 bit resources Vivek Goyal
  2006-03-23 19:59 ` [RFC][PATCH 1/10] 64 bit resources core changes Vivek Goyal
@ 2006-03-24  9:12 ` Andrew Morton
  2006-03-24 18:05   ` Vivek Goyal
  1 sibling, 1 reply; 26+ messages in thread
From: Andrew Morton @ 2006-03-24  9:12 UTC (permalink / raw)
  To: vgoyal
  Cc: linux-kernel, fastboot, torvalds, ebiederm, galak, gregkh, bcrl,
	dave.jiang, arjan, maneesh, muralim

Vivek Goyal <vgoyal@in.ibm.com> wrote:
>
> Hi,
> 
> Here is an attempt to implement support for 64 bit resources. This will
> enable memory more than 4G to be exported through /proc/iomem, which is used
> by kexec/kdump to determine the physical memory layout of the system.
> 
> ...
> 
> We used "make allyesconfig" with CONFIG_DEBUG_INFO=n on 2.6.16-mm1.
> 
> i386
> ----
> 
> vmlinux size without patch: 40191425
> vmlinux size with path: 40244677
> vmlinux size bloat: 52K (.13%)

ugh, that's actually a surprising amount of growth.  Could you look into it
a bit more please?  Where's it coming from?  text?  data?

A bit of growth in drivers is probably OK, as all machines load a tiny
subset of them.  But if it's core kernel, not so good.  What is the effect
on allnoconfig?

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [RFC][PATCH 3/10] 64 bit resources drivers ide changes
  2006-03-23 20:02     ` [RFC][PATCH 3/10] 64 bit resources drivers ide changes Vivek Goyal
  2006-03-23 20:03       ` [RFC][PATCH 4/10] 64 bit resources drivers media changes Vivek Goyal
@ 2006-03-24 12:15       ` Alan Cox
  2006-03-24 14:43         ` Vivek Goyal
  1 sibling, 1 reply; 26+ messages in thread
From: Alan Cox @ 2006-03-24 12:15 UTC (permalink / raw)
  To: vgoyal
  Cc: linux kernel mailing list, Fastboot mailing list, Linus Torvalds,
	Morton Andrew Morton, Eric W. Biederman, galak, gregkh, bcrl,
	Dave Jiang, arjan, Maneesh Soni, Murali

On Iau, 2006-03-23 at 15:02 -0500, Vivek Goyal wrote:
>  		pci_write_config_dword(dev, PCI_ROM_ADDRESS, dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE);
> -		printk(KERN_INFO "%s: ROM enabled at 0x%08lx\n", name, dev->resource[PCI_ROM_RESOURCE].start);
> +		printk(KERN_INFO "%s: ROM enabled at 0x%016llx\n", name,
> +			(unsigned long long)dev->resource[PCI_ROM_RESOURCE].start);

NAK - if the resource is 64bit then the pci_write_config_dword is also
insufficient. Ditto for each other example.

We actually know the PCI resources for these are 32bit so this change
shouldn't be needed. You might want to stick a (u32) or (unsigned long)
cast in and leave it at that.

As far as I can tell all the ROM whacking code is bogus anyway


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [RFC][PATCH 3/10] 64 bit resources drivers ide changes
  2006-03-24 12:15       ` [RFC][PATCH 3/10] 64 bit resources drivers ide changes Alan Cox
@ 2006-03-24 14:43         ` Vivek Goyal
  0 siblings, 0 replies; 26+ messages in thread
From: Vivek Goyal @ 2006-03-24 14:43 UTC (permalink / raw)
  To: Alan Cox
  Cc: linux kernel mailing list, Fastboot mailing list, Linus Torvalds,
	Morton Andrew Morton, Eric W. Biederman, galak, gregkh, bcrl,
	Dave Jiang, arjan, Maneesh Soni, Murali

[-- Attachment #1: Type: text/plain, Size: 833 bytes --]

On Fri, Mar 24, 2006 at 12:15:01PM +0000, Alan Cox wrote:
> On Iau, 2006-03-23 at 15:02 -0500, Vivek Goyal wrote:
> >  		pci_write_config_dword(dev, PCI_ROM_ADDRESS, dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE);
> > -		printk(KERN_INFO "%s: ROM enabled at 0x%08lx\n", name, dev->resource[PCI_ROM_RESOURCE].start);
> > +		printk(KERN_INFO "%s: ROM enabled at 0x%016llx\n", name,
> > +			(unsigned long long)dev->resource[PCI_ROM_RESOURCE].start);
> 
> NAK - if the resource is 64bit then the pci_write_config_dword is also
> insufficient. Ditto for each other example.
> 
> We actually know the PCI resources for these are 32bit so this change
> shouldn't be needed. You might want to stick a (u32) or (unsigned long)
> cast in and leave it at that.
> 

Done. Please find attached the modified patch.

Thanks
Vivek

[-- Attachment #2: 64bit-resources-drivers-ide-changes.patch --]
[-- Type: text/plain, Size: 4317 bytes --]


o Changes required under drivers/ide/* for 64bit resources.

Signed-off-by: Dave Jiang <dave.jiang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
---

 drivers/ide/pci/aec62xx.c      |    3 ++-
 drivers/ide/pci/cmd64x.c       |    3 ++-
 drivers/ide/pci/hpt34x.c       |    2 +-
 drivers/ide/pci/pdc202xx_new.c |    4 ++--
 drivers/ide/pci/pdc202xx_old.c |    4 ++--
 5 files changed, 9 insertions(+), 7 deletions(-)

diff -puN drivers/ide/pci/aec62xx.c~64bit-resources-drivers-ide-changes drivers/ide/pci/aec62xx.c
--- linux-2.6.16-mm1/drivers/ide/pci/aec62xx.c~64bit-resources-drivers-ide-changes	2006-03-24 09:07:36.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/ide/pci/aec62xx.c	2006-03-24 09:09:55.000000000 -0500
@@ -254,7 +254,8 @@ static unsigned int __devinit init_chips
 
 	if (dev->resource[PCI_ROM_RESOURCE].start) {
 		pci_write_config_dword(dev, PCI_ROM_ADDRESS, dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE);
-		printk(KERN_INFO "%s: ROM enabled at 0x%08lx\n", name, dev->resource[PCI_ROM_RESOURCE].start);
+		printk(KERN_INFO "%s: ROM enabled at 0x%08lx\n", name,
+			(unsigned long)dev->resource[PCI_ROM_RESOURCE].start);
 	}
 
 	if (bus_speed <= 33)
diff -puN drivers/ide/pci/cmd64x.c~64bit-resources-drivers-ide-changes drivers/ide/pci/cmd64x.c
--- linux-2.6.16-mm1/drivers/ide/pci/cmd64x.c~64bit-resources-drivers-ide-changes	2006-03-24 09:07:36.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/ide/pci/cmd64x.c	2006-03-24 09:10:42.000000000 -0500
@@ -609,7 +609,8 @@ static unsigned int __devinit init_chips
 #ifdef __i386__
 	if (dev->resource[PCI_ROM_RESOURCE].start) {
 		pci_write_config_dword(dev, PCI_ROM_ADDRESS, dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE);
-		printk(KERN_INFO "%s: ROM enabled at 0x%08lx\n", name, dev->resource[PCI_ROM_RESOURCE].start);
+		printk(KERN_INFO "%s: ROM enabled at 0x%08lx\n", name,
+			(unsigned long)dev->resource[PCI_ROM_RESOURCE].start);
 	}
 #endif
 
diff -puN drivers/ide/pci/hpt34x.c~64bit-resources-drivers-ide-changes drivers/ide/pci/hpt34x.c
--- linux-2.6.16-mm1/drivers/ide/pci/hpt34x.c~64bit-resources-drivers-ide-changes	2006-03-24 09:07:36.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/ide/pci/hpt34x.c	2006-03-24 09:11:17.000000000 -0500
@@ -176,7 +176,7 @@ static unsigned int __devinit init_chips
 			pci_write_config_dword(dev, PCI_ROM_ADDRESS,
 				dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE);
 			printk(KERN_INFO "HPT345: ROM enabled at 0x%08lx\n",
-				dev->resource[PCI_ROM_RESOURCE].start);
+				(unsigned long)dev->resource[PCI_ROM_RESOURCE].start);
 		}
 		pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0xF0);
 	} else {
diff -puN drivers/ide/pci/pdc202xx_new.c~64bit-resources-drivers-ide-changes drivers/ide/pci/pdc202xx_new.c
--- linux-2.6.16-mm1/drivers/ide/pci/pdc202xx_new.c~64bit-resources-drivers-ide-changes	2006-03-24 09:07:36.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/ide/pci/pdc202xx_new.c	2006-03-24 09:11:57.000000000 -0500
@@ -313,8 +313,8 @@ static unsigned int __devinit init_chips
 	if (dev->resource[PCI_ROM_RESOURCE].start) {
 		pci_write_config_dword(dev, PCI_ROM_ADDRESS,
 			dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE);
-		printk(KERN_INFO "%s: ROM enabled at 0x%08lx\n",
-			name, dev->resource[PCI_ROM_RESOURCE].start);
+		printk(KERN_INFO "%s: ROM enabled at 0x%08lx\n", name,
+			(unsigned long)dev->resource[PCI_ROM_RESOURCE].start);
 	}
 
 #ifdef CONFIG_PPC_PMAC
diff -puN drivers/ide/pci/pdc202xx_old.c~64bit-resources-drivers-ide-changes drivers/ide/pci/pdc202xx_old.c
--- linux-2.6.16-mm1/drivers/ide/pci/pdc202xx_old.c~64bit-resources-drivers-ide-changes	2006-03-24 09:07:36.000000000 -0500
+++ linux-2.6.16-mm1-root/drivers/ide/pci/pdc202xx_old.c	2006-03-24 09:12:31.000000000 -0500
@@ -580,8 +580,8 @@ static unsigned int __devinit init_chips
 	if (dev->resource[PCI_ROM_RESOURCE].start) {
 		pci_write_config_dword(dev, PCI_ROM_ADDRESS,
 			dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE);
-		printk(KERN_INFO "%s: ROM enabled at 0x%08lx\n",
-			name, dev->resource[PCI_ROM_RESOURCE].start);
+		printk(KERN_INFO "%s: ROM enabled at 0x%08lx\n", name,
+			(unsigned long)dev->resource[PCI_ROM_RESOURCE].start);
 	}
 
 	/*
_

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [RFC][PATCH 0/10] 64 bit resources
  2006-03-24  9:12 ` [RFC][PATCH 0/10] 64 bit resources Andrew Morton
@ 2006-03-24 18:05   ` Vivek Goyal
  2006-03-28 16:34     ` Kumar Gala
  0 siblings, 1 reply; 26+ messages in thread
From: Vivek Goyal @ 2006-03-24 18:05 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, fastboot, torvalds, ebiederm, galak, gregkh, bcrl,
	dave.jiang, arjan, maneesh, muralim

On Fri, Mar 24, 2006 at 01:12:17AM -0800, Andrew Morton wrote:
> Vivek Goyal <vgoyal@in.ibm.com> wrote:
> >
> > Hi,
> > 
> > Here is an attempt to implement support for 64 bit resources. This will
> > enable memory more than 4G to be exported through /proc/iomem, which is used
> > by kexec/kdump to determine the physical memory layout of the system.
> > 
> > ...
> > 
> > We used "make allyesconfig" with CONFIG_DEBUG_INFO=n on 2.6.16-mm1.
> > 
> > i386
> > ----
> > 
> > vmlinux size without patch: 40191425
> > vmlinux size with path: 40244677
> > vmlinux size bloat: 52K (.13%)
> 
> ugh, that's actually a surprising amount of growth.  Could you look into it
> a bit more please?  Where's it coming from?  text?  data?


Andrew, most of it seems to be coming from .text. I have pasted few results
below.

> 
> A bit of growth in drivers is probably OK, as all machines load a tiny
> subset of them.  But if it's core kernel, not so good.  What is the effect
> on allnoconfig?

Here are more compilation results with allnoconfig, allmodconfig and
allyesconfig on i386. I have picked section sizes from the output of readelf.

allnoconfig 
----------

vmlinux bloat: 0

.text bloat: 1008 bytes
.data bloat: 672 bytes.
.init.text bloat: 128 bytes
.init.data bloat: 0 bytes

(Not sure why vmlinux size difference is zero, given the fact that few
 sections are showing bloated size)


allmodconfig (CONFIG_DEBUG_INFO=n)
------------

vmlinux bloat:4096 bytes
                                                                                
.text bloat: 4064 bytes
.init.text bloat: 470 bytes
.data bloat: 640 bytes


allyesconfig  (CONFIG_DEBUG_INFO=n)
-----------

vmlinux size bloat: 52K
                                                                                
.text bloat: 28.5K
.init_text bloat: 5K
.eh_frame bloat: 16K  (What's that. Looks big)
.rodata bloat: 152 bytes
.data bloat: 768 bytes


Thanks
Vivek

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [RFC][PATCH 0/10] 64 bit resources
  2006-03-24 18:05   ` Vivek Goyal
@ 2006-03-28 16:34     ` Kumar Gala
  2006-03-28 22:24       ` Vivek Goyal
  0 siblings, 1 reply; 26+ messages in thread
From: Kumar Gala @ 2006-03-28 16:34 UTC (permalink / raw)
  To: vgoyal
  Cc: Andrew Morton, linux-kernel, fastboot, torvalds, ebiederm, gregkh,
	bcrl, dave.jiang, arjan, maneesh, muralim


On Mar 24, 2006, at 12:05 PM, Vivek Goyal wrote:

> On Fri, Mar 24, 2006 at 01:12:17AM -0800, Andrew Morton wrote:
>> Vivek Goyal <vgoyal@in.ibm.com> wrote:
>>>
>>> Hi,
>>>
>>> Here is an attempt to implement support for 64 bit resources.  
>>> This will
>>> enable memory more than 4G to be exported through /proc/iomem,  
>>> which is used
>>> by kexec/kdump to determine the physical memory layout of the  
>>> system.
>>>
>>> ...
>>>
>>> We used "make allyesconfig" with CONFIG_DEBUG_INFO=n on 2.6.16-mm1.
>>>
>>> i386
>>> ----
>>>
>>> vmlinux size without patch: 40191425
>>> vmlinux size with path: 40244677
>>> vmlinux size bloat: 52K (.13%)
>>
>> ugh, that's actually a surprising amount of growth.  Could you  
>> look into it
>> a bit more please?  Where's it coming from?  text?  data?
>
>
> Andrew, most of it seems to be coming from .text. I have pasted few  
> results
> below.
>
>>
>> A bit of growth in drivers is probably OK, as all machines load a  
>> tiny
>> subset of them.  But if it's core kernel, not so good.  What is  
>> the effect
>> on allnoconfig?
>
> Here are more compilation results with allnoconfig, allmodconfig and
> allyesconfig on i386. I have picked section sizes from the output  
> of readelf.
>
> allnoconfig
> ----------
>
> vmlinux bloat: 0
>
> .text bloat: 1008 bytes
> .data bloat: 672 bytes.
> .init.text bloat: 128 bytes
> .init.data bloat: 0 bytes
>
> (Not sure why vmlinux size difference is zero, given the fact that few
>  sections are showing bloated size)
>
>
> allmodconfig (CONFIG_DEBUG_INFO=n)
> ------------
>
> vmlinux bloat:4096 bytes
>
> .text bloat: 4064 bytes
> .init.text bloat: 470 bytes
> .data bloat: 640 bytes
>
>
> allyesconfig  (CONFIG_DEBUG_INFO=n)
> -----------
>
> vmlinux size bloat: 52K
>
> .text bloat: 28.5K
> .init_text bloat: 5K
> .eh_frame bloat: 16K  (What's that. Looks big)
> .rodata bloat: 152 bytes
> .data bloat: 768 bytes

So the bloat seems be in the drivers as expected.

Vivek, mind updating these against -mm2 also, can you fixup arch/ 
powerpc/kernel/pci_32.c.

Andrew, any issues in merging into -mm?

- kumar

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [RFC][PATCH 0/10] 64 bit resources
  2006-03-28 16:34     ` Kumar Gala
@ 2006-03-28 22:24       ` Vivek Goyal
  0 siblings, 0 replies; 26+ messages in thread
From: Vivek Goyal @ 2006-03-28 22:24 UTC (permalink / raw)
  To: Kumar Gala
  Cc: Andrew Morton, linux-kernel, fastboot, torvalds, ebiederm, gregkh,
	bcrl, dave.jiang, arjan, maneesh, muralim

On Tue, Mar 28, 2006 at 10:34:39AM -0600, Kumar Gala wrote:
[..]
> 
> >Here are more compilation results with allnoconfig, allmodconfig and
> >allyesconfig on i386. I have picked section sizes from the output  
> >of readelf.
> >
> >allnoconfig
> >----------
> >
> >vmlinux bloat: 0
> >
> >.text bloat: 1008 bytes
> >.data bloat: 672 bytes.
> >.init.text bloat: 128 bytes
> >.init.data bloat: 0 bytes
> >
> >(Not sure why vmlinux size difference is zero, given the fact that few
> > sections are showing bloated size)
> >
> >
> >allmodconfig (CONFIG_DEBUG_INFO=n)
> >------------
> >
> >vmlinux bloat:4096 bytes
> >
> >.text bloat: 4064 bytes
> >.init.text bloat: 470 bytes
> >.data bloat: 640 bytes
> >
> >
> >allyesconfig  (CONFIG_DEBUG_INFO=n)
> >-----------
> >
> >vmlinux size bloat: 52K
> >
> >.text bloat: 28.5K
> >.init_text bloat: 5K
> >.eh_frame bloat: 16K  (What's that. Looks big)
> >.rodata bloat: 152 bytes
> >.data bloat: 768 bytes
> 
> So the bloat seems be in the drivers as expected.
> 
> Vivek, mind updating these against -mm2 also, can you fixup arch/ 
> powerpc/kernel/pci_32.c.
> 
> Andrew, any issues in merging into -mm?

These patches are now in -mm2. I did some cross compilation for powerpc
and fixed more warnings including powerpc/kernel/pci_32.c. Posting patches
in a separate thread.

-vivek


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [RFC][PATCH 1/10] 64 bit resources core changes
  2006-03-23 19:59 ` [RFC][PATCH 1/10] 64 bit resources core changes Vivek Goyal
  2006-03-23 20:01   ` [RFC][PATCH 2/10] 64 bit resources drivers pci changes Vivek Goyal
  2006-03-23 20:22   ` [RFC][PATCH 1/10] 64 bit resources core changes Arjan van de Ven
@ 2006-04-14 21:07   ` Matthieu CASTET
  2 siblings, 0 replies; 26+ messages in thread
From: Matthieu CASTET @ 2006-04-14 21:07 UTC (permalink / raw)
  To: linux-kernel; +Cc: fastboot

Hi,

Le Thu, 23 Mar 2006 14:59:44 -0500, Vivek Goyal a écrit :
 
>  #include <linux/compiler.h>
> +#include <linux/types.h>
>  /*
>   * Resources are tree-like, allowing
>   * nesting etc..
>   */
>  struct resource {
> +	u64 start, end;
>  	const char *name;
> -	unsigned long start, end;
>  	unsigned long flags;
>  	struct resource *parent, *sibling, *child;
>  };

This patch break pnp resource printf in /sys/bus/pnp/*/resources .

Something like this should solve the problem

--- 1/drivers/pnp/interface.c	2006-01-03 04:21:10.000000000 +0100
+++ 2/drivers/pnp/interface.c	2006-04-14 22:54:45.000000000 +0200
@@ -264,7 +264,7 @@
 			if (pnp_port_flags(dev, i) & IORESOURCE_DISABLED)
 				pnp_printf(buffer," disabled\n");
 			else
-				pnp_printf(buffer," 0x%lx-0x%lx\n",
+				pnp_printf(buffer," 0x%llx-0x%llx\n",
 						pnp_port_start(dev, i),
 						pnp_port_end(dev, i));
 		}
@@ -275,7 +275,7 @@
 			if (pnp_mem_flags(dev, i) & IORESOURCE_DISABLED)
 				pnp_printf(buffer," disabled\n");
 			else
-				pnp_printf(buffer," 0x%lx-0x%lx\n",
+				pnp_printf(buffer," 0x%llx-0x%llx\n",
 						pnp_mem_start(dev, i),
 						pnp_mem_end(dev, i));
 		}
@@ -286,7 +286,7 @@
 			if (pnp_irq_flags(dev, i) & IORESOURCE_DISABLED)
 				pnp_printf(buffer," disabled\n");
 			else
-				pnp_printf(buffer," %ld\n",
+				pnp_printf(buffer," %lld\n",
 						pnp_irq(dev, i));
 		}
 	}
@@ -296,7 +296,7 @@
 			if (pnp_dma_flags(dev, i) & IORESOURCE_DISABLED)
 				pnp_printf(buffer," disabled\n");
 			else
-				pnp_printf(buffer," %ld\n",
+				pnp_printf(buffer," %lld\n",
 						pnp_dma(dev, i));
 		}
 	}


^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2006-04-14 21:08 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-23 19:57 [RFC][PATCH 0/10] 64 bit resources Vivek Goyal
2006-03-23 19:59 ` [RFC][PATCH 1/10] 64 bit resources core changes Vivek Goyal
2006-03-23 20:01   ` [RFC][PATCH 2/10] 64 bit resources drivers pci changes Vivek Goyal
2006-03-23 20:02     ` [RFC][PATCH 3/10] 64 bit resources drivers ide changes Vivek Goyal
2006-03-23 20:03       ` [RFC][PATCH 4/10] 64 bit resources drivers media changes Vivek Goyal
2006-03-23 20:04         ` [RFC][PATCH 5/10] 64 bit resources drivers net changes Vivek Goyal
2006-03-23 20:06           ` [RFC][PATCH 6/10] 64 bit resources drivers pcmcia changes Vivek Goyal
2006-03-23 20:07             ` [RFC][PATCH 7/10] 64 bit resources drivers others changes Vivek Goyal
2006-03-23 20:09               ` [RFC][PATCH 8/10] 64 bit resources sound changes Vivek Goyal
2006-03-23 20:10                 ` [RFC][PATCH 9/10] 64 bit resources arch changes Vivek Goyal
2006-03-23 20:11                   ` [RFC][PATCH 10/10] i386: export memory more than 4G through /proc/iomem Vivek Goyal
2006-03-24 12:15       ` [RFC][PATCH 3/10] 64 bit resources drivers ide changes Alan Cox
2006-03-24 14:43         ` Vivek Goyal
2006-03-23 20:22   ` [RFC][PATCH 1/10] 64 bit resources core changes Arjan van de Ven
2006-03-23 20:41     ` Vivek Goyal
2006-03-23 20:52     ` Linus Torvalds
2006-03-23 20:56       ` Arjan van de Ven
2006-03-23 21:02         ` Al Viro
2006-03-23 21:07           ` Arjan van de Ven
2006-03-23 21:21             ` Al Viro
2006-03-23 21:01       ` Al Viro
2006-04-14 21:07   ` Matthieu CASTET
2006-03-24  9:12 ` [RFC][PATCH 0/10] 64 bit resources Andrew Morton
2006-03-24 18:05   ` Vivek Goyal
2006-03-28 16:34     ` Kumar Gala
2006-03-28 22:24       ` Vivek Goyal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).