2006-05-05 17:28:59

by Vivek Goyal

[permalink] [raw]
Subject: [RFC][PATCH 1/6] kconfigurable resources core changes



o Core changes for Kconfigurable memory and IO resources. By default resources
are 64bit until chosen to be 32bit.

o Last time I posted the patches for 64bit memory resources but it raised
the concerns regarding code bloat on 32bit systems who use 32 bit
resources.

o This patch-set allows resources to be kconfigurable.

o I have done cross compilation on i386, x86_64, ppc, powerpc, sparc, sparc64
ia64 and alpha.

Signed-off-by: Vivek Goyal <[email protected]>
---

include/linux/ioport.h | 24 ++++++++++++++----------
include/linux/types.h | 6 ++++++
kernel/resource.c | 45 ++++++++++++++++++++++++++++-----------------
3 files changed, 48 insertions(+), 27 deletions(-)

diff -puN include/linux/types.h~kconfigurable-resources-core-changes include/linux/types.h
--- linux-2.6.17-rc3-mm1-1M/include/linux/types.h~kconfigurable-resources-core-changes 2006-05-05 11:53:24.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/include/linux/types.h 2006-05-05 11:53:24.000000000 -0400
@@ -146,6 +146,12 @@ typedef u64 blkcnt_t;
typedef unsigned long blkcnt_t;
#endif

+#ifdef CONFIG_RESOURCES_32BIT
+typedef u32 resource_size_t;
+#else
+typedef u64 resource_size_t;
+#endif
+
/*
* The type of an index into the pagecache. Use a #define so asm/types.h
* can override it.
diff -puN include/linux/ioport.h~kconfigurable-resources-core-changes include/linux/ioport.h
--- linux-2.6.17-rc3-mm1-1M/include/linux/ioport.h~kconfigurable-resources-core-changes 2006-05-05 11:53:24.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/include/linux/ioport.h 2006-05-05 11:53:24.000000000 -0400
@@ -15,7 +15,7 @@
* nesting etc..
*/
struct resource {
- u64 start, end;
+ resource_size_t start, end;
const char *name;
unsigned long flags;
struct resource *parent, *sibling, *child;
@@ -97,13 +97,13 @@ extern struct resource * ____request_res
extern int release_resource(struct resource *new);
extern int insert_resource(struct resource *parent, struct resource *new);
extern int allocate_resource(struct resource *root, struct resource *new,
- u64 size,
- u64 min, u64 max,
- u64 align,
+ resource_size_t size, resource_size_t min,
+ resource_size_t max, resource_size_t align,
void (*alignf)(void *, struct resource *,
- u64, u64),
+ resource_size_t, resource_size_t),
void *alignf_data);
-int adjust_resource(struct resource *res, u64 start, u64 size);
+int adjust_resource(struct resource *res, resource_size_t start,
+ resource_size_t size);

