Skip to content

Commit

Permalink
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6
Browse files Browse the repository at this point in the history
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6:
  [PATCH] i386: export memory more than 4G through /proc/iomem
  [PATCH] 64bit Resource: finally enable 64bit resource sizes
  [PATCH] 64bit Resource: convert a few remaining drivers to use resource_size_t where needed
  [PATCH] 64bit resource: change pnp core to use resource_size_t
  [PATCH] 64bit resource: change pci core and arch code to use resource_size_t
  [PATCH] 64bit resource: change resource core to use resource_size_t
  [PATCH] 64bit resource: introduce resource_size_t for the start and end of struct resource
  [PATCH] 64bit resource: fix up printks for resources in misc drivers
  [PATCH] 64bit resource: fix up printks for resources in arch and core code
  [PATCH] 64bit resource: fix up printks for resources in pcmcia drivers
  [PATCH] 64bit resource: fix up printks for resources in video drivers
  [PATCH] 64bit resource: fix up printks for resources in ide drivers
  [PATCH] 64bit resource: fix up printks for resources in mtd drivers
  [PATCH] 64bit resource: fix up printks for resources in pci core and hotplug drivers
  [PATCH] 64bit resource: fix up printks for resources in networks drivers
  [PATCH] 64bit resource: fix up printks for resources in sound drivers
  [PATCH] 64bit resource: C99 changes for struct resource declarations

Fixed up trivial conflict in drivers/ide/pci/cmd64x.c (the printk that
was changed by the 64-bit resources had been deleted in the meantime ;)
  • Loading branch information
