Reworked 64bit resource patches
Subsystems (40)
Currently the -mm tree (and my pci quilt tree) has a series of patches that enable 64bit resource sizes. It was originally done by Vivek Goyal, and that work was based on something done by someone else before that (sorry, can't remember that far back anymore...)
Anyway, here's a rework of that series of patches. It drops the number of patches from 24 to 16, and enables the tree to build at any step along the way. It also doesn't change the same lines twice (as the old series did).
The end result is _identical_ to Vivek's patches, but will now play nicer when ending up in the main kernel git tree.
If anyone has any comments on these, please let me know.
thanks,
greg k-h
PATCH 1/16 64bit resource: C99 changes for struct resource declarations
From: Greg Kroah-Hartman <[email protected]>
Based on an original patch from Ralf Baechle <[email protected]> and Vivek Goyal <[email protected]>. This is needed in order to prepare for changing the size of resources.
--- arch/arm/kernel/setup.c | 42 ++++++++- arch/mips/au1000/common/pci.c | 16 ++- arch/mips/cobalt/setup.c | 41 +++++++-- arch/mips/ddb5xxx/ddb5476/setup.c | 37 +++++++- arch/mips/ite-boards/generic/it8172_setup.c | 74 +++++++++++++--- arch/mips/jmr3927/rbhma3100/setup.c | 59 ++++++++++--- arch/mips/pci/ops-it8172.c | 34 +++---- arch/mips/pci/pci-ddb5074.c | 16 ++- arch/mips/pci/pci-ddb5476.c | 16 ++- arch/mips/pci/pci-ddb5477.c | 32 +++---- arch/mips/pci/pci-jmr3927.c | 16 ++- arch/mips/pci/pci-ocelot.c | 8 +- arch/mips/pci/pci-yosemite.c | 10 ++ arch/mips/philips/pnx8550/common/pci.c | 16 ++- arch/mips/philips/pnx8550/common/setup.c | 25 +++++ arch/mips/sni/setup.c | 126 +++++++++++++++++++++++---- arch/mips/tx4938/toshiba_rbtx4938/setup.c | 5 + 17 files changed, 424 insertions(+), 149 deletions(-)
drivers/video/console/vgacon.c +6 -6
@@ -389,7 +389,7 @@ #endif 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 @@ #endif &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 @@ #endifif (!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 @@ #endif } }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" ;
arch/arm/kernel/setup.c +36 -6
54 lines not on this page · raw message
arch/mips/au1000/common/pci.c +8 -8
@@ -40,17 +40,17 @@ #include <asm/mach-au1x00/au1000.h>/* TBD */ static struct resource pci_io_resource = { -"pci IO space" , - (u32 )PCI_IO_START , - (u32 )PCI_IO_END , -IORESOURCE_IO + .start =PCI_IO_START , + .end =PCI_IO_END , + .name ="PCI IO space" , + .flags =IORESOURCE_IO };static struct resource pci_mem_resource = { -"pci memory space" , - (u32 )PCI_MEM_START , - (u32 )PCI_MEM_END , -IORESOURCE_MEM + .start =PCI_MEM_START , + .end =PCI_MEM_END , + .name ="PCI memory space" , + .flags =IORESOURCE_MEM };extern struct pci_ops au1x_pci_ops;
arch/mips/cobalt/setup.c +34 -7
53 lines not on this page · raw message
arch/mips/ddb5xxx/ddb5476/setup.c +31 -6
@@ -109,17 +109,42 @@ static struct {struct resource dma2; } ddb5476_ioport = { { - "dma1", 0x00, 0x1f, IORESOURCE_BUSY}, { - "timer", 0x40, 0x5f, IORESOURCE_BUSY}, { - "rtc", 0x70, 0x7f, IORESOURCE_BUSY}, { - "dma page reg", 0x80, 0x8f, IORESOURCE_BUSY}, { - "dma2", 0xc0, 0xdf, IORESOURCE_BUSY} + .start = 0x00, + .end = 0x1f, + .name = "dma1", + .flags =IORESOURCE_BUSY + }, { + .start = 0x40, + .end = 0x5f, + .name = "timer", + .flags =IORESOURCE_BUSY + }, { + .start = 0x70, + .end = 0x7f, + .name = "rtc", + .flags =IORESOURCE_BUSY + }, { + .start = 0x80, + .end = 0x8f, + .name = "dma page reg", + .flags =IORESOURCE_BUSY + }, { + .start = 0xc0, + .end = 0xdf, + .name = "dma2", + .flags = IORESOURCE_BUSY + } };static struct {struct resource nile4; } ddb5476_iomem = { - { "Nile 4", DDB_BASE, DDB_BASE + DDB_SIZE - 1, IORESOURCE_BUSY} + { + .start =DDB_BASE , + .end =DDB_BASE +DDB_SIZE -1 , + .name ="Nile 4" , + .flags =IORESOURCE_BUSY + } };
arch/mips/ite-boards/generic/it8172_setup.c +61 -13
86 lines not on this page · raw message
arch/mips/jmr3927/rbhma3100/setup.c +48 -11
65 lines not on this page · raw message
arch/mips/pci/ops-it8172.c +16 -18
@@ -50,30 +50,28 @@ #endifstatic struct resource pci_mem_resource_1;static struct resource pci_io_resource = { -"io pci IO space" , -0x14018000 , -0x17FFFFFF , -IORESOURCE_IO + .start =0x14018000 , + .end =0x17FFFFFF , + .name ="io pci IO space" , + .flags =IORESOURCE_IO };static struct resource pci_mem_resource_0 = { -"ext pci memory space 0/1" , -0x10101000 , -0x13FFFFFF , -IORESOURCE_MEM , - &pci_mem_resource_0, -NULL , - &pci_mem_resource_1 + .start =0x10101000 , + .end =0x13FFFFFF , + .name ="ext pci memory space 0/1" , + .flags =IORESOURCE_MEM , + .parent = &pci_mem_resource_0, + .sibling =NULL , + .child = &pci_mem_resource_1 };static struct resource pci_mem_resource_1 = { -"ext pci memory space 2/3" , -0x1A000000 , -0x1FBFFFFF , -IORESOURCE_MEM , - &pci_mem_resource_0, -NULL , -NULL + .start =0x1A000000 , + .end =0x1FBFFFFF , + .name ="ext pci memory space 2/3" , + .flags =IORESOURCE_MEM , + .parent = &pci_mem_resource_0 };extern struct pci_ops it8172_pci_ops;
arch/mips/pci/pci-ddb5074.c +8 -8
@@ -8,17 +8,17 @@ #include <asm/debug.h>#include <asm/ddb5xxx/ddb5xxx.h> static struct resource extpci_io_resource = { -"pci IO space" , -0x1000 ,/* leave some room for ISA bus */ -DDB_PCI_IO_SIZE -1 , -IORESOURCE_IO + .start =0x1000 ,/* leave some room for ISA bus */ + .end =DDB_PCI_IO_SIZE -1 , + .name ="pci IO space" , + .flags =IORESOURCE_IO };static struct resource extpci_mem_resource = { -"pci memory space" , -DDB_PCI_MEM_BASE +0x00100000 ,/* leave 1 MB for RTC */ -DDB_PCI_MEM_BASE +DDB_PCI_MEM_SIZE -1 , -IORESOURCE_MEM + .start =DDB_PCI_MEM_BASE +0x00100000 ,/* leave 1 MB for RTC */ + .end =DDB_PCI_MEM_BASE +DDB_PCI_MEM_SIZE -1 , + .name ="pci memory space" , + .flags =IORESOURCE_MEM };extern struct pci_ops ddb5476_ext_pci_ops;
arch/mips/pci/pci-ddb5476.c +8 -8
@@ -8,17 +8,17 @@ #include <asm/debug.h>#include <asm/ddb5xxx/ddb5xxx.h> static struct resource extpci_io_resource = { -"pci IO space" , -0x1000 ,/* leave some room for ISA bus */ -DDB_PCI_IO_SIZE -1 , -IORESOURCE_IO + .start =0x1000 ,/* leave some room for ISA bus */ + .end =DDB_PCI_IO_SIZE -1 , + .name ="pci IO space" , + .flags =IORESOURCE_IO };static struct resource extpci_mem_resource = { -"pci memory space" , -DDB_PCI_MEM_BASE +0x00100000 ,/* leave 1 MB for RTC */ -DDB_PCI_MEM_BASE +DDB_PCI_MEM_SIZE -1 , -IORESOURCE_MEM + .start =DDB_PCI_MEM_BASE +0x00100000 ,/* leave 1 MB for RTC */ + .end =DDB_PCI_MEM_BASE +DDB_PCI_MEM_SIZE -1 , + .name ="pci memory space" , + .flags =IORESOURCE_MEM };extern struct pci_ops ddb5476_ext_pci_ops;
arch/mips/pci/pci-ddb5477.c +16 -16
@@ -22,31 +22,31 @@ #include <asm/debug.h>#include <asm/ddb5xxx/ddb5xxx.h> static struct resource extpci_io_resource = { -"ext pci IO space" , -DDB_PCI0_IO_BASE -DDB_PCI_IO_BASE +0x4000 , -DDB_PCI0_IO_BASE -DDB_PCI_IO_BASE +DDB_PCI0_IO_SIZE -1 , -IORESOURCE_IO + .start =DDB_PCI0_IO_BASE -DDB_PCI_IO_BASE +0x4000 , + .end =DDB_PCI0_IO_BASE -DDB_PCI_IO_BASE +DDB_PCI0_IO_SIZE -1 , + .name ="ext pci IO space" , + .flags =IORESOURCE_IO };static struct resource extpci_mem_resource = { -"ext pci memory space" , -DDB_PCI0_MEM_BASE +0x100000 , -DDB_PCI0_MEM_BASE +DDB_PCI0_MEM_SIZE -1 , -IORESOURCE_MEM + .start =DDB_PCI0_MEM_BASE +0x100000 , + .end =DDB_PCI0_MEM_BASE +DDB_PCI0_MEM_SIZE -1 , + .name ="ext pci memory space" , + .flags =IORESOURCE_MEM };static struct resource iopci_io_resource = { -"io pci IO space" , -DDB_PCI1_IO_BASE -DDB_PCI_IO_BASE , -DDB_PCI1_IO_BASE -DDB_PCI_IO_BASE +DDB_PCI1_IO_SIZE -1 , -IORESOURCE_IO + .start =DDB_PCI1_IO_BASE -DDB_PCI_IO_BASE , + .end =DDB_PCI1_IO_BASE -DDB_PCI_IO_BASE +DDB_PCI1_IO_SIZE -1 , + .name ="io pci IO space" , + .flags =IORESOURCE_IO };static struct resource iopci_mem_resource = { -"ext pci memory space" , -DDB_PCI1_MEM_BASE , -DDB_PCI1_MEM_BASE +DDB_PCI1_MEM_SIZE -1 , -IORESOURCE_MEM + .start =DDB_PCI1_MEM_BASE , + .end =DDB_PCI1_MEM_BASE +DDB_PCI1_MEM_SIZE -1 , + .name ="ext pci memory space" , + .flags =IORESOURCE_MEM };extern struct pci_ops ddb5477_ext_pci_ops;
arch/mips/pci/pci-jmr3927.c +8 -8
@@ -35,17 +35,17 @@ #include <asm/jmr3927/jmr3927.h>#include <asm/debug.h> struct resource pci_io_resource = { -"IO MEM" , -0x1000 ,/* reserve regacy I/O space */ -0x1000 +JMR3927_PCIIO_SIZE -1 , -IORESOURCE_IO + .name ="IO MEM" , + .start =0x1000 ,/* reserve regacy I/O space */ + .end =0x1000 +JMR3927_PCIIO_SIZE -1 , + .flags =IORESOURCE_IO };struct resource pci_mem_resource = { -"PCI MEM" , -JMR3927_PCIMEM , -JMR3927_PCIMEM +JMR3927_PCIMEM_SIZE -1 , -IORESOURCE_MEM + .name ="PCI MEM" , + .start =JMR3927_PCIMEM , + .end =JMR3927_PCIMEM +JMR3927_PCIMEM_SIZE -1 , + .flags =IORESOURCE_MEM };extern struct pci_ops jmr3927_pci_ops;
arch/mips/pci/pci-ocelot.c +4 -4
@@ -71,13 +71,13 @@ static inline void pci0WriteConfigReg(un }static struct resource ocelot_mem_resource = { - iomem_resource.start = GT_PCI_MEM_BASE; - iomem_resource.end =GT_PCI_MEM_BASE +GT_PCI_MEM_BASE -1 ; + start = GT_PCI_MEM_BASE; + end =GT_PCI_MEM_BASE +GT_PCI_MEM_BASE -1 ; };static struct resource ocelot_io_resource = { - ioport_resource.start = GT_PCI_IO_BASE; - ioport_resource.end =GT_PCI_IO_BASE +GT_PCI_IO_SIZE -1 ; + start = GT_PCI_IO_BASE; + end =GT_PCI_IO_BASE +GT_PCI_IO_SIZE -1 ; }; static struct pci_controller ocelot_pci_controller = {
arch/mips/pci/pci-yosemite.c +8 -2
@@ -14,7 +14,10 @@ #include <asm/titan_dep.h>extern struct pci_ops titan_pci_ops;static struct resource py_mem_resource = { -"Titan PCI MEM" ,0xe0000000UL ,0xe3ffffffUL ,IORESOURCE_MEM + .start =0xe0000000UL , + .end =0xe3ffffffUL , + .name ="Titan PCI MEM" , + .flags =IORESOURCE_MEM };/*
@@ -26,7 +29,10 @@ #define TITAN_IO_SIZE 0x0000ffffUL#define TITAN_IO_BASE 0xe8000000ULstatic struct resource py_io_resource = { -"Titan IO MEM" ,0x00001000UL ,TITAN_IO_SIZE -1 ,IORESOURCE_IO , + .start =0x00001000UL , + .end =TITAN_IO_SIZE -1 , + .name ="Titan IO MEM" , + .flags =IORESOURCE_IO , };static struct pci_controller py_controller = {
arch/mips/philips/pnx8550/common/pci.c +8 -8
@@ -27,17 +27,17 @@ #include <glb.h>#include <nand.h> static struct resource pci_io_resource = { -"pci IO space" , - (u32)(PNX8550_PCIIO +0x1000 ),/* reserve regacy I/O space */ - (u32)(PNX8550_PCIIO +PNX8550_PCIIO_SIZE ), -IORESOURCE_IO + .start =PNX8550_PCIIO +0x1000 ,/* reserve regacy I/O space */ + .end =PNX8550_PCIIO +PNX8550_PCIIO_SIZE , + .name ="pci IO space" , + .flags =IORESOURCE_IO };static struct resource pci_mem_resource = { -"pci memory space" , - (u32)(PNX8550_PCIMEM ), - (u32)(PNX8550_PCIMEM +PNX8550_PCIMEM_SIZE -1 ), -IORESOURCE_MEM + .start =PNX8550_PCIMEM , + .end =PNX8550_PCIMEM +PNX8550_PCIMEM_SIZE -1 , + .name ="pci memory space" , + .flags =IORESOURCE_MEM };extern struct pci_ops pnx8550_pci_ops;
arch/mips/philips/pnx8550/common/setup.c +21 -4
@@ -58,10 +58,27 @@ extern void prom_printf(char *fmt, ...);extern char *prom_getcmdline (void );struct resource standard_io_resources[] = { - {"dma1" ,0x00 ,0x1f ,IORESOURCE_BUSY }, - {"timer" ,0x40 ,0x5f ,IORESOURCE_BUSY }, - {"dma page reg" ,0x80 ,0x8f ,IORESOURCE_BUSY }, - {"dma2" ,0xc0 ,0xdf ,IORESOURCE_BUSY }, + { + .start = .0x00, + .end =0x1f , + .name ="dma1" , + .flags =IORESOURCE_BUSY + }, { + .start =0x40 , + .end =0x5f , + .name ="timer" , + .flags =IORESOURCE_BUSY + }, { + .start =0x80 , + .end =0x8f , + .name ="dma page reg" , + .flags =IORESOURCE_BUSY + }, { + .start =0xc0 , + .end =0xdf , + .name ="dma2" , + .flags =IORESOURCE_BUSY + }, };#define STANDARD_IO_RESOURCES (sizeof(standard_io_resources)/sizeof(struct resource))
arch/mips/sni/setup.c +105 -21
144 lines not on this page · raw message
arch/mips/tx4938/toshiba_rbtx4938/setup.c +4 -1
@@ -664,7 +664,10 @@ static struct resource rbtx4938_fpga_resstatic char pcode_str[8 ];static struct resource tx4938_reg_resource = { - pcode_str,TX4938_REG_BASE ,TX4938_REG_BASE +TX4938_REG_SIZE ,IORESOURCE_MEM + .start =TX4938_REG_BASE , + .end =TX4938_REG_BASE +TX4938_REG_SIZE , + .name = pcode_str, + .flags =IORESOURCE_MEM };void __init tx4938_board_setup (void )
Signature · 1 line
1.4.0
PATCH 2/16 64bit resource: fix up printks for resources in sound drivers
From: Greg Kroah-Hartman <[email protected]>
This is needed if we wish to change the size of the resource structures.
Based on an original patch from Vivek Goyal <[email protected]>
--- 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/ppc/pmac.c | 14 ++++++++------ sound/sparc/cs4231.c | 4 ++-- sound/sparc/dbri.c | 5 +++-- 11 files changed, 35 insertions(+), 26 deletions(-)
sound/arm/aaci.c +3 -2
@@ -779,8 +779,9 @@ static struct aaci * __devinit aaci_initstrlcpy (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);
sound/drivers/mpu401/mpu401.c +3 -2
@@ -160,8 +160,9 @@ static int __devinit snd_mpu401_pnp(intreturn -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 );
sound/isa/es18xx.c +2 -1
@@ -2088,7 +2088,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);
sound/isa/gus/interwave.c +4 -4
@@ -611,10 +611,10 @@ #endifif (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 */
sound/isa/sb/sb16.c +2 -1
@@ -327,7 +327,8 @@ #ifdef SNDRV_SBAWE_EMU8000 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) {
sound/oss/forte.c +3 -2
@@ -2035,8 +2035,9 @@ forte_probe (struct pci_dev *pci_dev, copci_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 )
sound/pci/bt87x.c +3 -2
@@ -886,8 +886,9 @@ static int __devinit snd_bt87x_probe(strstrcpy (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);
sound/pci/sonicvibes.c +2 -2
@@ -1441,10 +1441,10 @@ static int __devinit snd_sonic_probe(strstrcpy (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 ) {
sound/ppc/pmac.c +8 -6
@@ -1198,9 +1198,10 @@ int __init snd_pmac_new(struct snd_card chip->rsrc[i].start + 1, rnames[i]) == NULL) {printk (KERN_ERR "snd: can't request rsrc " -" %d (%s: 0x%08lx:%08lx)\n" , - i, rnames[i], chip->rsrc[i].start, - chip->rsrc[i].end); +" %d (%s: 0x%016llx:%016llx)\n" , + i, rnames[i], + (unsigned long long )chip->rsrc[i].start, + (unsigned long long )chip->rsrc[i].end); err = -ENODEV ; goto __error; }
@@ -1229,9 +1230,10 @@ int __init snd_pmac_new(struct snd_card chip->rsrc[i].start + 1, rnames[i]) == NULL) {printk (KERN_ERR "snd: can't request rsrc " -" %d (%s: 0x%08lx:%08lx)\n" , - i, rnames[i], chip->rsrc[i].start, - chip->rsrc[i].end); +" %d (%s: 0x%016llx:%016llx)\n" , + i, rnames[i], + (unsigned long long )chip->rsrc[i].start, + (unsigned long long )chip->rsrc[i].end); err = -ENODEV ; goto __error; }
sound/sparc/cs4231.c +2 -2
@@ -2038,10 +2038,10 @@ static int __init cs4231_sbus_attach(strif (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 ) {
sound/sparc/dbri.c +3 -2
@@ -2645,9 +2645,10 @@ static int __init dbri_attach(int prom_nstrcpy (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);
Signature · 1 line
1.4.0
PATCH 3/16 64bit resource: fix up printks for resources in networks drivers
From: Greg Kroah-Hartman <[email protected]>
This is needed if we wish to change the size of the resource structures.
Based on an original patch from Vivek Goyal <[email protected]>
--- drivers/net/3c59x.c | 6 ++++-- drivers/net/8139cp.c | 9 +++++---- 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, 38 insertions(+), 33 deletions(-)
drivers/net/3c59x.c +4 -2
@@ -1413,8 +1413,10 @@ #endif }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 );
drivers/net/8139cp.c +5 -4
@@ -1728,8 +1728,8 @@ #endif }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; }
@@ -1761,8 +1761,9 @@ #endif 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;
drivers/net/8139too.c +3 -3
@@ -1341,9 +1341,9 @@ static int rtl8139_open (struct net_devinetif_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" );
drivers/net/e100.c +2 -2
@@ -2678,9 +2678,9 @@ #endif 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 ]);
drivers/net/skge.c +2 -2
@@ -3327,8 +3327,8 @@ #endifif (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 )
drivers/net/sky2.c +3 -3
@@ -3302,9 +3302,9 @@ #endifif (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);
drivers/net/tulip/de2104x.c +5 -4
@@ -2007,8 +2007,8 @@ #endif }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 @@ #endif 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;
drivers/net/tulip/tulip_core.c +3 -3
@@ -1350,10 +1350,10 @@ #endifSET_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; }
drivers/net/typhoon.c +3 -2
@@ -2568,9 +2568,10 @@ typhoon_init_one(struct pci_dev *pdev, cpci_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]);
drivers/net/wan/dscc4.c +6 -6
@@ -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 );
drivers/net/wan/pc300_drv.c +2 -2
@@ -3445,9 +3445,9 @@ #endif 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; }
Signature · 1 line
1.4.0
PATCH 4/16 64bit resource: fix up printks for resources in pci core and hotplug drivers
From: Greg Kroah-Hartman <[email protected]>
This is needed if we wish to change the size of the resource structures.
Based on an original patch from Vivek Goyal <[email protected]>
--- 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/proc.c | 16 +++++----------- drivers/pci/setup-bus.c | 6 ++++-- drivers/pci/setup-res.c | 28 +++++++++++++++++----------- 8 files changed, 55 insertions(+), 43 deletions(-)
drivers/pci/hotplug/cpcihp_zt5550.c +5 -4
@@ -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; }
drivers/pci/hotplug/cpqphp_core.c +5 -5
@@ -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; }
drivers/pci/hotplug/pciehp_hpc.c +3 -2
@@ -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);
drivers/pci/hotplug/shpchp_sysfs.c +12 -6
@@ -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" );
drivers/pci/pci.c +4 -2
@@ -680,10 +680,12 @@ int pci_request_region(struct pci_dev *preturn 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 ; }
drivers/pci/proc.c +5 -11
@@ -302,12 +302,6 @@ #endif /* HAVE_ARCH_PCI_GET_UNMAPPED_ARE#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)
drivers/pci/setup-bus.c +4 -2
@@ -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 ; }
drivers/pci/setup-res.c +17 -11
@@ -40,8 +40,9 @@ pci_update_resource(struct pci_dev *dev,pcibios_resource_to_bus (dev, ®ion, 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;
@@ -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); }
@@ -173,8 +178,9 @@ 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;
Signature · 1 line
1.4.0
PATCH 5/16 64bit resource: fix up printks for resources in mtd drivers
From: Greg Kroah-Hartman <[email protected]>
This is needed if we wish to change the size of the resource structures.
Based on an original patch from Vivek Goyal <[email protected]>
--- 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 ++++++---- 5 files changed, 19 insertions(+), 14 deletions(-)
drivers/mtd/devices/pmc551.c +4 -4
@@ -551,11 +551,11 @@ #ifdef CONFIG_MTD_PMC551_DEBUG/* * 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
drivers/mtd/maps/amd76xrom.c +3 -2
@@ -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
drivers/mtd/maps/ichxrom.c +3 -2
@@ -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. */
drivers/mtd/maps/scx200_docflash.c +3 -2
@@ -164,8 +164,9 @@ static int __init init_scx200_docflash(voutl (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 )
drivers/mtd/maps/sun_uflash.c +6 -4
@@ -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 [email protected]\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); }
Signature · 1 line
1.4.0
PATCH 6/16 64bit resource: fix up printks for resources in ide drivers
From: Greg Kroah-Hartman <[email protected]>
This is needed if we wish to change the size of the resource structures.
Based on an original patch from Vivek Goyal <[email protected]>
--- 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(-)
drivers/ide/pci/aec62xx.c +2 -1
@@ -254,7 +254,8 @@ static unsigned int __devinit init_chipsif (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 )
drivers/ide/pci/cmd64x.c +2 -1
@@ -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
drivers/ide/pci/hpt34x.c +1 -1
@@ -176,7 +176,7 @@ static unsigned int __devinit init_chipspci_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 {
drivers/ide/pci/pdc202xx_new.c +2 -2
@@ -313,8 +313,8 @@ static unsigned int __devinit init_chipsif (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
drivers/ide/pci/pdc202xx_old.c +2 -2
@@ -580,8 +580,8 @@ static unsigned int __devinit init_chipsif (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); }/*
Signature · 1 line
1.4.0
PATCH 7/16 64bit resource: fix up printks for resources in video drivers
From: Greg Kroah-Hartman <[email protected]>
This is needed if we wish to change the size of the resource structures.
Based on an original patch from Vivek Goyal <[email protected]>
--- drivers/media/video/bt8xx/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(-)
drivers/media/video/bt8xx/bttv-driver.c +6 -4
@@ -4019,8 +4019,9 @@ static int __devinit bttv_probe(struct pif (!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);
@@ -4031,8 +4032,9 @@ static int __devinit bttv_probe(struct ppci_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 );
drivers/media/video/cx88/cx88-alsa.c +4 -4
@@ -713,9 +713,9 @@ static int __devinit snd_cx88_create(strpci_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",
drivers/media/video/cx88/cx88-core.c +2 -2
@@ -1031,8 +1031,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 ; }
drivers/media/video/cx88/cx88-mpeg.c +2 -2
@@ -386,9 +386,9 @@ int cx8802_init_common(struct cx8802_devpci_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);
drivers/media/video/cx88/cx88-video.c +2 -2
@@ -1849,9 +1849,9 @@ static int __devinit cx8800_initdev(strupci_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 )) {
drivers/media/video/saa7134/saa7134-core.c +4 -4
@@ -871,9 +871,9 @@ #endifpci_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,DMA_32BIT_MASK )) {printk ("%s: Oops: no 32bit PCI DMA ???\n" ,dev->name);
@@ -905,8 +905,8 @@ #endif 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 );
Signature · 1 line
1.4.0
PATCH 8/16 64bit resource: fix up printks for resources in pcmcia drivers
From: Greg Kroah-Hartman <[email protected]>
This is needed if we wish to change the size of the resource structures.
Based on an original patch from Vivek Goyal <[email protected]>
--- drivers/pcmcia/i82365.c | 5 +++-- drivers/pcmcia/pd6729.c | 3 ++- drivers/pcmcia/rsrc_nonstatic.c | 12 ++++++++---- drivers/pcmcia/tcic.c | 5 +++-- 4 files changed, 16 insertions(+), 9 deletions(-)
drivers/pcmcia/i82365.c +3 -2
@@ -1084,9 +1084,10 @@ static int i365_set_mem_map(u_short socku_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) ||
drivers/pcmcia/pd6729.c +2 -1
@@ -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.
drivers/pcmcia/rsrc_nonstatic.c +8 -4
@@ -808,8 +808,10 @@ #endifif (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 +820,10 @@ #endifif (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 ; }
drivers/pcmcia/tcic.c +3 -2
@@ -756,8 +756,9 @@ static int tcic_set_mem_map(struct pcmciu_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 ))
Signature · 1 line
1.4.0
PATCH 9/16 64bit resource: fix up printks for resources in arch and core code
From: Greg Kroah-Hartman <[email protected]>
This is needed if we wish to change the size of the resource structures.
Based on an original patch from Vivek Goyal <[email protected]>
--- arch/i386/kernel/efi.c | 6 +++-- arch/powerpc/kernel/pci_32.c | 37 +++++++++++++++-------------- arch/powerpc/platforms/83xx/pci.c | 5 ++-- arch/powerpc/platforms/85xx/pci.c | 5 ++-- arch/powerpc/platforms/chrp/pci.c | 4 ++- arch/powerpc/platforms/maple/pci.c | 5 ++-- arch/powerpc/platforms/powermac/pci.c | 5 ++-- arch/ppc/kernel/pci.c | 42 ++++++++++++++++++++------------- arch/sparc/kernel/ioport.c | 4 ++- kernel/resource.c | 10 +++++--- 10 files changed, 71 insertions(+), 52 deletions(-)
arch/i386/kernel/efi.c +4 -2
@@ -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.
arch/powerpc/kernel/pci_32.c +19 -18
@@ -99,7 +99,7 @@ pcibios_fixup_resources(struct pci_dev *if (!res->flags)continue ;if (res->end ==0xffffffff ) { -DBG ("PCI:%s Resource %d [%08lx-%08lx] is unassigned\n" , +DBG ("PCI:%s Resource %d [%016llx-%016llx] is unassigned\n" ,pci_name (dev), i, res->start, res->end); res->end -= res->start; res->start =0 ;
@@ -117,7 +117,7 @@ pcibios_fixup_resources(struct pci_dev * res->start += offset; res->end += offset;#ifdef DEBUG -printk ("Fixup res %d (%lx) of dev %s: %lx -> %lx\n" , +printk ("Fixup res %d (%lx) of dev %s: %llx -> %llx\n" , i, res->flags,pci_name (dev), res->start - offset, res->start);#endif
@@ -183,7 +183,7 @@ void pcibios_align_resource(void *data,if (size >0x100 ) {printk (KERN_ERR "PCI: I/O Region %s/%d too large" -" (%ld bytes)\n" ,pci_name (dev), +" (%lld bytes)\n" ,pci_name (dev), dev->resource - res, size); }
@@ -255,8 +255,8 @@ 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" , + res->start, res->end, res->flags, pr);if (pr) {if (request_resource (pr, res) ==0 )continue ;
@@ -306,7 +306,7 @@ 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" , +DBG (KERN_INFO "PCI: reparented %s [%llx..%llx] under %s\n" , p->name, p->start, p->end, res->name); }return 0 ;
@@ -362,13 +362,14 @@ 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" , +DBG (KERN_ERR "PCI: huh? couldn't move to %llx..%llx\n" , res->start, 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 ; }
@@ -479,14 +480,14 @@ static inline void alloc_resource(struct {struct resource *pr, *r = &dev->resource[idx]; -DBG ("PCI:%s: Resource %d: %08lx-%08lx (f=%lx)\n" , +DBG ("PCI:%s: Resource %d: %016llx-%016llx (f=%lx)\n" ,pci_name (dev), idx, r->start, 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" , +DBG ("PCI: parent is %p: %016llx-%016llx (f=%lx)\n" , pr, pr->start, pr->end, pr->flags);/* We'll assign a new address later */ r->flags |=IORESOURCE_UNSET ;
@@ -956,7 +957,7 @@ pci_process_bridge_OF_ranges(struct pci_ res = &hose->io_resource; res->flags =IORESOURCE_IO ; res->start = ranges[2 ]; -DBG ("PCI: IO 0x%lx -> 0x%lx\n" , +DBG ("PCI: IO 0x%llx -> 0x%llx\n" , res->start, res->start + size -1 );break ;case 2 :/* memory space */
@@ -978,7 +979,7 @@ pci_process_bridge_OF_ranges(struct pci_if (ranges[0 ] &0x40000000 ) res->flags |=IORESOURCE_PREFETCH ; res->start = ranges[na+2 ]; -DBG ("PCI: MEM[%d] 0x%lx -> 0x%lx\n" , memno, +DBG ("PCI: MEM[%d] 0x%llx -> 0x%llx\n" , memno, res->start, res->start + size -1 ); }break ;
@@ -1074,7 +1075,7 @@ do_update_p2p_io_resource(struct pci_busDBG ("Remapping Bus %d, bridge: %s\n" , bus->number,pci_name (bridge)); res.start -= ((unsigned long ) hose->io_base_virt - isa_io_base); res.end -= ((unsigned long ) hose->io_base_virt - isa_io_base); -DBG (" IO window: %08lx-%08lx\n" , res.start, res.end); +DBG (" IO window: %016llx-%016llx\n" , res.start, res.end);/* Set up the top and bottom of the PCI I/O segment for this bus. */ pci_read_config_dword (bridge,PCI_IO_BASE , &l);
@@ -1222,8 +1223,8 @@ do_fixup_p2p_level(struct pci_bus *bus)continue ;if ((r->flags &IORESOURCE_IO ) ==0 )continue ; -DBG ("Trying to allocate from %08lx, size %08lx from parent" -" res %d: %08lx -> %08lx\n" , +DBG ("Trying to allocate from %016llx, size %016llx from parent" +" res %d: %016llx -> %016llx\n" , res->start, res->end, i, r->start, r->end); if (allocate_resource(r, res, res->end + 1, res->start, max,
@@ -1573,8 +1574,8 @@ static pgprot_t __pci_mmap_set_pgprot(stelse prot |= _PAGE_GUARDED; -printk ("PCI map for %s:%lx, prot: %lx\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); }
arch/powerpc/platforms/83xx/pci.c +3 -2
@@ -91,9 +91,10 @@ int __init add_bridge(struct device_node mpc83xx_pci2_busno = hose->first_busno; } -printk (KERN_INFO "Found MPC83xx PCI host bridge at 0x%08lx. " +printk (KERN_INFO "Found MPC83xx PCI host bridge at 0x%016llx. " "Firmware bus number: %d->%d\n" , - rsrc.start, hose->first_busno, hose->last_busno); + (unsigned long long )rsrc.start, hose->first_busno, + hose->last_busno);DBG (" ->Hose at 0x%p, cfg_addr=0x%p,cfg_data=0x%p\n" , hose, hose->cfg_addr, hose->cfg_data);
arch/powerpc/platforms/85xx/pci.c +3 -2
@@ -79,9 +79,10 @@ int __init add_bridge(struct device_node mpc85xx_pci2_busno = hose->first_busno; } -printk (KERN_INFO "Found MPC85xx PCI host bridge at 0x%08lx. " +printk (KERN_INFO "Found MPC85xx PCI host bridge at 0x%016llx. " "Firmware bus number: %d->%d\n" , - rsrc.start, hose->first_busno, hose->last_busno); + (unsigned long long )rsrc.start, hose->first_busno, + hose->last_busno);DBG (" ->Hose at 0x%p, cfg_addr=0x%p,cfg_data=0x%p\n" , hose, hose->cfg_addr, hose->cfg_data);
arch/powerpc/platforms/chrp/pci.c +2 -2
@@ -143,7 +143,7 @@ hydra_init(void)if (np ==NULL ||of_address_to_resource (np,0 , &r))return 0 ; Hydra =ioremap (r.start, r.end-r.start); -printk ("Hydra Mac I/O at %lx\n" , r.start); +printk ("Hydra Mac I/O at %llx\n" , (unsigned long long )r.start);printk ("Hydra Feature_Control was %x" ,in_le32 (&Hydra->Feature_Control)); out_le32(&Hydra->Feature_Control, (HYDRA_FC_SCC_CELL_EN |
@@ -267,7 +267,7 @@ chrp_find_bridges(void) bus_range[0], bus_range[1]);printk (" controlled by %s" , dev->type);if (!is_longtrail) -printk (" at %lx" , r.start); +printk (" at %llx" , (unsigned long long )r.start);printk ("\n" ); hose =pcibios_alloc_controller ();
arch/powerpc/platforms/maple/pci.c +3 -2
@@ -376,9 +376,10 @@ static void __init maple_fixup_phb_resouunsigned long offset = (unsigned long )hose->io_base_virt - pci_io_base; hose->io_resource.start += offset; hose->io_resource.end += offset; -printk (KERN_INFO "PCI Host %d, io start: %lx; io end: %lx\n" , +printk (KERN_INFO "PCI Host %d, io start: %llx; io end: %llx\n" , hose->global_number, - hose->io_resource.start, hose->io_resource.end); + (unsigned long long )hose->io_resource.start, + (unsigned long long )hose->io_resource.end); } }
arch/powerpc/platforms/powermac/pci.c +3 -2
@@ -939,9 +939,10 @@ #ifdef CONFIG_PPC32 disp_name ="Chaos" ; primary =0 ; } -printk (KERN_INFO "Found %s PCI host bridge at 0x%08lx. " +printk (KERN_INFO "Found %s PCI host bridge at 0x%016llx. " "Firmware bus number: %d->%d\n" , - disp_name, rsrc.start, hose->first_busno, hose->last_busno); + disp_name, (unsigned long long )rsrc.start, hose->first_busno, + hose->last_busno);#endif /* CONFIG_PPC32 */ DBG(" ->Hose at 0x%p, cfg_addr=0x%p,cfg_data=0x%p\n",
arch/ppc/kernel/pci.c +25 -17
92 lines not on this page · raw message
arch/sparc/kernel/ioport.c +3 -1
@@ -690,7 +690,9 @@ _sparc_io_get_info(char *buf, char **staif (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;
kernel/resource.c +6 -4
@@ -83,10 +83,10 @@ static int r_show(struct seq_file *m, vofor (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 ; }
@@ -511,7 +511,9 @@ void __release_region(struct resource *pwrite_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);
Signature · 1 line
1.4.0
PATCH 10/16 64bit resource: fix up printks for resources in misc drivers
From: Greg Kroah-Hartman <[email protected]>
This is needed if we wish to change the size of the resource structures.
Based on an original patch from Vivek Goyal <[email protected]>
--- 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 | 15 ++++++++------- drivers/infiniband/hw/ipath/ipath_driver.c | 8 ++++---- drivers/infiniband/hw/mthca/mthca_main.c | 5 +++-- drivers/input/serio/ct82c710.c | 6 +++--- drivers/isdn/hisax/telespci.c | 5 +++-- drivers/macintosh/macio_asic.c | 4 ++-- drivers/message/i2o/iop.c | 14 ++++++++------ drivers/mmc/mmci.c | 4 ++-- drivers/scsi/sata_via.c | 8 ++++---- 14 files changed, 54 insertions(+), 42 deletions(-)
drivers/amba/bus.c +3 -2
@@ -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%016lx\n" , + (unsigned long long )dev->res.start, (unsigned long long )dev->res.end, + dev->res.flags);/** * amba_device_register - register an AMBA device
drivers/atm/ambassador.c +2 -1
@@ -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
drivers/atm/firestream.c +3 -2
@@ -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));
drivers/block/sx8.c +3 -2
@@ -1694,9 +1694,10 @@ #endifDPRINTK ("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);
drivers/char/applicom.c +6 -3
@@ -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 );
drivers/ieee1394/ohci1394.c +8 -7
@@ -592,11 +592,11 @@ #elsesprintf (irq_buf,"%s" ,__irq_itoa (ohci->dev->irq));#endif 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);
@@ -3263,15 +3263,16 @@ #endif* 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 ) -KERN_WARNING ,"PCI resource length of %lx too small!" , -pci_resource_len (dev,0 )); +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 ;
drivers/infiniband/hw/ipath/ipath_driver.c +4 -4
@@ -460,10 +460,10 @@ static int __devinit ipath_init_one(strufor (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) {
drivers/infiniband/hw/mthca/mthca_main.c +3 -2
@@ -172,8 +172,9 @@ static int __devinit mthca_dev_lim(strucif (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 ; }
drivers/input/serio/ct82c710.c +3 -3
@@ -189,7 +189,7 @@ static int __devinit ct82c710_probe(strustrlcpy (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 ;
drivers/isdn/hisax/telespci.c +3 -2
@@ -311,8 +311,9 @@ #ifdef CONFIG_PCI } 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 );
drivers/macintosh/macio_asic.c +2 -2
@@ -428,10 +428,10 @@ #endif/* MacIO itself has a different reg, we use it's PCI base */ if (np == chip->of_node) { - sprintf(dev->ofdev.dev.bus_id, "%1d.%08lx:%.*s", + sprintf(dev->ofdev.dev.bus_id, "%1d.%016llx:%.*s", chip->lbus.index, #ifdef CONFIG_PCI - pci_resource_start(chip->lbus.pdev, 0), + (unsigned long long)pci_resource_start(chip->lbus.pdev, 0), #else 0, /* NuBus may want to do something better here */#endif
drivers/message/i2o/iop.c +8 -6
@@ -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); } }
drivers/mmc/mmci.c +2 -2
@@ -546,9 +546,9 @@ static int mmci_probe(struct amba_devicemmc_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;
drivers/scsi/sata_via.c +4 -4
@@ -333,10 +333,10 @@ static int svia_init_one (struct pci_devif ((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; }
Signature · 1 line
1.4.0
PATCH 11/16 64bit resource: introduce resource_size_t for the start and end of struct resource
From: Greg Kroah-Hartman <[email protected]>
But do not change it from what it currently is (unsigned long)
Based on a patch series originally from Vivek Goyal <[email protected]>
--- include/linux/ioport.h | 4 +++- include/linux/types.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletions(-)
include/linux/ioport.h +3 -1
@@ -9,13 +9,15 @@ #ifndef _LINUX_IOPORT_H#define _LINUX_IOPORT_H#include <linux/compiler.h> +#include <linux/types.h> /* * Resources are tree-like, allowing * nesting etc.. */ struct resource { +resource_size_t start; +resource_size_t end;const char *name; -unsigned long start, end;unsigned long flags;struct resource *parent, *sibling, *child; };
include/linux/types.h +2 -0
@@ -178,6 +178,8 @@ #endif#ifdef __KERNEL__typedef unsigned __bitwise__ gfp_t ; + +typedef unsigned long resource_size_t ;#endif struct ustat {
Signature · 1 line
1.4.0
PATCH 12/16 64bit resource: change resource core to use resource_size_t
From: Greg Kroah-Hartman <[email protected]>
Based on a patch series originally from Vivek Goyal <[email protected]>
--- arch/sparc/kernel/ioport.c | 4 ++-- include/linux/ioport.h | 23 +++++++++++++---------- kernel/resource.c | 34 ++++++++++++++++++---------------- 3 files changed, 33 insertions(+), 28 deletions(-)
arch/sparc/kernel/ioport.c +2 -2
@@ -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); }/*
@@ -279,7 +279,7 @@ void *sbus_alloc_consistent(struct sbus_ res->name = sdev->prom_name; } -return (void *)res->start; +return (void *)(unsigned long )res->start; err_noiommu:release_resource (res);
include/linux/ioport.h +13 -10
@@ -98,31 +98,34 @@ extern struct resource * ____request_resextern 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, +resource_size_t size,resource_size_t min, +resource_size_t max,resource_size_t align,void (*alignf)(void *,struct resource *, -unsigned long ,unsigned long ), +resource_size_t ,resource_size_t ),void *alignf_data); -int adjust_resource (struct resource *res,unsigned long start, -unsigned long size); +int adjust_resource (struct resource *res,resource_size_t start, +resource_size_t 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 *, +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 *,unsigned long ,unsigned long ); -extern void __release_region (struct resource *,unsigned long ,unsigned long ); +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 (unsigned long s,unsigned long n) +static inline int __deprecated check_region (resource_size_t s, +resource_size_t n) {return __check_region (&ioport_resource, s, n); }
kernel/resource.c +18 -16
@@ -151,8 +151,8 @@ #endif /* CONFIG_PROC_FS *//* 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; +resource_size_t start = new->start; +resource_size_t end = new->end;struct resource *tmp, **p;if (end < start)
@@ -236,11 +236,10 @@ 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, +resource_size_t size,resource_size_t min, +resource_size_t max,resource_size_t align,void (*alignf)(void *,struct resource *, -unsigned long ,unsigned long ), +resource_size_t ,resource_size_t ),void *alignf_data) {struct resource *this = root->child;
@@ -282,11 +281,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, -unsigned long size, -unsigned long min,unsigned long max, -unsigned long align, +resource_size_t size,resource_size_t min, +resource_size_t max,resource_size_t align,void (*alignf)(void *,struct resource *, -unsigned long ,unsigned long ), +resource_size_t ,resource_size_t ),void *alignf_data) {int err;
@@ -378,10 +376,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,resource_size_t start,resource_size_t size) {struct resource *tmp, *parent = res->parent; -unsigned long end = start + size -1 ; +resource_size_t end = start + size -1 ;int result = -EBUSY ;write_lock (&resource_lock);
@@ -428,7 +426,9 @@ 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, +resource_size_t start,resource_size_t n, +const char *name) {struct resource *res =kzalloc (sizeof (*res),GFP_KERNEL );
@@ -464,7 +464,8 @@ struct resource * __request_region(strucEXPORT_SYMBOL (__request_region); -int __check_region (struct resource *parent,unsigned long start,unsigned long n) +int __check_region (struct resource *parent,resource_size_t start, +resource_size_t n) {struct resource * res;
@@ -479,10 +480,11 @@ int __check_region(struct resource *pareEXPORT_SYMBOL (__check_region); -void __release_region (struct resource *parent,unsigned long start,unsigned long n) +void __release_region (struct resource *parent,resource_size_t start, +resource_size_t n) {struct resource **p; -unsigned long end; +resource_size_t end; p = &parent->child; end = start + n -1 ;
Signature · 1 line
1.4.0
PATCH 15/16 64bit resource: change pci core and arch code to use resource_size_t
From: Greg Kroah-Hartman <[email protected]>
Based on a patch series originally from Vivek Goyal <[email protected]>
--- arch/alpha/kernel/pci.c | 4 ++-- arch/arm/kernel/bios32.c | 6 +++--- arch/cris/arch-v32/drivers/pci/bios.c | 4 ++-- arch/frv/mb93090-mb00/pci-frv.c | 4 ++-- arch/i386/pci/i386.c | 4 ++-- arch/ia64/pci/pci.c | 2 +- arch/m68knommu/kernel/comempci.c | 3 ++- arch/mips/pci/pci.c | 4 ++-- arch/mips/pmc-sierra/yosemite/ht.c | 4 ++-- arch/parisc/kernel/pci.c | 2 +- arch/powerpc/kernel/pci_32.c | 22 +++++++++++++++------- arch/powerpc/kernel/pci_64.c | 4 ++-- arch/ppc/kernel/pci.c | 12 ++++++------ 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/kernel/pcic.c | 2 +- arch/sparc64/kernel/pci.c | 2 +- arch/v850/kernel/rte_mb_a_pci.c | 2 +- arch/xtensa/kernel/pci.c | 6 +++--- drivers/pci/bus.c | 10 +++++----- drivers/pci/pci-sysfs.c | 4 ++-- drivers/pci/pci.h | 6 +++--- drivers/pci/proc.c | 4 ++-- drivers/pci/rom.c | 10 +++++----- drivers/pci/setup-res.c | 6 +++--- include/asm-arm/mach/pci.h | 2 +- include/asm-powerpc/pci.h | 2 +- include/asm-ppc/pci.h | 2 +- include/linux/pci.h | 13 +++++++------ 31 files changed, 86 insertions(+), 76 deletions(-)
arch/alpha/kernel/pci.c +2 -2
@@ -124,12 +124,12 @@ #define GB (1024*MB)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 */
arch/arm/kernel/bios32.c +3 -3
@@ -304,7 +304,7 @@ static inline int pdev_bad_for_parity(ststatic void __devinit pdev_fixup_device_resources (struct pci_sys_data *root,struct pci_dev *dev) { -unsigned long 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, -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 && start &0x300 ) start = (start +0x3ff ) & ~0x3ff ;
arch/cris/arch-v32/drivers/pci/bios.c +2 -2
@@ -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 ;
arch/frv/mb93090-mb00/pci-frv.c +2 -2
@@ -64,10 +64,10 @@ #endif*/ 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 ;
arch/i386/pci/i386.c +2 -2
@@ -48,10 +48,10 @@ #include "pci.h"*/ 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 ;
arch/ia64/pci/pci.c +1 -1
@@ -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) { }
arch/m68knommu/kernel/comempci.c +2 -1
@@ -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) { }
arch/mips/pci/pci.c +2 -2
@@ -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 */
arch/mips/pmc-sierra/yosemite/ht.c +2 -2
@@ -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
arch/parisc/kernel/pci.c +1 -1
@@ -289,7 +289,7 @@ #endif* 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;
arch/powerpc/kernel/pci_32.c +15 -7
@@ -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,unsigned long size, -unsigned long 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 ) { -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" " (%lld bytes)\n" ,pci_name (dev), - dev->resource - res, size); + dev->resource - res, (unsigned long long )size); }if (start &0x300 ) {
@@ -1114,8 +1114,16 @@ check_for_io_childs(struct pci_bus *bus,int i;int rc =0 ; -#define push_end (res, size) do { unsigned long __sz = (size) ; \ - res->end = ((res->end + __sz) / (__sz + 1)) * (__sz + 1) + __sz; \ +/* +* Assuming mask is a power of two - 1, push_end +* moves res->end to the end of the next +* mask-aligned boundary. +* e.g. res->end of 0x1fff moves to 0x2fff +*/ +#define push_end (res, mask) do { \ + BUG_ON(((mask+1) & mask) != 0); \ + res->end = -(-res->end & ~(unsigned long)mask); \ + res->end += mask; \ } while (0)list_for_each_entry (dev, &bus->devices, bus_list) {
@@ -1756,7 +1764,7 @@ #endif /* CONFIG_PPC_PMAC */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 ;
arch/powerpc/kernel/pci_64.c +2 -2
@@ -146,11 +146,11 @@ #endif* 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 ) {
arch/ppc/kernel/pci.c +6 -6
@@ -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,unsigned long size, -unsigned long 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 ) { -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"
@@ -960,8 +960,8 @@ static pgprot_t __pci_mmap_set_pgprot(stelse 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, unvoid 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 ;
arch/sh/boards/mpc1211/pci.c +2 -2
@@ -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 ) {
arch/sh/boards/overdrive/galileo.c +1 -1
@@ -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) { }
arch/sh/drivers/pci/pci.c +3 -3
@@ -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 ;
arch/sh64/kernel/pcibios.c +2 -2
@@ -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 ;
arch/sparc/kernel/pcic.c +1 -1
@@ -859,7 +859,7 @@ char * __init pcibios_setup(char *str) }void pcibios_align_resource (void *data,struct resource *res, -unsigned long size,unsigned long align) +resource_size_t size,resource_size_t align) { }
arch/sparc64/kernel/pci.c +1 -1
@@ -390,7 +390,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) { }
arch/v850/kernel/rte_mb_a_pci.c +1 -1
@@ -329,7 +329,7 @@ void pcibios_fixup_bus(struct pci_bus *bvoid pcibios_align_resource (void *data,struct resource *res, -unsigned long size,unsigned long align) +resource_size_t size,resource_size_t align) { }
arch/xtensa/kernel/pci.c +3 -3
@@ -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"
drivers/pci/bus.c +5 -5
@@ -34,11 +34,11 @@ #include "pci.h"*/ 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, -void (*alignf)(void *,struct resource *, -unsigned long ,unsigned long ), -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 ;
drivers/pci/pci-sysfs.c +2 -2
@@ -64,7 +64,7 @@ resource_show(struct device * dev, strucchar * str = buf;int i;int max =7 ; -u64 start, end; +resource_size_t start, end;if (pci_dev->subordinate) max =DEVICE_COUNT_RESOURCE ;
@@ -320,7 +320,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++)
drivers/pci/pci.h +3 -3
@@ -6,10 +6,10 @@ extern int pci_create_sysfs_dev_files(stextern 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, +resource_size_t size,resource_size_t align, +resource_size_t min,unsigned int type_mask,void (*alignf)(void *,struct resource *, -unsigned long ,unsigned long ), +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);
drivers/pci/proc.c +2 -2
@@ -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 ?
drivers/pci/rom.c +5 -5
@@ -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 pcreturn 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 ;
drivers/pci/setup-res.c +3 -3
@@ -121,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; +resource_size_t size, min, align;int ret; size = res->end - res->start +1 ;
@@ -169,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; +resource_size_t r_align; r = &dev->resource[i]; r_align = r->end - r->start;
@@ -185,7 +185,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) { -unsigned long align =0 ; +resource_size_t align =0 ;struct resource_list *ln = list->next;int idx;
include/asm-arm/mach/pci.h +1 -1
@@ -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 */
include/asm-powerpc/pci.h +1 -1
@@ -242,7 +242,7 @@ #if defined(CONFIG_PPC_MULTIPLATFORM) ||#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__ */
include/asm-ppc/pci.h +1 -1
@@ -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__ */
include/linux/pci.h +7 -6
@@ -402,8 +402,8 @@ int pcibios_enable_device(struct pci_devchar *pcibios_setup (char *str);/* Used only when drivers/pci/setup.c is used */ -void pcibios_align_resource (void *,struct resource *, -unsigned long ,unsigned long ); +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 */
@@ -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, +resource_size_t size,resource_size_t align, +resource_size_t min,unsigned int type_mask,void (*alignf)(void *,struct resource *, -unsigned long ,unsigned long ), +resource_size_t ,resource_size_t ),void *alignf_data);void pci_enable_bridges (struct pci_bus *bus);
@@ -725,7 +725,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;
Signature · 1 line
1.4.0
PATCH 14/16 64bit resource: change pnp core to use resource_size_t
From: Greg Kroah-Hartman <[email protected]>
Based on a patch series originally from Vivek Goyal <[email protected]>
--- drivers/pnp/interface.c | 8 ++++---- drivers/pnp/manager.c | 15 ++++++++++----- drivers/pnp/resource.c | 8 ++++---- include/linux/pnp.h | 7 +++++-- 4 files changed, 23 insertions(+), 15 deletions(-)
drivers/pnp/interface.c +4 -4
@@ -264,7 +264,7 @@ static ssize_t pnp_show_current_resourceif (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 @@ static ssize_t pnp_show_current_resourceif (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 @@ static ssize_t pnp_show_current_resourceif (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 @@ static ssize_t pnp_show_current_resourceif (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)); } }
drivers/pnp/manager.c +10 -5
@@ -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; +resource_size_t *start, *end; +unsigned long *flags;if (!dev || !rule)return -EINVAL ;
@@ -63,7 +64,8 @@ static int pnp_assign_port(struct pnp_destatic int pnp_assign_mem (struct pnp_dev *dev,struct pnp_mem *rule,int idx) { -unsigned long *start, *end, *flags; +resource_size_t *start, *end; +unsigned long *flags;if (!dev || !rule)return -EINVAL ;
@@ -116,7 +118,8 @@ static int pnp_assign_mem(struct pnp_devstatic int pnp_assign_irq (struct pnp_dev * dev,struct pnp_irq *rule,int idx) { -unsigned long *start, *end, *flags; +resource_size_t *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_devstatic int pnp_assign_dma (struct pnp_dev *dev,struct pnp_dma *rule,int idx) { -unsigned long *start, *end, *flags; +resource_size_t *start, *end; +unsigned long *flags;int i;/* DMA priority: this table is good for i386 */
@@ -582,7 +586,8 @@ 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,resource_size_t start, +resource_size_t size) {if (resource ==NULL )return ;
drivers/pnp/resource.c +4 -4
@@ -241,7 +241,7 @@ int pnp_check_port(struct pnp_dev * dev, {int tmp;struct pnp_dev *tdev; -unsigned long *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; -unsigned long *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; -unsigned long * 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; -unsigned long * 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))
include/linux/pnp.h +5 -2
@@ -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,unsigned long start,unsigned long 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 pstatic 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, +resource_size_t start, +resource_size_t size) { }/* protocol helpers */ static inline int pnp_is_active (struct pnp_dev * dev) {return 0 ; }
Signature · 1 line
1.4.0
PATCH 15/16 64bit Resource: convert a few remaining drivers to use resource_size_t where needed
From: Greg Kroah-Hartman <[email protected]>
Based on a patch series originally from Vivek Goyal <[email protected]>
--- drivers/ieee1394/ohci1394.c | 2 +- drivers/isdn/hisax/hfc_pci.c | 2 +- drivers/net/8139cp.c | 2 +- drivers/pcmcia/rsrc_nonstatic.c | 14 +++++++------- drivers/serial/8250_pci.c | 4 ++-- drivers/usb/host/sl811-hcd.c | 10 +++++++--- 6 files changed, 19 insertions(+), 15 deletions(-)
drivers/ieee1394/ohci1394.c +1 -1
@@ -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; +resource_size_t ohci_base;if (pci_enable_device (dev))FAIL (-ENXIO ,"Failed to enable OHCI hardware" );
drivers/isdn/hisax/hfc_pci.c +1 -1
@@ -1688,7 +1688,7 @@ #ifdef CONFIG_PCIprintk (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" );
drivers/net/8139cp.c +1 -1
@@ -1668,7 +1668,7 @@ static int cp_init_one (struct pci_dev *struct cp_private *cp;int rc;void __iomem *regs; -long pciaddr; +resource_size_t pciaddr;unsigned int addr_len, i, pci_using_dac;u8 pci_rev;
drivers/pcmcia/rsrc_nonstatic.c +7 -7
@@ -72,7 +72,7 @@ #define MEM_PROBE_HIGH (1 << 1)======================================================================*/ static struct resource * -make_resource (unsigned long b,unsigned long 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,8 +86,8 @@ 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,resource_size_t base, +resource_size_t size,int type,char *name) {struct resource *res, *parent;
@@ -519,10 +519,10 @@ struct pcmcia_align_data {static void pcmcia_common_align (void *align_data,struct resource *res, -unsigned long size,unsigned long align) +resource_size_t size,resource_size_t align) {struct pcmcia_align_data *data = align_data; -unsigned long start; +resource_size_t start;/* * Ensure that we have the correct start address */
@@ -533,8 +533,8 @@ 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,resource_size_t size, +resource_size_t align) {struct pcmcia_align_data *data = align_data;struct resource_map *m;
drivers/serial/8250_pci.c +2 -2
@@ -594,8 +594,8 @@ pci_default_setup(struct serial_privateelse 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 ;
drivers/usb/host/sl811-hcd.c +7 -3
@@ -1684,9 +1684,13 @@ sl811h_probe(struct platform_device *devif (!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 ) {
Signature · 1 line
1.4.0
PATCH 16/16 64bit Resource: finally enable 64bit resource sizes
From: Greg Kroah-Hartman <[email protected]>
Introduce the Kconfig entry and actually switch to a 64bit value, if wanted, for resource_size_t.
Based on a patch series originally from Vivek Goyal <[email protected]>
--- arch/arm/Kconfig | 7 +++++++ arch/arm26/Kconfig | 7 +++++++ arch/cris/Kconfig | 7 +++++++ arch/frv/Kconfig | 7 +++++++ arch/i386/Kconfig | 7 +++++++ arch/m32r/Kconfig | 7 +++++++ arch/m68k/Kconfig | 7 +++++++ arch/m68knommu/Kconfig | 7 +++++++ arch/mips/Kconfig | 8 ++++++++ arch/parisc/Kconfig | 8 ++++++++ arch/powerpc/Kconfig | 8 ++++++++ arch/ppc/Kconfig | 7 +++++++ arch/s390/Kconfig | 8 ++++++++ arch/sh/Kconfig | 7 +++++++ arch/sparc/Kconfig | 7 +++++++ arch/v850/Kconfig | 7 +++++++ arch/xtensa/Kconfig | 7 +++++++ include/linux/types.h | 7 ++++++- kernel/resource.c | 11 ++++++++++- 19 files changed, 139 insertions(+), 2 deletions(-)
arch/arm/Kconfig +7 -0
@@ -518,6 +518,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 || \
arch/arm26/Kconfig +7 -0
@@ -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"
arch/cris/Kconfig +7 -0
@@ -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"
arch/frv/Kconfig +7 -0
@@ -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
arch/i386/Kconfig +7 -0
@@ -754,6 +754,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 && !X86_PAE + 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
arch/m32r/Kconfig +7 -0
@@ -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
arch/m68k/Kconfig +7 -0
@@ -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"
arch/m68knommu/Kconfig +7 -0
@@ -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
arch/mips/Kconfig +8 -0
@@ -1653,6 +1653,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
arch/parisc/Kconfig +8 -0
@@ -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
arch/powerpc/Kconfig +8 -0
@@ -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
arch/ppc/Kconfig +7 -0
@@ -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
arch/s390/Kconfig +8 -0
@@ -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
arch/sh/Kconfig +7 -0
@@ -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"
arch/sparc/Kconfig +7 -0
@@ -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
arch/v850/Kconfig +7 -0
@@ -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
arch/xtensa/Kconfig +7 -0
@@ -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"
include/linux/types.h +6 -1
@@ -179,9 +179,14 @@ #endif#ifdef __KERNEL__typedef unsigned __bitwise__ gfp_t ; -typedef unsigned long resource_size_t ; +#ifdef CONFIG_RESOURCES_32BIT +typedef __u32 resource_size_t ; +#else +typedef __u64 resource_size_t ;#endif +#endif /* __KERNEL__ */ +struct ustat {__kernel_daddr_t f_tfree;__kernel_ino_t f_tinode;
kernel/resource.c +10 -1
@@ -23,7 +23,11 @@ #include <asm/io.h>struct resource ioport_resource = { .name ="PCI IO" , - .start =0x0000 , +#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 , };
Signature · 1 line
1.4.0
Geert Uytterhoeven
maintainerRe: [PATCH 16/16] 64bit Resource: finally enable 64bit resource sizes
Quoted 11 lines · Greg KH
From: Greg Kroah-Hartman <[email protected]>
Introduce the
Kconfigentry and actually switch to a 64bit value, if wanted, forresource_size_t.arch/m68k/Kconfig +0
-0@@ -368,6 +368,13 @@ config 060_WRITETHROUGH
arch/m68k/Kconfig config 060_WRITETHROUGH · line 378
Quoted 10 lines
arch/m68k/Kconfig +7
-0source "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
Why is the default 64 bit? Because 32 bit became experimental?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Re: [PATCH 16/16] 64bit Resource: finally enable 64bit resource sizes
Quoted 14 lines · Geert Uytterhoeven
Quoted 13 lines · Greg KH
From: Greg Kroah-Hartman <[email protected]>
Introduce the
Kconfigentry and actually switch to a 64bit value, if wanted, forresource_size_t.arch/m68k/Kconfig +0
-0@@ -368,6 +368,13 @@ config 060_WRITETHROUGH source "mm/Kconfig"
Quoted 10 lines
arch/m68k/Kconfig config 060_WRITETHROUGH · line 378
Quoted 8 lines
arch/m68k/Kconfig +7
-0+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. + endmenuWhy is the default 64 bit? Because 32 bit became experimental?
That's a really good question. Vivek, why did you change it to be this way? In thinking about it some more, this should be a 64bit option instead.
thanks,
greg k-h
Re: [PATCH 16/16] 64bit Resource: finally enable 64bit resource sizes
Quoted 26 lines · Greg KH
Quoted 14 lines · Geert Uytterhoeven
Quoted 13 lines · Greg KH
From: Greg Kroah-Hartman <[email protected]>
Introduce the
Kconfigentry and actually switch to a 64bit value, if wanted, forresource_size_t.arch/m68k/Kconfig +0
-0@@ -368,6 +368,13 @@ config 060_WRITETHROUGH source "mm/Kconfig"Quoted 10 lines
arch/m68k/Kconfig config 060_WRITETHROUGH · line 378
Quoted 8 lines
arch/m68k/Kconfig +7
-0+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. + endmenuWhy is the default 64 bit? Because 32 bit became experimental?
Quoted 4 lines
That's a really good question. Vivek, why did you change it to be this way? In thinking about it some more, this should be a 64bit option instead.
I thought 64bit is more inclusive. Works both for 32bit and 64bit BARs. Also exports memory more than 4G through /proc/iomem without selecting an additional option in config file. The flip side is that it introduces little memory overhead. I thought most of the users should be ok with this increased memory usage and those who are particular, they can choose RESOURCES_32BIT.
Thanks
Vivek
Geert Uytterhoeven
maintainerRe: [PATCH 16/16] 64bit Resource: finally enable 64bit resource sizes
Quoted 34 lines · Vivek Goyal
Quoted 26 lines · Greg KH
Quoted 14 lines · Geert Uytterhoeven
Quoted 13 lines · Greg KH
From: Greg Kroah-Hartman <[email protected]>
Introduce the
Kconfigentry and actually switch to a 64bit value, if wanted, forresource_size_t.arch/m68k/Kconfig +0
-0@@ -368,6 +368,13 @@ config 060_WRITETHROUGH source "mm/Kconfig"Quoted 10 lines
arch/m68k/Kconfig config 060_WRITETHROUGH · line 378
Quoted 8 lines
arch/m68k/Kconfig +7
-0+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. + endmenuWhy is the default 64 bit? Because 32 bit became experimental?
Quoted 4 lines
That's a really good question. Vivek, why did you change it to be this way? In thinking about it some more, this should be a 64bit option instead.
I thought 64bit is more inclusive. Works both for 32bit and 64bit BARs.
Quoted 7 lines
From a PCI viewpoint? Not all machines have PCI.
Also exports memory more than 4G through
/proc/iomemwithout selecting an additional option in config file. The flip side is that it introduces little memory overhead. I thought most of the users should be ok with this increased memory usage and those who are particular, they can chooseRESOURCES_32BIT.
Not all 32 bit platforms support more than 4 GiB of memory, so it's of no use to waste memory on 64 bit resources.
I'd prefer to have an option to explicitly enable 64 bit resources (and make 32 bit resources non-experimental ;-).
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Re: [PATCH 16/16] 64bit Resource: finally enable 64bit resource sizes
Quoted 37 lines · Geert Uytterhoeven
Quoted 35 lines · Vivek Goyal
Quoted 26 lines · Greg KH
Quoted 14 lines · Geert Uytterhoeven
Quoted 13 lines · Greg KH
From: Greg Kroah-Hartman <[email protected]>
Introduce the
Kconfigentry and actually switch to a 64bit value, if wanted, forresource_size_t.arch/m68k/Kconfig +0
-0@@ -368,6 +368,13 @@ config 060_WRITETHROUGH source "mm/Kconfig"Quoted 10 lines
arch/m68k/Kconfig config 060_WRITETHROUGH · line 378
Quoted 8 lines
arch/m68k/Kconfig +7
-0+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. + endmenuWhy is the default 64 bit? Because 32 bit became experimental?
Quoted 4 lines
That's a really good question. Vivek, why did you change it to be this way? In thinking about it some more, this should be a 64bit option instead.
I thought 64bit is more inclusive. Works both for 32bit and 64bit BARs.
From a PCI viewpoint? Not all machines have PCI.
Quoted 9 lines
Quoted 5 lines
Also exports memory more than 4G through
/proc/iomemwithout selecting an additional option in config file. The flip side is that it introduces little memory overhead. I thought most of the users should be ok with this increased memory usage and those who are particular, they can chooseRESOURCES_32BIT.Not all 32 bit platforms support more than 4 GiB of memory, so it's of no use to waste memory on 64 bit resources.
Hmm.. That makes sense. I will rework the patch.
Thanks
Vivek
Re: [PATCH 16/16] 64bit Resource: finally enable 64bit resource sizes
Quoted 44 lines · Vivek Goyal
Quoted 43 lines · Geert Uytterhoeven
Quoted 41 lines · Vivek Goyal
Quoted 26 lines · Greg KH
Quoted 14 lines · Geert Uytterhoeven
Quoted 13 lines · Greg KH
From: Greg Kroah-Hartman <[email protected]>
Introduce the
Kconfigentry and actually switch to a 64bit value, if wanted, forresource_size_t.arch/m68k/Kconfig +0
-0@@ -368,6 +368,13 @@ config 060_WRITETHROUGH source "mm/Kconfig"Quoted 10 lines
arch/m68k/Kconfig config 060_WRITETHROUGH · line 378
Quoted 8 lines
arch/m68k/Kconfig +7
-0+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. + endmenuWhy is the default 64 bit? Because 32 bit became experimental?
Quoted 4 lines
That's a really good question. Vivek, why did you change it to be this way? In thinking about it some more, this should be a 64bit option instead.
I thought 64bit is more inclusive. Works both for 32bit and 64bit BARs.
From a PCI viewpoint? Not all machines have PCI.
Also exports memory more than 4G through
/proc/iomemwithout selecting an additional option in config file. The flip side is that it introduces little memory overhead. I thought most of the users should be ok with this increased memory usage and those who are particular, they can chooseRESOURCES_32BIT.
Quoted 5 lines
Quoted 3 lines
Not all 32 bit platforms support more than 4 GiB of memory, so it's of no use to waste memory on 64 bit resources.
Hmm.. That makes sense. I will rework the patch.
Thanks, just rework the last one.
And it looks like you can add just one entry to mm/Kconfig instead of touching every arch's Kconfig file.
thanks,
greg k-h
Re: [PATCH 16/16] 64bit Resource: finally enable 64bit resource sizes
Quoted 49 lines · Greg KH
Quoted 48 lines · Vivek Goyal
Quoted 46 lines · Geert Uytterhoeven
Quoted 34 lines · Vivek Goyal
Quoted 26 lines · Greg KH
Quoted 14 lines · Geert Uytterhoeven
Quoted 13 lines · Greg KH
From: Greg Kroah-Hartman <[email protected]>
Introduce the
Kconfigentry and actually switch to a 64bit value, if wanted, forresource_size_t.arch/m68k/Kconfig +0
-0@@ -368,6 +368,13 @@ config 060_WRITETHROUGH source "mm/Kconfig"Quoted 10 lines
arch/m68k/Kconfig config 060_WRITETHROUGH · line 378
Quoted 8 lines
arch/m68k/Kconfig +7
-0+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. + endmenuWhy is the default 64 bit? Because 32 bit became experimental?
Quoted 4 lines
That's a really good question. Vivek, why did you change it to be this way? In thinking about it some more, this should be a 64bit option instead.
I thought 64bit is more inclusive. Works both for 32bit and 64bit BARs.
Quoted 7 lines
From a PCI viewpoint? Not all machines have PCI.
Also exports memory more than 4G through
/proc/iomemwithout selecting an additional option in config file. The flip side is that it introduces little memory overhead. I thought most of the users should be ok with this increased memory usage and those who are particular, they can chooseRESOURCES_32BIT.Not all 32 bit platforms support more than 4 GiB of memory, so it's of no use to waste memory on 64 bit resources.
Quoted 6 lines
Quoted 1 line
Hmm.. That makes sense. I will rework the patch.
Thanks, just rework the last one.
And it looks like you can add just one entry to mm/Kconfig instead of touching every arch's
Kconfigfile.
Greg, Please find attached the reworked-patch. I have gotten rid of CONFIG_RESOURCES_32BIT and instead introduced CONFIG_RESOURCES_64BIT in arch intenepndent file mm/Kconfig.
This patch assumes that 64bit kernels will define CONFIG_64BIT. All the architectures seems to be adhering to this but can't find CONFIG_64BIT for sh64. Don't know much about this arch.
o Introuces CONFIG_RESOURCES_64BIT Kconfig option.
o This option is available only for 32bit platforms/kernels (!CONFIG_64BIT), as for 64bit kernels, resources have to be 64 bits and they already are.
---
linux-2.6.17-rc6-1M-vivek/arch/i386/Kconfig | 1 + linux-2.6.17-rc6-1M-vivek/include/linux/types.h | 7 ++++++- linux-2.6.17-rc6-1M-vivek/mm/Kconfig | 7 +++++++ 3 files changed, 14 insertions(+), 1 deletion(-)
mm/Kconfig renamed from mm/Kconfig~64bit-resources-modify-kconfig-options +7 -0
@@ -145,3 +145,10 @@ config MIGRATION while the virtual addresses are not changed. This is useful for example on NUMA systems to put pages nearer to the processors accessing the page. + +config RESOURCES_64BIT + bool "64 bit Memory and IO resources (EXPERIMENTAL)" + depends on (EXPERIMENTAL && !64BIT) + default n + help + This option allows memory and IO resources to be 64 bit.
include/linux/types.h renamed from include/linux/types.h~64bit-resources-modify-kconfig-options +6 -1
@@ -179,7 +179,12 @@ typedef __u64 __bitwise __be64;#ifdef __KERNEL__typedef unsigned __bitwise__ gfp_t ; -typedef unsigned long resource_size_t ; +#if defined(CONFIG_RESOURCES_64BIT ) || defined(CONFIG_64BIT ) +typedef u64 resource_size_t ; +#else +typedef u32 resource_size_t ; +#endif +#endif struct ustat {
arch/i386/Kconfig renamed from arch/i386/Kconfig~64bit-resources-modify-kconfig-options +1 -0
@@ -511,6 +511,7 @@ config X86_PAE bool depends on HIGHMEM64G default y + select RESOURCES_64BIT # Common NUMA Features config NUMA
_
Geert Uytterhoeven
maintainerRe: [PATCH 16/16] 64bit Resource: finally enable 64bit resource sizes
Quoted 52 lines · Vivek Goyal
Quoted 51 lines · Greg KH
Quoted 49 lines · Vivek Goyal
Quoted 37 lines · Geert Uytterhoeven
Quoted 35 lines · Vivek Goyal
Quoted 26 lines · Greg KH
Quoted 14 lines · Geert Uytterhoeven
Quoted 13 lines · Greg KH
From: Greg Kroah-Hartman <[email protected]>
Introduce the
Kconfigentry and actually switch to a 64bit value, if wanted, forresource_size_t.arch/m68k/Kconfig +0
-0@@ -368,6 +368,13 @@ config 060_WRITETHROUGH source "mm/Kconfig"Quoted 10 lines
arch/m68k/Kconfig config 060_WRITETHROUGH · line 378
Quoted 8 lines
arch/m68k/Kconfig +7
-0+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. + endmenuWhy is the default 64 bit? Because 32 bit became experimental?
Quoted 4 lines
That's a really good question. Vivek, why did you change it to be this way? In thinking about it some more, this should be a 64bit option instead.
I thought 64bit is more inclusive. Works both for 32bit and 64bit BARs.
From a PCI viewpoint? Not all machines have PCI.
Quoted 9 lines
Quoted 5 lines
Also exports memory more than 4G through
/proc/iomemwithout selecting an additional option in config file. The flip side is that it introduces little memory overhead. I thought most of the users should be ok with this increased memory usage and those who are particular, they can chooseRESOURCES_32BIT.Not all 32 bit platforms support more than 4 GiB of memory, so it's of no use to waste memory on 64 bit resources.
Hmm.. That makes sense. I will rework the patch.
Quoted 8 lines
Quoted 4 lines
Thanks, just rework the last one.
And it looks like you can add just one entry to mm/Kconfig instead of touching every arch's
Kconfigfile.Greg, Please find attached the reworked-patch. I have gotten rid of
CONFIG_RESOURCES_32BITand instead introducedCONFIG_RESOURCES_64BITin arch intenepndent file mm/Kconfig.
Thanks!
Quoted 24 lines
o Introuces
CONFIG_RESOURCES_64BITKconfigoption.o This option is available only for 32bit platforms/kernels (!CONFIG_64BIT), as for 64bit kernels, resources have to be 64 bits and they already are.
diff -puN
mm/Kconfig~64bit-resources-modify-kconfig-optionsmm/Kconfigmm/Kconfig renamed from mm/Kconfig~64bit-resources-modify-kconfig-options +7
-0@@ -145,3 +145,10 @@ config MIGRATION while the virtual addresses are not changed. This is useful for example on NUMA systems to put pages nearer to the processors accessing the page. + +config RESOURCES_64BIT + bool "64 bit Memory and IO resources (EXPERIMENTAL)" + depends on (EXPERIMENTAL && !64BIT) + default n + help + This option allows memory and IO resources to be 64 bit.diff -puN
include/linux/types.h~64bit-resources-modify-kconfig-optionsinclude/linux/types.h
include/linux/types.h typedef __u64 __bitwise __be64; · line 182
Quoted 5 lines
include/linux/types.h renamed from include/linux/types.h~64bit-resources-modify-kconfig-options +1
-1@@ -179,7 +179,12 @@ typedef __u64 __bitwise __be64;#ifdef __KERNEL__typedef unsigned __bitwise__ gfp_t ; -typedef unsigned long resource_size_t ; +#if defined(CONFIG_RESOURCES_64BIT ) || defined(CONFIG_64BIT )
If you'd set CONFIG_RESOURCES_64BIT in Kconfig if CONFIG_64BIT, you don't need the `|| defined(CONFIG_64BIT)'.
IMHO it looks a bit confusing that resources are 64 bit on 64 bit platforms, while CONFIG_RESOURCES_64BIT is not set.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Re: [PATCH 16/16] 64bit Resource: finally enable 64bit resource sizes
Quoted 21 lines · Geert Uytterhoeven
Quoted 21 lines
diff -puN
mm/Kconfig~64bit-resources-modify-kconfig-optionsmm/Kconfigmm/Kconfig renamed from mm/Kconfig~64bit-resources-modify-kconfig-options +7
-0@@ -145,3 +145,10 @@ config MIGRATION while the virtual addresses are not changed. This is useful for example on NUMA systems to put pages nearer to the processors accessing the page. + +config RESOURCES_64BIT + bool "64 bit Memory and IO resources (EXPERIMENTAL)" + depends on (EXPERIMENTAL && !64BIT) + default n + help + This option allows memory and IO resources to be 64 bit.diff -puN
include/linux/types.h~64bit-resources-modify-kconfig-optionsinclude/linux/types.hinclude/linux/types.h renamed from include/linux/types.h~64bit-resources-modify-kconfig-options +0
-0@@ -179,7 +179,12 @@ typedef __u64 __bitwise __be64;#ifdef __KERNEL__typedef unsigned __bitwise__ gfp_t ;
Quoted 9 lines
include/linux/types.h typedef __u64 __bitwise __be64; · line 182
Quoted 2 lines
include/linux/types.h renamed from include/linux/types.h~64bit-resources-modify-kconfig-options +1
-1-typedef unsigned long resource_size_t ; +#if defined(CONFIG_RESOURCES_64BIT ) || defined(CONFIG_64BIT )If you'd set
CONFIG_RESOURCES_64BITinKconfigifCONFIG_64BIT, you don't need the `||defined(CONFIG_64BIT)'.IMHO it looks a bit confusing that resources are 64 bit on 64 bit platforms, while
CONFIG_RESOURCES_64BITis not set.
Ok. Here is another take. I have used "select" in arch dependent files to select CONFIG_RESOURCES_64BIT forcibly if 64BIT is set. Please suggest if there is an arch independent way to do that.
There is a small issue though. On 64bit kernels RESOURCES_64BIT should not be exprimental as rosources are already 64bit. "select" will make sure that RESOURCES_64BIT is set but following line will be visible to user on 64bit platforms and user might be confused about "EXPERIMENTAL" keyword.
"64 bit Memory and IO resources (EXPERIMENTAL)"
At the same time this key word is required on 32bit platforms so that user knows that this is something new and experimental.
Please suggest if there is a way to handle this situation. Ideally I would like to set RESOURCES_64BIT on 64bit platforms without prompting anything to user.
o Introuces CONFIG_RESOURCES_64BIT Kconfig option.
---
linux-2.6.17-rc6-1M-vivek/arch/alpha/Kconfig | 1 + linux-2.6.17-rc6-1M-vivek/arch/i386/Kconfig | 1 + linux-2.6.17-rc6-1M-vivek/arch/ia64/Kconfig | 1 + linux-2.6.17-rc6-1M-vivek/arch/mips/Kconfig | 1 + linux-2.6.17-rc6-1M-vivek/arch/parisc/Kconfig | 1 + linux-2.6.17-rc6-1M-vivek/arch/powerpc/Kconfig | 1 + linux-2.6.17-rc6-1M-vivek/arch/s390/Kconfig | 1 + linux-2.6.17-rc6-1M-vivek/arch/sparc64/Kconfig | 1 + linux-2.6.17-rc6-1M-vivek/arch/x86_64/Kconfig | 1 + linux-2.6.17-rc6-1M-vivek/include/linux/types.h | 7 ++++++- linux-2.6.17-rc6-1M-vivek/mm/Kconfig | 9 +++++++++ 11 files changed, 24 insertions(+), 1 deletion(-)
include/linux/types.h renamed from include/linux/types.h~64bit-resources-modify-kconfig-options +6 -1
@@ -179,7 +179,12 @@ typedef __u64 __bitwise __be64;#ifdef __KERNEL__typedef unsigned __bitwise__ gfp_t ; -typedef unsigned long resource_size_t ; +#ifdef CONFIG_RESOURCES_64BIT +typedef u64 resource_size_t ; +#else +typedef u32 resource_size_t ; +#endif +#endif struct ustat {
mm/Kconfig renamed from mm/Kconfig~64bit-resources-modify-kconfig-options +9 -0
@@ -145,3 +145,12 @@ config MIGRATION while the virtual addresses are not changed. This is useful for example on NUMA systems to put pages nearer to the processors accessing the page. + +config RESOURCES_64BIT + bool "64 bit Memory and IO resources (EXPERIMENTAL)" + depends on (EXPERIMENTAL && !64BIT) || 64BIT + default y if 64BIT + help + This option allows memory and IO resources to be 64 bit. + +
arch/alpha/Kconfig renamed from arch/alpha/Kconfig~64bit-resources-modify-kconfig-options +1 -0
@@ -13,6 +13,7 @@ config ALPHA config 64BIT def_bool y + select RESOURCES_64BIT config MMU bool
arch/i386/Kconfig renamed from arch/i386/Kconfig~64bit-resources-modify-kconfig-options +1 -0
@@ -511,6 +511,7 @@ config X86_PAE bool depends on HIGHMEM64G default y + select RESOURCES_64BIT # Common NUMA Features config NUMA
arch/ia64/Kconfig renamed from arch/ia64/Kconfig~64bit-resources-modify-kconfig-options +1 -0
@@ -21,6 +21,7 @@ config IA64 config 64BIT bool default y + select RESOURCES_64BIT config MMU bool
arch/mips/Kconfig renamed from arch/mips/Kconfig~64bit-resources-modify-kconfig-options +1 -0
@@ -1382,6 +1382,7 @@ config 32BIT config 64BIT bool "64-bit kernel" depends on CPU_SUPPORTS_64BIT_KERNEL && SYS_SUPPORTS_64BIT_KERNEL + select RESOURCES_64BIT help Select this option if you want to build a 64-bit kernel.
arch/parisc/Kconfig renamed from arch/parisc/Kconfig~64bit-resources-modify-kconfig-options +1 -0
@@ -128,6 +128,7 @@ config PREFETCH config 64BIT bool "64-bit kernel" depends on PA8X00 + select RESOURCES_64BIT help Enable this if you want to support 64bit kernel on PA-RISC platform.
arch/powerpc/Kconfig renamed from arch/powerpc/Kconfig~64bit-resources-modify-kconfig-options +1 -0
@@ -18,6 +18,7 @@ config PPC32 config 64BIT bool default y if PPC64 + select RESOURCES_64BIT config PPC_MERGE def_bool y
arch/s390/Kconfig renamed from arch/s390/Kconfig~64bit-resources-modify-kconfig-options +1 -0
@@ -39,6 +39,7 @@ comment "Processor type and features" config 64BIT bool "64 bit kernel" + select RESOURCES_64BIT help Select this option if you have a 64 bit IBM zSeries machine and want to use the 64 bit addressing mode.
arch/sparc64/Kconfig renamed from arch/sparc64/Kconfig~64bit-resources-modify-kconfig-options +1 -0
@@ -21,6 +21,7 @@ config SPARC64 config 64BIT def_bool y + select RESOURCES_64BIT config MMU bool
arch/x86_64/Kconfig renamed from arch/x86_64/Kconfig~64bit-resources-modify-kconfig-options +1 -0
@@ -19,6 +19,7 @@ config X86_64 config 64BIT def_bool y + select RESOURCES_64BIT config X86 bool
_
Geert Uytterhoeven
maintainerRe: [PATCH 16/16] 64bit Resource: finally enable 64bit resource sizes
Quoted 28 lines · Vivek Goyal
Quoted 27 lines · Geert Uytterhoeven
Quoted 18 lines
diff -puN
mm/Kconfig~64bit-resources-modify-kconfig-optionsmm/Kconfigmm/Kconfig renamed from mm/Kconfig~64bit-resources-modify-kconfig-options +7
-0@@ -145,3 +145,10 @@ config MIGRATION while the virtual addresses are not changed. This is useful for example on NUMA systems to put pages nearer to the processors accessing the page. + +config RESOURCES_64BIT + bool "64 bit Memory and IO resources (EXPERIMENTAL)" + depends on (EXPERIMENTAL && !64BIT) + default n + help + This option allows memory and IO resources to be 64 bit.diff -puN
include/linux/types.h~64bit-resources-modify-kconfig-optionsinclude/linux/types.hinclude/linux/types.h typedef __u64 __bitwise __be64; · line 182
Quoted 5 lines
include/linux/types.h renamed from include/linux/types.h~64bit-resources-modify-kconfig-options +1
-1@@ -179,7 +179,12 @@ typedef __u64 __bitwise __be64;#ifdef __KERNEL__typedef unsigned __bitwise__ gfp_t ; -typedef unsigned long resource_size_t ; +#if defined(CONFIG_RESOURCES_64BIT ) || defined(CONFIG_64BIT )If you'd set
CONFIG_RESOURCES_64BITinKconfigifCONFIG_64BIT, you don't need the `||defined(CONFIG_64BIT)'.
Quoted 7 lines
Quoted 3 lines
IMHO it looks a bit confusing that resources are 64 bit on 64 bit platforms, while
CONFIG_RESOURCES_64BITis not set.Ok. Here is another take. I have used "select" in arch dependent files to select
CONFIG_RESOURCES_64BITforcibly if 64BIT is set. Please suggest if there is an arch independent way to do that.
I don't think you need to explicitly select it, since
mm/Kconfig config MIGRATION · line 152
Quoted 11 lines
mm/Kconfig renamed from mm/Kconfig~64bit-resources-modify-kconfig-options +5
-0@@ -145,3 +145,12 @@ config MIGRATION while the virtual addresses are not changed. This is useful for example on NUMA systems to put pages nearer to the processors accessing the page. + +config RESOURCES_64BIT + bool "64 bit Memory and IO resources (EXPERIMENTAL)" + depends on (EXPERIMENTAL && !64BIT) || 64BIT + default y if 64BIT
it defaults to y if 64BIT. Roman?
Quoted 9 lines
There is a small issue though. On 64bit kernels
RESOURCES_64BITshould not be exprimental as rosources are already 64bit. "select" will make sure thatRESOURCES_64BITis set but following line will be visible to user on 64bit platforms and user might be confused about "EXPERIMENTAL" keyword."64 bit Memory and IO resources (EXPERIMENTAL)"
At the same time this key word is required on 32bit platforms so that user knows that this is something new and experimental.
`EXPERIMENTAL on 32 bit'?
Quoted 3 lines
Please suggest if there is a way to handle this situation. Ideally I would like to set
RESOURCES_64BITon 64bit platforms without prompting anything to user.
Yes, that's what you want. Roman?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Re: [PATCH 16/16] 64bit Resource: finally enable 64bit resource sizes
Hi,
Quoted 5 lines · Geert Uytterhoeven
Quoted 5 lines
mm/Kconfig renamed from mm/Kconfig~64bit-resources-modify-kconfig-options +0
-0@@ -145,3 +145,12 @@ config MIGRATION while the virtual addresses are not changed. This is useful for example on NUMA systems to put pages nearer to the processors accessing
Quoted 8 lines
mm/Kconfig config MIGRATION · line 152
Quoted 6 lines
mm/Kconfig renamed from mm/Kconfig~64bit-resources-modify-kconfig-options +5
-0the page. + +config RESOURCES_64BIT + bool "64 bit Memory and IO resources (EXPERIMENTAL)" + depends on (EXPERIMENTAL && !64BIT) || 64BIT + default y if 64BITit defaults to y if 64BIT. Roman?
This should do it:
config RESOURCES_64BIT
bool "64 bit Memory and IO resources (EXPERIMENTAL)" if !64BIT && EXPERIMENTAL default 64BIT
bye, Roman
Geert Uytterhoeven
maintainerRe: [PATCH 16/16] 64bit Resource: finally enable 64bit resource sizes
Quoted 16 lines · Roman Zippel
Quoted 5 lines · Geert Uytterhoeven
Quoted 5 lines
mm/Kconfig renamed from mm/Kconfig~64bit-resources-modify-kconfig-options +0
-0@@ -145,3 +145,12 @@ config MIGRATION while the virtual addresses are not changed. This is useful for example on NUMA systems to put pages nearer to the processors accessingQuoted 8 lines
mm/Kconfig config MIGRATION · line 152
Quoted 6 lines
mm/Kconfig renamed from mm/Kconfig~64bit-resources-modify-kconfig-options +5
-0the page. + +config RESOURCES_64BIT + bool "64 bit Memory and IO resources (EXPERIMENTAL)" + depends on (EXPERIMENTAL && !64BIT) || 64BIT + default y if 64BITit defaults to y if 64BIT. Roman?
Quoted 5 lines
This should do it:
config
RESOURCES_64BITbool "64 bit Memory and IO resources (EXPERIMENTAL)" if !64BIT && EXPERIMENTAL default 64BIT
^
Missing `y if'?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Re: [PATCH 16/16] 64bit Resource: finally enable 64bit resource sizes
Hi,
Quoted 5 lines · Geert Uytterhoeven
Quoted 3 lines
config
RESOURCES_64BITbool "64 bit Memory and IO resources (EXPERIMENTAL)" if !64BIT && EXPERIMENTAL default 64BIT^Missing `y if'?
Not really. :)
A default accepts normal expressions for boolean/tristate. Most of the time an if is not needed for a default, it only really makes a difference if you have multiple defaults, where the condition controls which one is active.
bye, Roman
Geert Uytterhoeven
maintainerRe: [PATCH 16/16] 64bit Resource: finally enable 64bit resource sizes
Quoted 7 lines · Roman Zippel
Quoted 5 lines · Geert Uytterhoeven
Quoted 3 lines
config
RESOURCES_64BITbool "64 bit Memory and IO resources (EXPERIMENTAL)" if !64BIT && EXPERIMENTAL default 64BIT^Missing `y if'?
Quoted 6 lines
Not really. :)
A default accepts normal expressions for boolean/tristate. Most of the time an if is not needed for a default, it only really makes a difference if you have multiple defaults, where the condition controls which one is active.
IC, of course.
So the default value of CONFIG_RESOURCES_64BIT is the same as the value of CONFIG_64BIT, which is indeed what we want.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Re: [PATCH 16/16] 64bit Resource: finally enable 64bit resource sizes
In reply to Roman ZippelQuoted 18 lines · Roman Zippel
Hi,
Quoted 5 lines · Geert Uytterhoeven
Quoted 5 lines
mm/Kconfig renamed from mm/Kconfig~64bit-resources-modify-kconfig-options +0
-0@@ -145,3 +145,12 @@ config MIGRATION while the virtual addresses are not changed. This is useful for example on NUMA systems to put pages nearer to the processors accessingQuoted 8 lines
mm/Kconfig config MIGRATION · line 152
Quoted 6 lines
mm/Kconfig renamed from mm/Kconfig~64bit-resources-modify-kconfig-options +5
-0the page. + +config RESOURCES_64BIT + bool "64 bit Memory and IO resources (EXPERIMENTAL)" + depends on (EXPERIMENTAL && !64BIT) || 64BIT + default y if 64BITit defaults to y if 64BIT. Roman?
Quoted 6 lines
This should do it:
config
RESOURCES_64BITbool "64 bit Memory and IO resources (EXPERIMENTAL)" if !64BIT && EXPERIMENTAL default 64BIT
Wow. That works. Thanks. I am attaching the patch. Hope this one is final :-)
Greg, can you please pick the patch.
Thanks
Vivek
o Introuces CONFIG_RESOURCES_64BIT Kconfig option.
---
linux-2.6.17-rc6-1M-vivek/arch/i386/Kconfig | 1 + linux-2.6.17-rc6-1M-vivek/include/linux/types.h | 7 ++++++- linux-2.6.17-rc6-1M-vivek/mm/Kconfig | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-)
include/linux/types.h renamed from include/linux/types.h~64bit-resources-modify-kconfig-options +6 -1
@@ -179,7 +179,12 @@ typedef __u64 __bitwise __be64;#ifdef __KERNEL__typedef unsigned __bitwise__ gfp_t ; -typedef unsigned long resource_size_t ; +#ifdef CONFIG_RESOURCES_64BIT +typedef u64 resource_size_t ; +#else +typedef u32 resource_size_t ; +#endif +#endif struct ustat {
mm/Kconfig renamed from mm/Kconfig~64bit-resources-modify-kconfig-options +6 -0
@@ -145,3 +145,9 @@ config MIGRATION while the virtual addresses are not changed. This is useful for example on NUMA systems to put pages nearer to the processors accessing the page. + +config RESOURCES_64BIT + bool "64 bit Memory and IO resources (EXPERIMENTAL)" if (!64BIT && EXPERIMENTAL) + default 64BIT + help + This option allows memory and IO resources to be 64 bit.
arch/i386/Kconfig renamed from arch/i386/Kconfig~64bit-resources-modify-kconfig-options +1 -0
@@ -511,6 +511,7 @@ config X86_PAE bool depends on HIGHMEM64G default y + select RESOURCES_64BIT # Common NUMA Features config NUMA
_
Re: [PATCH 03/16] 64bit resource: fix up printks for resources in networks drivers
In reply to Greg KHFirst, added netdev,
Quoted 28 lines · Greg KH
From: Greg Kroah-Hartman <[email protected]>
This is needed if we wish to change the size of the resource structures.
Based on an original patch from Vivek Goyal <[email protected]>
Cc Vivek Goyal <[email protected]>Cc Andrew Morton <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- drivers/net/3c59x.c | 6 ++++-- drivers/net/8139cp.c | 9 +++++---- 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, 38 insertions(+), 33 deletions(-)drivers/net/e100.c +0
-0
drivers/net/e100.c #endif · line 2685
Quoted 10 lines
drivers/net/e100.c +2
-2@@ -2678,9 +2678,9 @@ #endif 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 ]);
color me confused, but why is this change necessary for e100? e100 can not support 64 bit BARs, so it seems to me to make little sense to cast to unsigned long long. e100 is 32 bit the whole way through.
Jesse
Re: [PATCH 03/16] 64bit resource: fix up printks for resources in networks drivers
Quoted 34 lines · Jesse Brandeburg
First, added netdev,
Quoted 31 lines · Greg KH
From: Greg Kroah-Hartman <[email protected]>
This is needed if we wish to change the size of the resource structures.
Based on an original patch from Vivek Goyal <[email protected]>
Cc Vivek Goyal <[email protected]>Cc Andrew Morton <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>---
drivers/net/3c59x.c | 6 ++++-- drivers/net/8139cp.c | 9 +++++---- 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, 38 insertions(+), 33 deletions(-)drivers/net/e100.c +0
-0@@ -2678,9 +2678,9 @@ #endif goto err_out_free; }
Quoted 13 lines
Quoted 9 lines
drivers/net/e100.c +2
-2- 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]);color me confused, but why is this change necessary for e100? e100 can not support 64 bit BARs, so it seems to me to make little sense to cast to unsigned long long. e100 is 32 bit the whole way through.
Because the result of pci_resource_start() just became either u32 or u64 depending on a config option, and so, to keep everything sane, we just always cast it to unsigned long long, which makes everyone happy.
Hope this helps,
greg k-h