/* get registered SYSTEM_RAM resources in specified area */
extern int find_next_system_ram(struct resource *res);
@@ -113,17 +113,21 @@ extern int find_next_system_ram(struct r
#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 *, u64 start, u64 n, const char *name);
+extern struct resource * __request_region(struct resource *,
+ resource_size_t start,
+ resource_size_t 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 *, u64, u64);
-extern void __release_region(struct resource *, u64, u64);
+extern int __check_region(struct resource *, resource_size_t, resource_size_t);
+extern void __release_region(struct resource *, resource_size_t,
+ resource_size_t);

-static inline int __deprecated check_region(u64 s, u64 n)
+static inline int __deprecated check_region(resource_size_t s,
+ resource_size_t n)
{
return __check_region(&ioport_resource, s, n);
}
diff -puN kernel/resource.c~kconfigurable-resources-core-changes kernel/resource.c
--- linux-2.6.17-rc3-mm1-1M/kernel/resource.c~kconfigurable-resources-core-changes 2006-05-05 11:53:24.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/kernel/resource.c 2006-05-05 11:53:24.000000000 -0400
@@ -23,7 +23,11 @@

struct resource ioport_resource = {
.name = "PCI IO",
+#ifdef CONFIG_RESOURCES_32BIT
+ .start = 0x0000UL,
+#else
.start = 0x0000ULL,
+#endif
.end = IO_SPACE_LIMIT,
.flags = IORESOURCE_IO,
};
@@ -32,8 +36,13 @@ EXPORT_SYMBOL(ioport_resource);

struct resource iomem_resource = {
.name = "PCI mem",
+#ifdef CONFIG_RESOURCES_32BIT
+ .start = 0UL,
+ .end = ~0UL,
+#else
.start = 0ULL,
.end = ~0ULL,
+#endif
.flags = IORESOURCE_MEM,
};

@@ -151,8 +160,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)
{
- u64 start = new->start;
- u64 end = new->end;
+ resource_size_t start = new->start;
+ resource_size_t end = new->end;
struct resource *tmp, **p;

if (end < start)
@@ -250,7 +259,7 @@ EXPORT_SYMBOL(release_resource);
*/
int find_next_system_ram(struct resource *res)
{
- u64 start, end;
+ resource_size_t start, end;
struct resource *p;

BUG_ON(!res);
@@ -284,11 +293,10 @@ int find_next_system_ram(struct resource
* Find empty slot in the resource tree given range and alignment.
*/
static int find_resource(struct resource *root, struct resource *new,
- u64 size,
- u64 min, u64 max,
- u64 align,
+ resource_size_t size, resource_size_t min,
+ resource_size_t max, resource_size_t align,
void (*alignf)(void *, struct resource *,
- u64, u64),
+ resource_size_t, resource_size_t),
void *alignf_data)
{
struct resource *this = root->child;
@@ -330,11 +338,10 @@ 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,
- u64 size,
- u64 min, u64 max,
- u64 align,
+ resource_size_t size, resource_size_t min,
+ resource_size_t max, resource_size_t align,
void (*alignf)(void *, struct resource *,
- u64, u64),
+ resource_size_t, resource_size_t),
void *alignf_data)
{
int err;
@@ -424,10 +431,10 @@ int insert_resource(struct resource *par
* arguments. Returns -EBUSY if it can't fit. Existing children of
* the resource are assumed to be immutable.
*/
-int adjust_resource(struct resource *res, u64 start, u64 size)
+int adjust_resource(struct resource *res, resource_size_t start, resource_size_t size)
{
struct resource *tmp, *parent = res->parent;
- u64 end = start + size - 1;
+ resource_size_t end = start + size - 1;
int result = -EBUSY;

write_lock(&resource_lock);
@@ -474,7 +481,9 @@ EXPORT_SYMBOL(adjust_resource);
*
* Release-region releases a matching busy region.
*/
-struct resource * __request_region(struct resource *parent, u64 start, u64 n, const char *name)
+struct resource * __request_region(struct resource *parent,
+ resource_size_t start, resource_size_t n,
+ const char *name)
{
struct resource *res = kzalloc(sizeof(*res), GFP_KERNEL);

@@ -510,7 +519,8 @@ struct resource * __request_region(struc

EXPORT_SYMBOL(__request_region);

-int __check_region(struct resource *parent, u64 start, u64 n)
+int __check_region(struct resource *parent, resource_size_t start,
+ resource_size_t n)
{
struct resource * res;

@@ -525,10 +535,11 @@ int __check_region(struct resource *pare

EXPORT_SYMBOL(__check_region);

-void __release_region(struct resource *parent, u64 start, u64 n)
+void __release_region(struct resource *parent, resource_size_t start,
+ resource_size_t n)
{
struct resource **p;
- u64 end;
+ resource_size_t end;

p = &parent->child;
end = start + n - 1;
_


2006-05-05 17:30:21

by Vivek Goyal

[permalink] [raw]
Subject: [RFC][PATCH 2/6] kconfigurable resources driver pci changes



o Changes to drivers/pci/* for kconfigurable resources.

Signed-off-by: Vivek Goyal <[email protected]>
---

drivers/pci/bus.c | 10 +++++-----
drivers/pci/pci-sysfs.c | 4 ++--
drivers/pci/pci.h | 6 +++---
drivers/pci/proc.c | 4 ++--
drivers/pci/setup-res.c | 6 +++---
include/linux/pci.h | 13 +++++++------
6 files changed, 22 insertions(+), 21 deletions(-)

diff -puN include/linux/pci.h~kconfigurable-resources-drivers-pci-changes include/linux/pci.h
--- linux-2.6.17-rc3-mm1-1M/include/linux/pci.h~kconfigurable-resources-drivers-pci-changes 2006-05-05 11:55:02.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/include/linux/pci.h 2006-05-05 11:55:02.000000000 -0400
@@ -403,8 +403,8 @@ int pcibios_enable_device(struct pci_dev
char *pcibios_setup (char *str);

/* Used only when drivers/pci/setup.c is used */
-void pcibios_align_resource(void *, struct resource *,
- u64, u64);
+void pcibios_align_resource(void *, struct resource *, resource_size_t,
+ resource_size_t);
void pcibios_update_irq(struct pci_dev *, int irq);

/* Generic PCI functions used internally */
@@ -531,10 +531,10 @@ void pci_release_region(struct pci_dev *

/* drivers/pci/bus.c */
int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res,
- u64 size, u64 align,
- u64 min, unsigned int type_mask,
+ resource_size_t size, resource_size_t align,
+ resource_size_t min, unsigned int type_mask,
void (*alignf)(void *, struct resource *,
- u64, u64),
+ resource_size_t, resource_size_t),
void *alignf_data);
void pci_enable_bridges(struct pci_bus *bus);

@@ -728,7 +728,8 @@ static inline char *pci_name(struct pci_
*/
#ifndef HAVE_ARCH_PCI_RESOURCE_TO_USER
static inline void pci_resource_to_user(const struct pci_dev *dev, int bar,
- const struct resource *rsrc, u64 *start, u64 *end)
+ const struct resource *rsrc, resource_size_t *start,
+ resource_size_t *end)
{
*start = rsrc->start;
*end = rsrc->end;
diff -puN drivers/pci/pci.h~kconfigurable-resources-drivers-pci-changes drivers/pci/pci.h
--- linux-2.6.17-rc3-mm1-1M/drivers/pci/pci.h~kconfigurable-resources-drivers-pci-changes 2006-05-05 11:55:02.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/drivers/pci/pci.h 2006-05-05 11:55:02.000000000 -0400
@@ -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,
- u64 size, u64 align,
- u64 min, unsigned int type_mask,
+ resource_size_t size, resource_size_t align,
+ resource_size_t min, unsigned int type_mask,
void (*alignf)(void *, struct resource *,
- u64, u64),
+ resource_size_t, resource_size_t),
void *alignf_data);
/* Firmware callbacks */
extern int (*platform_pci_choose_state)(struct pci_dev *dev, pm_message_t state);
diff -puN drivers/pci/bus.c~kconfigurable-resources-drivers-pci-changes drivers/pci/bus.c
--- linux-2.6.17-rc3-mm1-1M/drivers/pci/bus.c~kconfigurable-resources-drivers-pci-changes 2006-05-05 11:55:02.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/drivers/pci/bus.c 2006-05-05 11:55:02.000000000 -0400
@@ -34,11 +34,11 @@
*/
int
pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res,
- u64 size, u64 align, u64 min,
- unsigned int type_mask,
- void (*alignf)(void *, struct resource *,
- u64, u64),
- void *alignf_data)
+ resource_size_t size, resource_size_t align,
+ resource_size_t min, unsigned int type_mask,
+ void (*alignf)(void *, struct resource *, resource_size_t,
+ resource_size_t),
+ void *alignf_data)
{
int i, ret = -ENOMEM;

diff -puN drivers/pci/pci-sysfs.c~kconfigurable-resources-drivers-pci-changes drivers/pci/pci-sysfs.c
--- linux-2.6.17-rc3-mm1-1M/drivers/pci/pci-sysfs.c~kconfigurable-resources-drivers-pci-changes 2006-05-05 11:55:02.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/drivers/pci/pci-sysfs.c 2006-05-05 11:55:02.000000000 -0400
@@ -65,7 +65,7 @@ resource_show(struct device * dev, struc
char * str = buf;
int i;
int max = 7;
- u64 start, end;
+ resource_size_t start, end;

if (pci_dev->subordinate)
max = DEVICE_COUNT_RESOURCE;
@@ -341,7 +341,7 @@ pci_mmap_resource(struct kobject *kobj,
struct device, kobj));
struct resource *res = (struct resource *)attr->private;
enum pci_mmap_state mmap_type;
- u64 start, end;
+ resource_size_t start, end;
int i;

for (i = 0; i < PCI_ROM_RESOURCE; i++)
diff -puN drivers/pci/proc.c~kconfigurable-resources-drivers-pci-changes drivers/pci/proc.c
--- linux-2.6.17-rc3-mm1-1M/drivers/pci/proc.c~kconfigurable-resources-drivers-pci-changes 2006-05-05 11:55:02.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/drivers/pci/proc.c 2006-05-05 11:55:02.000000000 -0400
@@ -350,14 +350,14 @@ static int show_device(struct seq_file *
dev->irq);
/* Here should be 7 and not PCI_NUM_RESOURCES as we need to preserve compatibility */
for (i=0; i<7; i++) {
- u64 start, end;
+ resource_size_t start, end;
pci_resource_to_user(dev, i, &dev->resource[i], &start, &end);
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;
+ resource_size_t start, end;
pci_resource_to_user(dev, i, &dev->resource[i], &start, &end);
seq_printf(m, "\t%16llx",
dev->resource[i].start < dev->resource[i].end ?
diff -puN drivers/pci/setup-res.c~kconfigurable-resources-drivers-pci-changes drivers/pci/setup-res.c
--- linux-2.6.17-rc3-mm1-1M/drivers/pci/setup-res.c~kconfigurable-resources-drivers-pci-changes 2006-05-05 11:55:02.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/drivers/pci/setup-res.c 2006-05-05 11:55:02.000000000 -0400
@@ -121,7 +121,7 @@ int pci_assign_resource(struct pci_dev *
{
struct pci_bus *bus = dev->bus;
struct resource *res = dev->resource + resno;
- u64 size, min, align;
+ resource_size_t size, min, align;
int ret;

size = res->end - res->start + 1;
@@ -206,7 +206,7 @@ pdev_sort_resources(struct pci_dev *dev,
for (i = 0; i < PCI_NUM_RESOURCES; i++) {
struct resource *r;
struct resource_list *list, *tmp;
- u64 r_align;
+ resource_size_t r_align;

r = &dev->resource[i];
r_align = r->end - r->start;
@@ -222,7 +222,7 @@ pdev_sort_resources(struct pci_dev *dev,
}
r_align = (i < PCI_BRIDGE_RESOURCES) ? r_align + 1 : r->start;
for (list = head; ; list = list->next) {
- u64 align = 0;
+ resource_size_t align = 0;
struct resource_list *ln = list->next;
int idx;

_

2006-05-05 17:31:15

by Vivek Goyal

[permalink] [raw]
Subject: [RFC][PATCH 3/6] kconfigurable resources driver others changes



o Changes to files under driver/* except driver/pci/* which is covered in a
separate patch.

Signed-off-by: Vivek Goyal <[email protected]>
---

drivers/ieee1394/ohci1394.c | 2 +-
drivers/infiniband/hw/ipath/ipath_driver.c | 8 ++++----
drivers/net/8139cp.c | 2 +-
drivers/pcmcia/rsrc_nonstatic.c | 13 ++++++++-----
drivers/pnp/manager.c | 11 ++++++-----
drivers/pnp/resource.c | 8 ++++----
include/linux/pnp.h | 7 +++++--
7 files changed, 29 insertions(+), 22 deletions(-)

diff -puN include/linux/pnp.h~kconfigurable-resources-drivers-others-changes include/linux/pnp.h
--- linux-2.6.17-rc3-mm1-1M/include/linux/pnp.h~kconfigurable-resources-drivers-others-changes 2006-05-05 11:56:25.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/include/linux/pnp.h 2006-05-05 11:56:25.000000000 -0400
@@ -389,7 +389,8 @@ 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, u64 start, u64 size);
+void pnp_resource_change(struct resource *resource, resource_size_t start,
+ resource_size_t size);

/* protocol helpers */
int pnp_is_active(struct pnp_dev * dev);
@@ -434,7 +435,9 @@ 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, u64 start, u64 size) { }
+static inline void pnp_resource_change(struct resource *resource,
+ resource_size_t start,
+ resource_size_t size) { }

/* protocol helpers */
static inline int pnp_is_active(struct pnp_dev * dev) { return 0; }
diff -puN drivers/pnp/resource.c~kconfigurable-resources-drivers-others-changes drivers/pnp/resource.c
--- linux-2.6.17-rc3-mm1-1M/drivers/pnp/resource.c~kconfigurable-resources-drivers-others-changes 2006-05-05 11:56:25.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/drivers/pnp/resource.c 2006-05-05 11:56:25.000000000 -0400
@@ -241,7 +241,7 @@ int pnp_check_port(struct pnp_dev * dev,
{
int tmp;
struct pnp_dev *tdev;
- u64 *port, *end, *tport, *tend;
+ resource_size_t *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;
- u64 *addr, *end, *taddr, *tend;
+ resource_size_t *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;
- u64 * irq = &dev->res.irq_resource[idx].start;
+ resource_size_t * 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;
- u64 * dma = &dev->res.dma_resource[idx].start;
+ resource_size_t * 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/pnp/manager.c~kconfigurable-resources-drivers-others-changes drivers/pnp/manager.c
--- linux-2.6.17-rc3-mm1-1M/drivers/pnp/manager.c~kconfigurable-resources-drivers-others-changes 2006-05-05 11:56:25.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/drivers/pnp/manager.c 2006-05-05 11:56:25.000000000 -0400
@@ -20,7 +20,7 @@ DECLARE_MUTEX(pnp_res_mutex);

static int pnp_assign_port(struct pnp_dev *dev, struct pnp_port *rule, int idx)
{
- u64 *start, *end;
+ resource_size_t *start, *end;
unsigned long *flags;

if (!dev || !rule)
@@ -64,7 +64,7 @@ static int pnp_assign_port(struct pnp_de

static int pnp_assign_mem(struct pnp_dev *dev, struct pnp_mem *rule, int idx)
{
- u64 *start, *end;
+ resource_size_t *start, *end;
unsigned long *flags;

if (!dev || !rule)
@@ -118,7 +118,7 @@ static int pnp_assign_mem(struct pnp_dev

static int pnp_assign_irq(struct pnp_dev * dev, struct pnp_irq *rule, int idx)
{
- u64 *start, *end;
+ resource_size_t *start, *end;
unsigned long *flags;
int i;

@@ -171,7 +171,7 @@ static int pnp_assign_irq(struct pnp_dev

static int pnp_assign_dma(struct pnp_dev *dev, struct pnp_dma *rule, int idx)
{
- u64 *start, *end;
+ resource_size_t *start, *end;
unsigned long *flags;
int i;

@@ -586,7 +586,8 @@ int pnp_disable_dev(struct pnp_dev *dev)
* @size: size of region
*
*/
-void pnp_resource_change(struct resource *resource, u64 start, u64 size)
+void pnp_resource_change(struct resource *resource, resource_size_t start,
+ resource_size_t size)
{
if (resource == NULL)
return;
diff -puN drivers/pcmcia/rsrc_nonstatic.c~kconfigurable-resources-drivers-others-changes drivers/pcmcia/rsrc_nonstatic.c
--- linux-2.6.17-rc3-mm1-1M/drivers/pcmcia/rsrc_nonstatic.c~kconfigurable-resources-drivers-others-changes 2006-05-05 11:56:25.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/drivers/pcmcia/rsrc_nonstatic.c 2006-05-05 11:56:25.000000000 -0400
@@ -72,7 +72,7 @@ static DEFINE_MUTEX(rsrc_mutex);
======================================================================*/

static struct resource *
-make_resource(u64 b, u64 n, int flags, char *name)
+make_resource(resource_size_t b, resource_size_t n, int flags, char *name)
{
struct resource *res = kzalloc(sizeof(*res), GFP_KERNEL);

@@ -86,7 +86,8 @@ make_resource(u64 b, u64 n, int flags, c
}

static struct resource *
-claim_region(struct pcmcia_socket *s, u64 base, u64 size, int type, char *name)
+claim_region(struct pcmcia_socket *s, resource_size_t base,
+ resource_size_t size, int type, char *name)
{
struct resource *res, *parent;

@@ -517,10 +518,11 @@ struct pcmcia_align_data {
};

static void
-pcmcia_common_align(void *align_data, struct resource *res, u64 size, u64 align)
+pcmcia_common_align(void *align_data, struct resource *res,
+ resource_size_t size, resource_size_t align)
{
struct pcmcia_align_data *data = align_data;
- u64 start;
+ resource_size_t start;
/*
* Ensure that we have the correct start address
*/
@@ -531,7 +533,8 @@ pcmcia_common_align(void *align_data, st
}

static void
-pcmcia_align(void *align_data, struct resource *res, u64 size, u64 align)
+pcmcia_align(void *align_data, struct resource *res, resource_size_t size,
+ resource_size_t align)
{
struct pcmcia_align_data *data = align_data;
struct resource_map *m;
diff -puN drivers/ieee1394/ohci1394.c~kconfigurable-resources-drivers-others-changes drivers/ieee1394/ohci1394.c
--- linux-2.6.17-rc3-mm1-1M/drivers/ieee1394/ohci1394.c~kconfigurable-resources-drivers-others-changes 2006-05-05 11:56:25.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/drivers/ieee1394/ohci1394.c 2006-05-05 11:56:25.000000000 -0400
@@ -3210,7 +3210,7 @@ static int __devinit ohci1394_pci_probe(
{
struct hpsb_host *host;
struct ti_ohci *ohci; /* shortcut to currently handled device */
- u64 ohci_base;
+ resource_size_t ohci_base;

if (pci_enable_device(dev))
FAIL(-ENXIO, "Failed to enable OHCI hardware");
diff -puN drivers/infiniband/hw/ipath/ipath_driver.c~kconfigurable-resources-drivers-others-changes drivers/infiniband/hw/ipath/ipath_driver.c
--- linux-2.6.17-rc3-mm1-1M/drivers/infiniband/hw/ipath/ipath_driver.c~kconfigurable-resources-drivers-others-changes 2006-05-05 11:56:25.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/drivers/infiniband/hw/ipath/ipath_driver.c 2006-05-05 11:56:25.000000000 -0400
@@ -451,10 +451,10 @@ static int __devinit ipath_init_one(stru
for (j = 0; j < 6; j++) {
if (!pdev->resource[j].start)
continue;
- ipath_cdbg(VERBOSE, "BAR %d start %lx, end %lx, len %lx\n",
- j, pdev->resource[j].start,
- pdev->resource[j].end,
- pci_resource_len(pdev, j));
+ ipath_cdbg(VERBOSE, "BAR %d start %llx, end %llx, len %llx\n",
+ j, (unsigned long long)pdev->resource[j].start,
+ (unsigned long long)pdev->resource[j].end,
+ (unsigned long long)pci_resource_len(pdev, j));
}

if (!addr) {
diff -puN drivers/net/8139cp.c~kconfigurable-resources-drivers-others-changes drivers/net/8139cp.c
--- linux-2.6.17-rc3-mm1-1M/drivers/net/8139cp.c~kconfigurable-resources-drivers-others-changes 2006-05-05 11:56:25.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/drivers/net/8139cp.c 2006-05-05 11:56:25.000000000 -0400
@@ -1668,7 +1668,7 @@ static int cp_init_one (struct pci_dev *
struct cp_private *cp;
int rc;
void __iomem *regs;
- u64 pciaddr;
+ resource_size_t pciaddr;
unsigned int addr_len, i, pci_using_dac;
u8 pci_rev;

_

2006-05-05 17:33:38

by Vivek Goyal

[permalink] [raw]
Subject: [RFC][PATCH 4/6] kconfigurable resources arch dependent changes (arch/[a-i]*)



o Changes to arch specific code for kconfigurable resources. This
patch contains changes for arch/[a-i]*

Signed-off-by: Vivek Goyal <[email protected]>
---

arch/alpha/kernel/pci.c | 4 ++--
arch/arm/Kconfig | 7 +++++++
arch/arm/kernel/bios32.c | 6 +++---
arch/arm26/Kconfig | 7 +++++++
arch/cris/Kconfig | 7 +++++++
arch/cris/arch-v32/drivers/pci/bios.c | 4 ++--
arch/frv/Kconfig | 7 +++++++
arch/frv/mb93090-mb00/pci-frv.c | 4 ++--
arch/h8300/Kconfig.cpu | 12 ++++++++++++
arch/i386/Kconfig | 7 +++++++
arch/i386/pci/i386.c | 4 ++--
arch/ia64/pci/pci.c | 2 +-
12 files changed, 59 insertions(+), 12 deletions(-)

diff -puN arch/alpha/kernel/pci.c~kconfigurable-resources-arch-changes-a-i arch/alpha/kernel/pci.c
--- linux-2.6.17-rc3-mm1-1M/arch/alpha/kernel/pci.c~kconfigurable-resources-arch-changes-a-i 2006-05-05 11:57:33.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/alpha/kernel/pci.c 2006-05-05 11:57:33.000000000 -0400
@@ -124,12 +124,12 @@ DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_

void
pcibios_align_resource(void *data, struct resource *res,
- unsigned long size, unsigned long align)
+ resource_size_t size, resource_size_t align)
{
struct pci_dev *dev = data;
struct pci_controller *hose = dev->sysdata;
unsigned long alignto;
- unsigned long start = res->start;
+ resource_size_t start = res->start;

if (res->flags & IORESOURCE_IO) {
/* Make sure we start at our min on all hoses */
diff -puN arch/arm26/Kconfig~kconfigurable-resources-arch-changes-a-i arch/arm26/Kconfig
--- linux-2.6.17-rc3-mm1-1M/arch/arm26/Kconfig~kconfigurable-resources-arch-changes-a-i 2006-05-05 11:57:33.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/arm26/Kconfig 2006-05-05 11:57:33.000000000 -0400
@@ -187,6 +187,13 @@ config CMDLINE

source "mm/Kconfig"

+config RESOURCES_32BIT
+ bool "32 bit Memory and IO resources (EXPERIMENTAL)"
+ depends on EXPERIMENTAL
+ help
+ By default resources are 64 bit. This option allows memory and IO
+ resources to be 32 bit to optimize code size.
+
endmenu

source "net/Kconfig"
diff -puN arch/arm/Kconfig~kconfigurable-resources-arch-changes-a-i arch/arm/Kconfig
--- linux-2.6.17-rc3-mm1-1M/arch/arm/Kconfig~kconfigurable-resources-arch-changes-a-i 2006-05-05 11:57:33.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/arm/Kconfig 2006-05-05 11:57:33.000000000 -0400
@@ -520,6 +520,13 @@ config NODES_SHIFT

source "mm/Kconfig"

+config RESOURCES_32BIT
+ bool "32 bit Memory and IO resources (EXPERIMENTAL)"
+ depends on EXPERIMENTAL
+ help
+ By default resources are 64 bit. This option allows memory and IO
+ resources to be 32 bit to optimize code size.
+
config LEDS
bool "Timer and CPU usage LEDs"
depends on ARCH_CDB89712 || ARCH_CO285 || ARCH_EBSA110 || \
diff -puN arch/arm/kernel/bios32.c~kconfigurable-resources-arch-changes-a-i arch/arm/kernel/bios32.c
--- linux-2.6.17-rc3-mm1-1M/arch/arm/kernel/bios32.c~kconfigurable-resources-arch-changes-a-i 2006-05-05 11:57:33.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/arm/kernel/bios32.c 2006-05-05 11:57:33.000000000 -0400
@@ -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)
{
- u64 offset;
+ resource_size_t 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,
- u64 size, u64 align)
+ resource_sz_t size, resource_size_t align)
{
- u64 start = res->start;
+ resource_size_t start = res->start;

if (res->flags & IORESOURCE_IO && start & 0x300)
start = (start + 0x3ff) & ~0x3ff;
diff -puN arch/cris/arch-v32/drivers/pci/bios.c~kconfigurable-resources-arch-changes-a-i arch/cris/arch-v32/drivers/pci/bios.c
--- linux-2.6.17-rc3-mm1-1M/arch/cris/arch-v32/drivers/pci/bios.c~kconfigurable-resources-arch-changes-a-i 2006-05-05 11:57:33.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/cris/arch-v32/drivers/pci/bios.c 2006-05-05 11:57:33.000000000 -0400
@@ -45,10 +45,10 @@ int pci_mmap_page_range(struct pci_dev *

void
pcibios_align_resource(void *data, struct resource *res,
- unsigned long size, unsigned long align)
+ resource_size_t size, resource_size_t align)
{
if (res->flags & IORESOURCE_IO) {
- unsigned long start = res->start;
+ resource_size_t start = res->start;

if (start & 0x300) {
start = (start + 0x3ff) & ~0x3ff;
diff -puN arch/cris/Kconfig~kconfigurable-resources-arch-changes-a-i arch/cris/Kconfig
--- linux-2.6.17-rc3-mm1-1M/arch/cris/Kconfig~kconfigurable-resources-arch-changes-a-i 2006-05-05 11:57:33.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/cris/Kconfig 2006-05-05 11:57:33.000000000 -0400
@@ -80,6 +80,13 @@ config PREEMPT

source mm/Kconfig

+config RESOURCES_32BIT
+ bool "32 bit Memory and IO resources (EXPERIMENTAL)"
+ depends on EXPERIMENTAL
+ help
+ By default resources are 64 bit. This option allows memory and IO
+ resources to be 32 bit to optimize code size.
+
endmenu

menu "Hardware setup"
diff -puN arch/frv/Kconfig~kconfigurable-resources-arch-changes-a-i arch/frv/Kconfig
--- linux-2.6.17-rc3-mm1-1M/arch/frv/Kconfig~kconfigurable-resources-arch-changes-a-i 2006-05-05 11:57:33.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/frv/Kconfig 2006-05-05 11:57:33.000000000 -0400
@@ -80,6 +80,13 @@ config HIGHPTE

source "mm/Kconfig"

+config RESOURCES_32BIT
+ bool "32 bit Memory and IO resources (EXPERIMENTAL)"
+ depends on EXPERIMENTAL
+ help
+ By default resources are 64 bit. This option allows memory and IO
+ resources to be 32 bit to optimize code size.
+
choice
prompt "uClinux kernel load address"
depends on !MMU
diff -puN arch/frv/mb93090-mb00/pci-frv.c~kconfigurable-resources-arch-changes-a-i arch/frv/mb93090-mb00/pci-frv.c
--- linux-2.6.17-rc3-mm1-1M/arch/frv/mb93090-mb00/pci-frv.c~kconfigurable-resources-arch-changes-a-i 2006-05-05 11:57:33.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/frv/mb93090-mb00/pci-frv.c 2006-05-05 11:57:33.000000000 -0400
@@ -64,10 +64,10 @@ pcibios_update_resource(struct pci_dev *
*/
void
pcibios_align_resource(void *data, struct resource *res,
- unsigned long size, unsigned long align)
+ resource_size_t size, resource_size_t align)
{
if (res->flags & IORESOURCE_IO) {
- unsigned long start = res->start;
+ resource_size_t start = res->start;

if (start & 0x300) {
start = (start + 0x3ff) & ~0x3ff;
diff -puN arch/h8300/Kconfig.cpu~kconfigurable-resources-arch-changes-a-i arch/h8300/Kconfig.cpu
--- linux-2.6.17-rc3-mm1-1M/arch/h8300/Kconfig.cpu~kconfigurable-resources-arch-changes-a-i 2006-05-05 12:55:38.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/h8300/Kconfig.cpu 2006-05-05 12:56:28.000000000 -0400
@@ -183,4 +183,10 @@ config PREEMPT

source "mm/Kconfig"

+config RESOURCES_32BIT
+ bool "32 bit Memory and IO resources (EXPERIMENTAL)"
+ depends on EXPERIMENTAL
+ help
+ By default resources are 64 bit. This option allows memory and IO
+ resources to be 32 bit to optimize code size.
endmenu
diff -puN arch/i386/Kconfig~kconfigurable-resources-arch-changes-a-i arch/i386/Kconfig
--- linux-2.6.17-rc3-mm1-1M/arch/i386/Kconfig~kconfigurable-resources-arch-changes-a-i 2006-05-05 11:57:33.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/i386/Kconfig 2006-05-05 11:57:33.000000000 -0400
@@ -762,6 +762,13 @@ config PHYSICAL_START

Don't change this unless you know what you are doing.

+config RESOURCES_32BIT
+ bool "32 bit Memory and IO resources (EXPERIMENTAL)"
+ depends on EXPERIMENTAL
+ help
+ By default resources are 64 bit. This option allows memory and IO
+ resources to be 32 bit to optimize code size.
+
config HOTPLUG_CPU
bool "Support for hot-pluggable CPUs (EXPERIMENTAL)"
depends on SMP && HOTPLUG && EXPERIMENTAL && !X86_VOYAGER
diff -puN arch/i386/pci/i386.c~kconfigurable-resources-arch-changes-a-i arch/i386/pci/i386.c
--- linux-2.6.17-rc3-mm1-1M/arch/i386/pci/i386.c~kconfigurable-resources-arch-changes-a-i 2006-05-05 11:57:33.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/i386/pci/i386.c 2006-05-05 11:57:33.000000000 -0400
@@ -48,10 +48,10 @@
*/
void
pcibios_align_resource(void *data, struct resource *res,
- u64 size, u64 align)
+ resource_size_t size, resource_size_t align)
{
if (res->flags & IORESOURCE_IO) {
- u64 start = res->start;
+ resource_size_t start = res->start;

if (start & 0x300) {
start = (start + 0x3ff) & ~0x3ff;
diff -puN arch/ia64/pci/pci.c~kconfigurable-resources-arch-changes-a-i arch/ia64/pci/pci.c
--- linux-2.6.17-rc3-mm1-1M/arch/ia64/pci/pci.c~kconfigurable-resources-arch-changes-a-i 2006-05-05 11:57:33.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/ia64/pci/pci.c 2006-05-05 11:57:33.000000000 -0400
@@ -568,7 +568,7 @@ pcibios_disable_device (struct pci_dev *

void
pcibios_align_resource (void *data, struct resource *res,
- unsigned long size, unsigned long align)
+ resource_size_t size, resource_size_t align)
{
}

diff -puN arch/h8300/Kconfig.cpu~kconfigurable-resources-arch-changes-a-i arch/h8300/Kconfig.cpu
--- linux-2.6.17-rc3-mm1-1M/arch/h8300/Kconfig.cpu~kconfigurable-resources-arch-changes-a-i 2006-05-05 12:55:38.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/h8300/Kconfig.cpu 2006-05-05 12:56:28.000000000 -0400
@@ -183,4 +183,10 @@ config PREEMPT

source "mm/Kconfig"

+config RESOURCES_32BIT
+ bool "32 bit Memory and IO resources (EXPERIMENTAL)"
+ depends on EXPERIMENTAL
+ help
+ By default resources are 64 bit. This option allows memory and IO
+ resources to be 32 bit to optimize code size.
endmenu
_

2006-05-05 17:34:47

by Vivek Goyal

[permalink] [raw]
Subject: [RFC][PATCH 5/6] kconfigurable resources arch dependent changes (arch/[j-p]*)



o Changes to arch specific code for kconfigurable resources. This
patch contains changes for arch/[j-p]*

Signed-off-by: Vivek Goyal <[email protected]>
---

arch/m32r/Kconfig | 7 +++++++
arch/m68k/Kconfig | 7 +++++++
arch/m68knommu/Kconfig | 7 +++++++
arch/m68knommu/kernel/comempci.c | 3 ++-
arch/mips/Kconfig | 8 ++++++++
arch/mips/pci/pci.c | 4 ++--
arch/mips/pmc-sierra/yosemite/ht.c | 4 ++--
arch/parisc/Kconfig | 8 ++++++++
arch/parisc/kernel/pci.c | 2 +-
arch/powerpc/Kconfig | 8 ++++++++
arch/powerpc/kernel/pci_32.c | 10 +++++-----
arch/powerpc/kernel/pci_64.c | 4 ++--
arch/ppc/Kconfig | 7 +++++++
arch/ppc/kernel/pci.c | 12 ++++++------
include/asm-powerpc/pci.h | 2 +-
include/asm-ppc/pci.h | 2 +-
16 files changed, 74 insertions(+), 21 deletions(-)

diff -puN arch/m32r/Kconfig~kconfigurable-resources-arch-changes-j-p arch/m32r/Kconfig
--- linux-2.6.17-rc3-mm1-1M/arch/m32r/Kconfig~kconfigurable-resources-arch-changes-j-p 2006-05-05 11:58:46.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/m32r/Kconfig 2006-05-05 11:58:46.000000000 -0400
@@ -188,6 +188,13 @@ config ARCH_DISCONTIGMEM_ENABLE

source "mm/Kconfig"

+config RESOURCES_32BIT
+ bool "32 bit Memory and IO resources (EXPERIMENTAL)"
+ depends on EXPERIMENTAL
+ help
+ By default resources are 64 bit. This option allows memory and IO
+ resources to be 32 bit to optimize code size.
+
config IRAM_START
hex "Internal memory start address (hex)"
default "00f00000" if !CHIP_M32104
diff -puN arch/m68k/Kconfig~kconfigurable-resources-arch-changes-j-p arch/m68k/Kconfig
--- linux-2.6.17-rc3-mm1-1M/arch/m68k/Kconfig~kconfigurable-resources-arch-changes-j-p 2006-05-05 11:58:46.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/m68k/Kconfig 2006-05-05 11:58:46.000000000 -0400
@@ -368,6 +368,13 @@ config 060_WRITETHROUGH

source "mm/Kconfig"

+config RESOURCES_32BIT
+ bool "32 bit Memory and IO resources (EXPERIMENTAL)"
+ depends on EXPERIMENTAL
+ help
+ By default resources are 64 bit. This option allows memory and IO
+ resources to be 32 bit to optimize code size.
+
endmenu

menu "General setup"
diff -puN arch/m68knommu/Kconfig~kconfigurable-resources-arch-changes-j-p arch/m68knommu/Kconfig
--- linux-2.6.17-rc3-mm1-1M/arch/m68knommu/Kconfig~kconfigurable-resources-arch-changes-j-p 2006-05-05 11:58:46.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/m68knommu/Kconfig 2006-05-05 11:58:46.000000000 -0400
@@ -605,6 +605,13 @@ endchoice

source "mm/Kconfig"

+config RESOURCES_32BIT
+ bool "32 bit Memory and IO resources (EXPERIMENTAL)"
+ depends on EXPERIMENTAL
+ help
+ By default resources are 64 bit. This option allows memory and IO
+ resources to be 32 bit to optimize code size.
+
endmenu

config ISA_DMA_API
diff -puN arch/m68knommu/kernel/comempci.c~kconfigurable-resources-arch-changes-j-p arch/m68knommu/kernel/comempci.c
--- linux-2.6.17-rc3-mm1-1M/arch/m68knommu/kernel/comempci.c~kconfigurable-resources-arch-changes-j-p 2006-05-05 11:58:46.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/m68knommu/kernel/comempci.c 2006-05-05 11:58:46.000000000 -0400
@@ -357,7 +357,8 @@ void pcibios_fixup_bus(struct pci_bus *b

/*****************************************************************************/

-void pcibios_align_resource(void *data, struct resource *res, unsigned long size, unsigned long align)
+void pcibios_align_resource(void *data, struct resource *res,
+ resource_size_t size, resource_size_t align)
{
}

diff -puN arch/mips/Kconfig~kconfigurable-resources-arch-changes-j-p arch/mips/Kconfig
--- linux-2.6.17-rc3-mm1-1M/arch/mips/Kconfig~kconfigurable-resources-arch-changes-j-p 2006-05-05 11:58:46.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/mips/Kconfig 2006-05-05 11:58:46.000000000 -0400
@@ -1655,6 +1655,14 @@ config NR_CPUS

source "kernel/Kconfig.preempt"

+config RESOURCES_32BIT
+ bool "32 bit Memory and IO resources (EXPERIMENTAL)"
+ depends on EXPERIMENTAL
+ depends on 32BIT
+ help
+ By default resources are 64 bit. This option allows memory and IO
+ resources to be 32 bit to optimize code size.
+
config RTC_DS1742
bool "DS1742 BRAM/RTC support"
depends on TOSHIBA_JMR3927 || TOSHIBA_RBTX4927
diff -puN arch/mips/pci/pci.c~kconfigurable-resources-arch-changes-j-p arch/mips/pci/pci.c
--- linux-2.6.17-rc3-mm1-1M/arch/mips/pci/pci.c~kconfigurable-resources-arch-changes-j-p 2006-05-05 11:58:46.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/mips/pci/pci.c 2006-05-05 11:58:46.000000000 -0400
@@ -51,11 +51,11 @@ unsigned long PCIBIOS_MIN_MEM = 0;
*/
void
pcibios_align_resource(void *data, struct resource *res,
- unsigned long size, unsigned long align)
+ resource_size_t size, resource_size_t align)
{
struct pci_dev *dev = data;
struct pci_controller *hose = dev->sysdata;
- unsigned long start = res->start;
+ resource_size_t start = res->start;

if (res->flags & IORESOURCE_IO) {
/* Make sure we start at our min on all hoses */
diff -puN arch/mips/pmc-sierra/yosemite/ht.c~kconfigurable-resources-arch-changes-j-p arch/mips/pmc-sierra/yosemite/ht.c
--- linux-2.6.17-rc3-mm1-1M/arch/mips/pmc-sierra/yosemite/ht.c~kconfigurable-resources-arch-changes-j-p 2006-05-05 11:58:46.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/mips/pmc-sierra/yosemite/ht.c 2006-05-05 11:58:46.000000000 -0400
@@ -383,12 +383,12 @@ void pcibios_update_resource(struct pci_


void pcibios_align_resource(void *data, struct resource *res,
- unsigned long size, unsigned long align)
+ resource_size_t size, resource_size_t align)
{
struct pci_dev *dev = data;

if (res->flags & IORESOURCE_IO) {
- unsigned long start = res->start;
+ resource_size_t start = res->start;

/* We need to avoid collisions with `mirrored' VGA ports
and other strange ISA hardware, so we always want the
diff -puN arch/parisc/Kconfig~kconfigurable-resources-arch-changes-j-p arch/parisc/Kconfig
--- linux-2.6.17-rc3-mm1-1M/arch/parisc/Kconfig~kconfigurable-resources-arch-changes-j-p 2006-05-05 11:58:46.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/parisc/Kconfig 2006-05-05 11:58:46.000000000 -0400
@@ -217,6 +217,14 @@ source "kernel/Kconfig.preempt"
source "kernel/Kconfig.hz"
source "mm/Kconfig"

+config RESOURCES_32BIT
+ bool "32 bit Memory and IO resources (EXPERIMENTAL)"
+ depends on EXPERIMENTAL
+ depends on !64BIT
+ help
+ By default resources are 64 bit. This option allows memory and IO
+ resources to be 32 bit to optimize code size.
+
config COMPAT
def_bool y
depends on 64BIT
diff -puN arch/parisc/kernel/pci.c~kconfigurable-resources-arch-changes-j-p arch/parisc/kernel/pci.c
--- linux-2.6.17-rc3-mm1-1M/arch/parisc/kernel/pci.c~kconfigurable-resources-arch-changes-j-p 2006-05-05 11:58:46.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/parisc/kernel/pci.c 2006-05-05 11:58:46.000000000 -0400
@@ -289,7 +289,7 @@ EXPORT_SYMBOL(pcibios_bus_to_resource);
* than res->start.
*/
void pcibios_align_resource(void *data, struct resource *res,
- unsigned long size, unsigned long alignment)
+ resource_size_t size, resource_size_t alignment)
{
unsigned long mask, align;

diff -puN include/asm-powerpc/pci.h~kconfigurable-resources-arch-changes-j-p include/asm-powerpc/pci.h
--- linux-2.6.17-rc3-mm1-1M/include/asm-powerpc/pci.h~kconfigurable-resources-arch-changes-j-p 2006-05-05 11:58:46.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/include/asm-powerpc/pci.h 2006-05-05 11:58:46.000000000 -0400
@@ -242,7 +242,7 @@ extern pgprot_t pci_phys_mem_access_prot
#define HAVE_ARCH_PCI_RESOURCE_TO_USER
extern void pci_resource_to_user(const struct pci_dev *dev, int bar,
const struct resource *rsrc,
- u64 *start, u64 *end);
+ resource_size_t *start, resource_size_t *end);
#endif /* CONFIG_PPC_MULTIPLATFORM || CONFIG_PPC32 */

#endif /* __KERNEL__ */
diff -puN arch/powerpc/Kconfig~kconfigurable-resources-arch-changes-j-p arch/powerpc/Kconfig
--- linux-2.6.17-rc3-mm1-1M/arch/powerpc/Kconfig~kconfigurable-resources-arch-changes-j-p 2006-05-05 11:58:46.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/powerpc/Kconfig 2006-05-05 11:58:46.000000000 -0400
@@ -626,6 +626,14 @@ config CRASH_DUMP

Don't change this unless you know what you are doing.

+config RESOURCES_32BIT
+ bool "32 bit Memory and IO resources (EXPERIMENTAL)"
+ depends on EXPERIMENTAL
+ depends on PPC32
+ help
+ By default resources are 64 bit. This option allows memory and IO
+ resources to be 32 bit to optimize code size.
+
config EMBEDDEDBOOT
bool
depends on 8xx || 8260
diff -puN arch/powerpc/kernel/pci_32.c~kconfigurable-resources-arch-changes-j-p arch/powerpc/kernel/pci_32.c
--- linux-2.6.17-rc3-mm1-1M/arch/powerpc/kernel/pci_32.c~kconfigurable-resources-arch-changes-j-p 2006-05-05 11:58:46.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/powerpc/kernel/pci_32.c 2006-05-05 11:58:46.000000000 -0400
@@ -173,18 +173,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, u64 size,
- u64 align)
+void pcibios_align_resource(void *data, struct resource *res,
+ resource_size_t size, resource_size_t align)
{
struct pci_dev *dev = data;

if (res->flags & IORESOURCE_IO) {
- u64 start = res->start;
+ resource_size_t start = res->start;

if (size > 0x100) {
printk(KERN_ERR "PCI: I/O Region %s/%d too large"
" (%lld bytes)\n", pci_name(dev),
- dev->resource - res, size);
+ dev->resource - res, (unsigned long long)size);
}

if (start & 0x300) {
@@ -1756,7 +1756,7 @@ long sys_pciconfig_iobase(long which, un

void pci_resource_to_user(const struct pci_dev *dev, int bar,
const struct resource *rsrc,
- u64 *start, u64 *end)
+ resource_size_t *start, resource_size_t *end)
{
struct pci_controller *hose = pci_bus_to_hose(dev->bus->number);
unsigned long offset = 0;
diff -puN arch/powerpc/kernel/pci_64.c~kconfigurable-resources-arch-changes-j-p arch/powerpc/kernel/pci_64.c
--- linux-2.6.17-rc3-mm1-1M/arch/powerpc/kernel/pci_64.c~kconfigurable-resources-arch-changes-j-p 2006-05-05 11:58:46.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/powerpc/kernel/pci_64.c 2006-05-05 11:58:46.000000000 -0400
@@ -138,11 +138,11 @@ EXPORT_SYMBOL(pcibios_bus_to_resource);
* which might have be mirrored at 0x0100-0x03ff..
*/
void pcibios_align_resource(void *data, struct resource *res,
- unsigned long size, unsigned long align)
+ resource_size_t size, resource_size_t align)
{
struct pci_dev *dev = data;
struct pci_controller *hose = pci_bus_to_host(dev->bus);
- unsigned long start = res->start;
+ resource_size_t start = res->start;
unsigned long alignto;

if (res->flags & IORESOURCE_IO) {
diff -puN include/asm-ppc/pci.h~kconfigurable-resources-arch-changes-j-p include/asm-ppc/pci.h
--- linux-2.6.17-rc3-mm1-1M/include/asm-ppc/pci.h~kconfigurable-resources-arch-changes-j-p 2006-05-05 11:58:46.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/include/asm-ppc/pci.h 2006-05-05 11:58:46.000000000 -0400
@@ -133,7 +133,7 @@ extern pgprot_t pci_phys_mem_access_prot
#define HAVE_ARCH_PCI_RESOURCE_TO_USER
extern void pci_resource_to_user(const struct pci_dev *dev, int bar,
const struct resource *rsrc,
- u64 *start, u64 *end);
+ resource_size_t *start, resource_size_t *end);


#endif /* __KERNEL__ */
diff -puN arch/ppc/Kconfig~kconfigurable-resources-arch-changes-j-p arch/ppc/Kconfig
--- linux-2.6.17-rc3-mm1-1M/arch/ppc/Kconfig~kconfigurable-resources-arch-changes-j-p 2006-05-05 11:58:46.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/ppc/Kconfig 2006-05-05 11:58:46.000000000 -0400
@@ -953,6 +953,13 @@ source kernel/Kconfig.hz
source kernel/Kconfig.preempt
source "mm/Kconfig"

+config RESOURCES_32BIT
+ bool "32 bit Memory and IO resources (EXPERIMENTAL)"
+ depends on EXPERIMENTAL
+ help
+ By default resources are 64 bit. This option allows memory and IO
+ resources to be 32 bit to optimize code size.
+
source "fs/Kconfig.binfmt"

config PREP_RESIDUAL
diff -puN arch/ppc/kernel/pci.c~kconfigurable-resources-arch-changes-j-p arch/ppc/kernel/pci.c
--- linux-2.6.17-rc3-mm1-1M/arch/ppc/kernel/pci.c~kconfigurable-resources-arch-changes-j-p 2006-05-05 11:58:46.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/ppc/kernel/pci.c 2006-05-05 11:58:46.000000000 -0400
@@ -171,13 +171,13 @@ 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, u64 size,
- u64 align)
+void pcibios_align_resource(void *data, struct resource *res,
+ resource_size_t size, resource_size_t align)
{
struct pci_dev *dev = data;

if (res->flags & IORESOURCE_IO) {
- u64 start = res->start;
+ resource_size_t start = res->start;

if (size > 0x100) {
printk(KERN_ERR "PCI: I/O Region %s/%d too large"
@@ -960,8 +960,8 @@ static pgprot_t __pci_mmap_set_pgprot(st
else
prot |= _PAGE_GUARDED;

- printk("PCI map for %s:%llx, prot: %llx\n", pci_name(dev), rp->start,
- prot);
+ printk("PCI map for %s:%llx, prot: %lx\n", pci_name(dev),
+ (unsigned long long)rp->start, prot);

return __pgprot(prot);
}
@@ -1131,7 +1131,7 @@ long sys_pciconfig_iobase(long which, un

void pci_resource_to_user(const struct pci_dev *dev, int bar,
const struct resource *rsrc,
- u64 *start, u64 *end)
+ resource_size_t *start, resource_size_t *end)
{
struct pci_controller *hose = pci_bus_to_hose(dev->bus->number);
unsigned long offset = 0;
_

2006-05-05 17:36:48

by Vivek Goyal

[permalink] [raw]
Subject: [RFC][PATCH 6/6] kconfigurable resources arch dependent changes (arch/[q-z]*)



o Changes to arch specific code for kconfigurable resources. This
patch contains changes for arch/[q-z]*

Signed-off-by: Vivek Goyal <[email protected]>
---

arch/s390/Kconfig | 8 ++++++++
arch/sh/Kconfig | 7 +++++++
arch/sh/boards/mpc1211/pci.c | 4 ++--
arch/sh/boards/overdrive/galileo.c | 2 +-
arch/sh/drivers/pci/pci.c | 6 +++---
arch/sh64/kernel/pcibios.c | 4 ++--
arch/sparc/Kconfig | 7 +++++++
arch/sparc/kernel/pcic.c | 2 +-
arch/sparc64/kernel/pci.c | 2 +-
arch/v850/Kconfig | 7 +++++++
arch/v850/kernel/rte_mb_a_pci.c | 2 +-
arch/xtensa/Kconfig | 7 +++++++
arch/xtensa/kernel/pci.c | 6 +++---
13 files changed, 50 insertions(+), 14 deletions(-)

diff -puN arch/s390/Kconfig~kconfigurable-resources-arch-changes-q-z arch/s390/Kconfig
--- linux-2.6.17-rc3-mm1-1M/arch/s390/Kconfig~kconfigurable-resources-arch-changes-q-z 2006-05-05 12:00:08.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/s390/Kconfig 2006-05-05 12:00:08.000000000 -0400
@@ -218,6 +218,14 @@ config WARN_STACK_SIZE

source "mm/Kconfig"

+config RESOURCES_32BIT
+ bool "32 bit Memory and IO resources (EXPERIMENTAL)"
+ depends on EXPERIMENTAL
+ depends on !64BIT
+ help
+ By default resources are 64 bit. This option allows memory and IO
+ resources to be 32 bit to optimize code size.
+
comment "I/O subsystem configuration"

config MACHCHK_WARNING
diff -puN arch/sh64/kernel/pcibios.c~kconfigurable-resources-arch-changes-q-z arch/sh64/kernel/pcibios.c
--- linux-2.6.17-rc3-mm1-1M/arch/sh64/kernel/pcibios.c~kconfigurable-resources-arch-changes-q-z 2006-05-05 12:00:08.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/sh64/kernel/pcibios.c 2006-05-05 12:00:08.000000000 -0400
@@ -69,10 +69,10 @@ pcibios_update_resource(struct pci_dev *
* modulo 0x400.
*/
void pcibios_align_resource(void *data, struct resource *res,
- unsigned long size, unsigned long align)
+ resource_size_t size, resource_size_t align)
{
if (res->flags & IORESOURCE_IO) {
- unsigned long start = res->start;
+ resource_size_t start = res->start;

if (start & 0x300) {
start = (start + 0x3ff) & ~0x3ff;
diff -puN arch/sh/boards/mpc1211/pci.c~kconfigurable-resources-arch-changes-q-z arch/sh/boards/mpc1211/pci.c
--- linux-2.6.17-rc3-mm1-1M/arch/sh/boards/mpc1211/pci.c~kconfigurable-resources-arch-changes-q-z 2006-05-05 12:00:08.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/sh/boards/mpc1211/pci.c 2006-05-05 12:00:08.000000000 -0400
@@ -273,9 +273,9 @@ void __init pcibios_fixup_irqs(void)
}

void pcibios_align_resource(void *data, struct resource *res,
- unsigned long size, unsigned long align)
+ resource_size_t size, resource_size_t align)
{
- unsigned long start = res->start;
+ resource_size_t start = res->start;

if (res->flags & IORESOURCE_IO) {
if (start >= 0x10000UL) {
diff -puN arch/sh/boards/overdrive/galileo.c~kconfigurable-resources-arch-changes-q-z arch/sh/boards/overdrive/galileo.c
--- linux-2.6.17-rc3-mm1-1M/arch/sh/boards/overdrive/galileo.c~kconfigurable-resources-arch-changes-q-z 2006-05-05 12:00:08.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/sh/boards/overdrive/galileo.c 2006-05-05 12:00:08.000000000 -0400
@@ -536,7 +536,7 @@ void __init pcibios_fixup_bus(struct pci
}

void pcibios_align_resource(void *data, struct resource *res,
- unsigned long size)
+ resource_size_t size)
{
}

diff -puN arch/sh/drivers/pci/pci.c~kconfigurable-resources-arch-changes-q-z arch/sh/drivers/pci/pci.c
--- linux-2.6.17-rc3-mm1-1M/arch/sh/drivers/pci/pci.c~kconfigurable-resources-arch-changes-q-z 2006-05-05 12:00:08.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/sh/drivers/pci/pci.c 2006-05-05 12:00:08.000000000 -0400
@@ -75,7 +75,7 @@ pcibios_update_resource(struct pci_dev *
}

void pcibios_align_resource(void *data, struct resource *res,
- unsigned long size, unsigned long align)
+ resource_size_t size, resource_size_t align)
__attribute__ ((weak));

/*
@@ -85,10 +85,10 @@ void pcibios_align_resource(void *data,
* modulo 0x400.
*/
void pcibios_align_resource(void *data, struct resource *res,
- unsigned long size, unsigned long align)
+ resource_size_t size, resource_size_t align)
{
if (res->flags & IORESOURCE_IO) {
- unsigned long start = res->start;
+ resource_size_t start = res->start;

if (start & 0x300) {
start = (start + 0x3ff) & ~0x3ff;
diff -puN arch/sh/Kconfig~kconfigurable-resources-arch-changes-q-z arch/sh/Kconfig
--- linux-2.6.17-rc3-mm1-1M/arch/sh/Kconfig~kconfigurable-resources-arch-changes-q-z 2006-05-05 12:00:08.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/sh/Kconfig 2006-05-05 12:00:08.000000000 -0400
@@ -532,6 +532,13 @@ config NODES_SHIFT
default "1"
depends on NEED_MULTIPLE_NODES

+config RESOURCES_32BIT
+ bool "32 bit Memory and IO resources (EXPERIMENTAL)"
+ depends on EXPERIMENTAL
+ help
+ By default resources are 64 bit. This option allows memory and IO
+ resources to be 32 bit to optimize code size.
+
endmenu

menu "Boot options"
diff -puN arch/sparc64/kernel/pci.c~kconfigurable-resources-arch-changes-q-z arch/sparc64/kernel/pci.c
--- linux-2.6.17-rc3-mm1-1M/arch/sparc64/kernel/pci.c~kconfigurable-resources-arch-changes-q-z 2006-05-05 12:00:08.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/sparc64/kernel/pci.c 2006-05-05 12:00:08.000000000 -0400
@@ -388,7 +388,7 @@ void pcibios_update_irq(struct pci_dev *
}

void pcibios_align_resource(void *data, struct resource *res,
- unsigned long size, unsigned long align)
+ resource_size_t size, resource_size_t align)
{
}

diff -puN arch/sparc/Kconfig~kconfigurable-resources-arch-changes-q-z arch/sparc/Kconfig
--- linux-2.6.17-rc3-mm1-1M/arch/sparc/Kconfig~kconfigurable-resources-arch-changes-q-z 2006-05-05 12:00:08.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/sparc/Kconfig 2006-05-05 12:00:08.000000000 -0400
@@ -67,6 +67,13 @@ config SPARC32
maintains both the SPARC32 and SPARC64 ports; its web page is
available at <http://www.ultralinux.org/>.

+config RESOURCES_32BIT
+ bool "32 bit Memory and IO resources (EXPERIMENTAL)"
+ depends on EXPERIMENTAL
+ help
+ By default resources are 64 bit. This option allows memory and IO
+ resources to be 32 bit to optimize code size.
+
# Global things across all Sun machines.
config ISA
bool
diff -puN arch/sparc/kernel/pcic.c~kconfigurable-resources-arch-changes-q-z arch/sparc/kernel/pcic.c
--- linux-2.6.17-rc3-mm1-1M/arch/sparc/kernel/pcic.c~kconfigurable-resources-arch-changes-q-z 2006-05-05 12:00:08.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/sparc/kernel/pcic.c 2006-05-05 12:00:08.000000000 -0400
@@ -859,7 +859,7 @@ char * __init pcibios_setup(char *str)
}

void pcibios_align_resource(void *data, struct resource *res,
- u64 size, u64 align)
+ resource_size_t size, resource_size_t align)
{
}

diff -puN arch/v850/Kconfig~kconfigurable-resources-arch-changes-q-z arch/v850/Kconfig
--- linux-2.6.17-rc3-mm1-1M/arch/v850/Kconfig~kconfigurable-resources-arch-changes-q-z 2006-05-05 12:00:08.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/v850/Kconfig 2006-05-05 12:00:08.000000000 -0400
@@ -235,6 +235,13 @@ menu "Processor type and features"

source "mm/Kconfig"

+config RESOURCES_32BIT
+ bool "32 bit Memory and IO resources (EXPERIMENTAL)"
+ depends on EXPERIMENTAL
+ help
+ By default resources are 64 bit. This option allows memory and IO
+ resources to be 32 bit to optimize code size.
+
endmenu


diff -puN arch/v850/kernel/rte_mb_a_pci.c~kconfigurable-resources-arch-changes-q-z arch/v850/kernel/rte_mb_a_pci.c
--- linux-2.6.17-rc3-mm1-1M/arch/v850/kernel/rte_mb_a_pci.c~kconfigurable-resources-arch-changes-q-z 2006-05-05 12:00:08.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/v850/kernel/rte_mb_a_pci.c 2006-05-05 12:00:08.000000000 -0400
@@ -329,7 +329,7 @@ void pcibios_fixup_bus(struct pci_bus *b

void
pcibios_align_resource (void *data, struct resource *res,
- unsigned long size, unsigned long align)
+ resource_size_t size, resource_size_t align)
{
}

diff -puN arch/xtensa/Kconfig~kconfigurable-resources-arch-changes-q-z arch/xtensa/Kconfig
--- linux-2.6.17-rc3-mm1-1M/arch/xtensa/Kconfig~kconfigurable-resources-arch-changes-q-z 2006-05-05 12:00:08.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/xtensa/Kconfig 2006-05-05 12:00:08.000000000 -0400
@@ -99,6 +99,13 @@ config MATH_EMULATION
config HIGHMEM
bool "High memory support"

+config RESOURCES_32BIT
+ bool "32 bit Memory and IO resources (EXPERIMENTAL)"
+ depends on EXPERIMENTAL
+ help
+ By default resources are 64 bit. This option allows memory and IO
+ resources to be 32 bit to optimize code size.
+
endmenu

menu "Platform options"
diff -puN arch/xtensa/kernel/pci.c~kconfigurable-resources-arch-changes-q-z arch/xtensa/kernel/pci.c
--- linux-2.6.17-rc3-mm1-1M/arch/xtensa/kernel/pci.c~kconfigurable-resources-arch-changes-q-z 2006-05-05 12:00:08.000000000 -0400
+++ linux-2.6.17-rc3-mm1-1M-root/arch/xtensa/kernel/pci.c 2006-05-05 12:00:08.000000000 -0400
@@ -71,13 +71,13 @@ static int pci_bus_count;
* which might have be mirrored at 0x0100-0x03ff..
*/
void
-pcibios_align_resource(void *data, struct resource *res, unsigned long size,
- unsigned long align)
+pcibios_align_resource(void *data, struct resource *res, resource_size_t size,
+ resource_size_t align)
{
struct pci_dev *dev = data;

if (res->flags & IORESOURCE_IO) {
- unsigned long start = res->start;
+ resource_size_t start = res->start;

if (size > 0x100) {
printk(KERN_ERR "PCI: I/O Region %s/%d too large"
_

2006-05-05 18:11:40

by Greg KH

[permalink] [raw]
Subject: Re: [RFC][PATCH 1/6] kconfigurable resources core changes

On Fri, May 05, 2006 at 01:28:47PM -0400, Vivek Goyal wrote:
>
>
> o Core changes for Kconfigurable memory and IO resources. By default resources
> are 64bit until chosen to be 32bit.
>
> o Last time I posted the patches for 64bit memory resources but it raised
> the concerns regarding code bloat on 32bit systems who use 32 bit
> resources.
>
> o This patch-set allows resources to be kconfigurable.
>
> o I have done cross compilation on i386, x86_64, ppc, powerpc, sparc, sparc64
> ia64 and alpha.
>
> Signed-off-by: Vivek Goyal <[email protected]>

So do these replace all of your other patches sitting in my tree right
now?

thanks,

greg k-h

2006-05-05 18:36:11

by Vivek Goyal

[permalink] [raw]
Subject: Re: [RFC][PATCH 1/6] kconfigurable resources core changes

On Fri, May 05, 2006 at 11:10:02AM -0700, Greg KH wrote:
> On Fri, May 05, 2006 at 01:28:47PM -0400, Vivek Goyal wrote:
> >
> >
> > o Core changes for Kconfigurable memory and IO resources. By default resources
> > are 64bit until chosen to be 32bit.
> >
> > o Last time I posted the patches for 64bit memory resources but it raised
> > the concerns regarding code bloat on 32bit systems who use 32 bit
> > resources.
> >
> > o This patch-set allows resources to be kconfigurable.
> >
> > o I have done cross compilation on i386, x86_64, ppc, powerpc, sparc, sparc64
> > ia64 and alpha.
> >
> > Signed-off-by: Vivek Goyal <[email protected]>
>
> So do these replace all of your other patches sitting in my tree right
> now?
>

No. This patch set applies on top of the old patches.

Very few changes in the previous patches have been nullified, like
changing u64 to resource_size_t. There are lots of printk() statement
changes in previous patch set which are required to supress the compilation
warnings. That's the reason I kept new patches incremental.


2006-05-09 19:33:38

by Kumar Gala

[permalink] [raw]
Subject: Re: [RFC][PATCH 1/6] kconfigurable resources core changes


On May 5, 2006, at 12:28 PM, Vivek Goyal wrote:

>
>
> o Core changes for Kconfigurable memory and IO resources. By
> default resources
> are 64bit until chosen to be 32bit.
>
> o Last time I posted the patches for 64bit memory resources but it
> raised
> the concerns regarding code bloat on 32bit systems who use 32 bit
> resources.
>
> o This patch-set allows resources to be kconfigurable.
>
> o I have done cross compilation on i386, x86_64, ppc, powerpc,
> sparc, sparc64
> ia64 and alpha.
>
> Signed-off-by: Vivek Goyal <[email protected]>
> ---

[snip]

I didn't think the bloat was a big issue based on the numbers you
reported. I'd still prefer to see us just move to a 64-bit resource
on all systems.

- k

2006-05-09 20:03:12

by Vivek Goyal

[permalink] [raw]
Subject: Re: [RFC][PATCH 1/6] kconfigurable resources core changes

On Tue, May 09, 2006 at 02:33:48PM -0500, Kumar Gala wrote:
>
> On May 5, 2006, at 12:28 PM, Vivek Goyal wrote:
>
> >
> >
> >o Core changes for Kconfigurable memory and IO resources. By
> >default resources
> > are 64bit until chosen to be 32bit.
> >
> >o Last time I posted the patches for 64bit memory resources but it
> >raised
> > the concerns regarding code bloat on 32bit systems who use 32 bit
> > resources.
> >
> >o This patch-set allows resources to be kconfigurable.
> >
> >o I have done cross compilation on i386, x86_64, ppc, powerpc,
> >sparc, sparc64
> > ia64 and alpha.
> >
> >Signed-off-by: Vivek Goyal <[email protected]>
> >---
>
> [snip]
>
> I didn't think the bloat was a big issue based on the numbers you
> reported. I'd still prefer to see us just move to a 64-bit resource
> on all systems.

I had also thought that bloat was not a big issue but Andrew thinks
otherwise. Here is the link to the thread.

http://marc.theaimsgroup.com/?l=linux-kernel&m=114626907106986&w=2
http://marc.theaimsgroup.com/?l=linux-kernel&m=114635425606186&w=2

In the latest patches, 64bit resources are default but one can force
these to be 32bit.

Thanks
Vivek

2006-05-18 05:19:13

by Matthew Frost

[permalink] [raw]
Subject: Re: [RFC][PATCH 1/6] kconfigurable resources core changes

Vivek Goyal wrote:
> On Tue, May 09, 2006 at 02:33:48PM -0500, Kumar Gala wrote:
>> On May 5, 2006, at 12:28 PM, Vivek Goyal wrote:
>>
>>>
>>> o Core changes for Kconfigurable memory and IO resources. By
>>> default resources
>>> are 64bit until chosen to be 32bit.
>>>
>>> o Last time I posted the patches for 64bit memory resources but it
>>> raised
>>> the concerns regarding code bloat on 32bit systems who use 32 bit
>>> resources.
>>>
>>> o This patch-set allows resources to be kconfigurable.
>>>
>>> o I have done cross compilation on i386, x86_64, ppc, powerpc,
>>> sparc, sparc64
>>> ia64 and alpha.
>>>
>>> Signed-off-by: Vivek Goyal <[email protected]>
>>> ---
>> [snip]
>>
>> I didn't think the bloat was a big issue based on the numbers you
>> reported. I'd still prefer to see us just move to a 64-bit resource
>> on all systems.
>
> I had also thought that bloat was not a big issue but Andrew thinks
> otherwise. Here is the link to the thread.
>
> http://marc.theaimsgroup.com/?l=linux-kernel&m=114626907106986&w=2
> http://marc.theaimsgroup.com/?l=linux-kernel&m=114635425606186&w=2
>
> In the latest patches, 64bit resources are default but one can force
> these to be 32bit.
>

This may sound like a dumb question, but aside from code bloat, what are
the performance issues involved in running 64-bit resources on 32-bit
systems? AKA, does it kill us x86 users to not have this switch, and by
what kind of margin? You can point if it's been said and I just haven't
found it; I didn't see performance discussion in the last submission.

Thanks!
Matt

> Thanks
> Vivek
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>

2006-05-18 05:44:24

by Andrew Morton

[permalink] [raw]
Subject: Re: [RFC][PATCH 1/6] kconfigurable resources core changes

Matthew Frost <[email protected]> wrote:
>
> This may sound like a dumb question, but aside from code bloat, what are
> the performance issues involved in running 64-bit resources on 32-bit
> systems?

Unmeasurably minor, I expect.

No sane software project would take on this (small) maintenance burden just
to save 50-60 kbytes. We would though.

2006-05-18 06:13:32

by Matthew Frost

[permalink] [raw]
Subject: Re: [RFC][PATCH 1/6] kconfigurable resources core changes

Andrew Morton wrote:
> Matthew Frost <[email protected]> wrote:
>> This may sound like a dumb question, but aside from code bloat, what are
>> the performance issues involved in running 64-bit resources on 32-bit
>> systems?
>
> Unmeasurably minor, I expect.

Noted, with thanks.

>
> No sane software project would take on this (small) maintenance burden just
> to save 50-60 kbytes. We would though.

I'm aware of that, and I'm not complaining. :) It's one of the things
I love about this project. It's a healthy insanity, enforced by the
squeaking of the wheels. Besides, code bloat is cumulative.

Matt