Linus Torvalds committed Jun 29, 2006
2 parents 47c2a3a + 8793747 commit 1903ac5
Show file tree
Hide file tree
Showing 114 changed files with 525 additions and 390 deletions.
4 changes: 2 additions & 2 deletions arch/alpha/kernel/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, pcibios_fixup_final);

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 */
Expand Down
6 changes: 3 additions & 3 deletions arch/arm/kernel/bios32.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ static inline int pdev_bad_for_parity(struct pci_dev *dev)
static 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++) {
Expand Down Expand Up @@ -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;
Expand Down
42 changes: 36 additions & 6 deletions arch/arm/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,49 @@ DEFINE_PER_CPU(struct cpuinfo_arm, cpu_data);
* Standard memory resources
*/
static struct resource mem_res[] = {
{ "Video RAM", 0, 0, IORESOURCE_MEM },
{ "Kernel text", 0, 0, IORESOURCE_MEM },
{ "Kernel data", 0, 0, IORESOURCE_MEM }
{
.name = "Video RAM",
.start = 0,
.end = 0,
.flags = IORESOURCE_MEM
},
{
.name = "Kernel text",
.start = 0,
.end = 0,
.flags = IORESOURCE_MEM
},
{
.name = "Kernel data",
.start = 0,
.end = 0,
.flags = IORESOURCE_MEM
}
};

#define video_ram mem_res[0]
#define kernel_code mem_res[1]
#define kernel_data mem_res[2]

static struct resource io_res[] = {
{ "reserved", 0x3bc, 0x3be, IORESOURCE_IO | IORESOURCE_BUSY },
{ "reserved", 0x378, 0x37f, IORESOURCE_IO | IORESOURCE_BUSY },
{ "reserved", 0x278, 0x27f, IORESOURCE_IO | IORESOURCE_BUSY }
{
.name = "reserved",
.start = 0x3bc,
.end = 0x3be,
.flags = IORESOURCE_IO | IORESOURCE_BUSY
},
{
.name = "reserved",
.start = 0x378,
.end = 0x37f,
.flags = IORESOURCE_IO | IORESOURCE_BUSY
},
{
.name = "reserved",
.start = 0x278,
.end = 0x27f,
.flags = IORESOURCE_IO | IORESOURCE_BUSY
}
};

#define lp0 io_res[0]
Expand Down
4 changes: 2 additions & 2 deletions arch/cris/arch-v32/drivers/pci/bios.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,

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;
Expand Down
4 changes: 2 additions & 2 deletions arch/frv/mb93090-mb00/pci-frv.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ pcibios_update_resource(struct pci_dev *dev, struct resource *root,
*/
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;
Expand Down
1 change: 1 addition & 0 deletions arch/i386/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,7 @@ config X86_PAE
bool
depends on HIGHMEM64G
default y
select RESOURCES_64BIT

# Common NUMA Features
config NUMA
Expand Down
6 changes: 4 additions & 2 deletions arch/i386/kernel/efi.c
Original file line number Diff line number Diff line change
Expand Up @@ -601,8 +601,10 @@ efi_initialize_iomem_resources(struct resource *code_resource,
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.
Expand Down
2 changes: 2 additions & 0 deletions arch/i386/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -1314,8 +1314,10 @@ legacy_init_iomem_resources(struct resource *code_resource, struct resource *dat
probe_roms();
for (i = 0; i < e820.nr_map; i++) {
struct resource *res;
#ifndef CONFIG_RESOURCES_64BIT
if (e820.map[i].addr + e820.map[i].size > 0x100000000ULL)
continue;
#endif
res = kzalloc(sizeof(struct resource), GFP_ATOMIC);
switch (e820.map[i].type) {
case E820_RAM: res->name = "System RAM"; break;
Expand Down
4 changes: 2 additions & 2 deletions arch/i386/pci/i386.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@
*/
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;
Expand Down
2 changes: 1 addition & 1 deletion arch/ia64/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ pcibios_disable_device (struct pci_dev *dev)

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

Expand Down
3 changes: 2 additions & 1 deletion arch/m68knommu/kernel/comempci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}

Expand Down
4 changes: 2 additions & 2 deletions arch/mips/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
4 changes: 2 additions & 2 deletions arch/mips/pmc-sierra/yosemite/ht.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,12 +383,12 @@ void pcibios_update_resource(struct pci_dev *dev, struct resource *root,


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
Expand Down
2 changes: 1 addition & 1 deletion arch/parisc/kernel/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ EXPORT_SYMBOL(pcibios_bus_to_resource);
* than res->start.
*/
void pcibios_align_resource(void *data, struct resource *res,
unsigned long size, unsigned long alignment)
resource_size_t size, resource_size_t alignment)
{
unsigned long mask, align;

Expand Down
47 changes: 24 additions & 23 deletions arch/powerpc/kernel/pci_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ pcibios_fixup_resources(struct pci_dev *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;
Expand All @@ -117,7 +117,7 @@ pcibios_fixup_resources(struct pci_dev *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
Expand Down Expand Up @@ -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"
" (%ld bytes)\n", pci_name(dev),
dev->resource - res, size);
" (%lld bytes)\n", pci_name(dev),
dev->resource - res, (unsigned long long)size);
}

if (start & 0x300) {
Expand Down Expand Up @@ -255,8 +255,8 @@ pcibios_allocate_bus_resources(struct list_head *bus_list)
}
}

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;
Expand Down Expand Up @@ -306,7 +306,7 @@ reparent_resources(struct resource *parent, struct resource *res)
*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;
Expand Down Expand Up @@ -362,13 +362,14 @@ pci_relocate_bridge_resource(struct pci_bus *bus, int i)
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;
}

Expand Down Expand Up @@ -479,14 +480,14 @@ static inline void alloc_resource(struct pci_dev *dev, int idx)
{
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;
Expand Down Expand Up @@ -956,7 +957,7 @@ pci_process_bridge_OF_ranges(struct pci_controller *hose,
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 */
Expand All @@ -978,7 +979,7 @@ pci_process_bridge_OF_ranges(struct pci_controller *hose,
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;
Expand Down Expand Up @@ -1074,7 +1075,7 @@ do_update_p2p_io_resource(struct pci_bus *bus, int enable_vga)
DBG("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);
Expand Down Expand Up @@ -1223,8 +1224,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,
Expand Down Expand Up @@ -1574,8 +1575,8 @@ static pgprot_t __pci_mmap_set_pgprot(struct pci_dev *dev, struct resource *rp,
else
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);
}
Expand Down Expand Up @@ -1755,7 +1756,7 @@ long sys_pciconfig_iobase(long which, unsigned long bus, unsigned long devfn)

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;
Expand Down
4 changes: 2 additions & 2 deletions arch/powerpc/kernel/pci_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ EXPORT_SYMBOL(pcibios_bus_to_resource);
* which might have be mirrored at 0x0100-0x03ff..
*/
void pcibios_align_resource(void *data, struct resource *res,
unsigned long size, unsigned long align)
resource_size_t size, resource_size_t align)
{
struct pci_dev *dev = data;
struct pci_controller *hose = pci_bus_to_host(dev->bus);
unsigned long start = res->start;
resource_size_t start = res->start;
unsigned long alignto;

if (res->flags & IORESOURCE_IO) {
Expand Down
Loading

0 comments on commit 1903ac5

Please sign in to comment.