Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 685143ac authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

[PATCH] 64bit resource: fix up printks for resources in arch and core code



This is needed if we wish to change the size of the resource structures.

Based on an original patch from Vivek Goyal <vgoyal@in.ibm.com> and
Andrew Morton.

(tweaked by Andy Isaacson <adi@hexapodia.org>)

Cc: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarAndy Isaacson <adi@hexapodia.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 490ab72a
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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.
+19 −18
Original line number Diff line number Diff line
@@ -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;
@@ -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
@@ -183,7 +183,7 @@ void pcibios_align_resource(void *data, struct resource *res, unsigned long size

		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,7 +255,7 @@ pcibios_allocate_bus_resources(struct list_head *bus_list)
				}
			}

			DBG("PCI: bridge rsrc %lx..%lx (%lx), parent %p\n",
			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)
@@ -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;
@@ -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;
}

@@ -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;
@@ -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 */
@@ -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;
@@ -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);
@@ -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,
@@ -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);
}
+3 −2
Original line number Diff line number Diff line
@@ -91,9 +91,10 @@ int __init add_bridge(struct device_node *dev)
		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);
+3 −2
Original line number Diff line number Diff line
@@ -79,9 +79,10 @@ int __init add_bridge(struct device_node *dev)
		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);
+2 −2
Original line number Diff line number Diff line
@@ -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();
Loading