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

Commit 1396a8c3 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

[PATCH] 64bit resource: fix up printks for resources in pci core and hotplug drivers



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>

Cc: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7c7459d1
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -95,8 +95,8 @@ static int zt5550_hc_config(struct pci_dev *pdev)

	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_dev *pdev)
	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;
	}
+5 −5
Original line number Diff line number Diff line
@@ -1089,8 +1089,8 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
	}
	
	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 *pdev, const struct pci_device_id *ent)
	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;
	}
+3 −2
Original line number Diff line number Diff line
@@ -1398,8 +1398,9 @@ int pcie_init(struct controller * ctrl, struct pcie_device *dev)

	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);
+12 −6
Original line number Diff line number Diff line
@@ -51,8 +51,10 @@ static ssize_t show_ctrl (struct device *dev, struct device_attribute *attr, cha
		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 *dev, struct device_attribute *attr, cha
		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");
+4 −2
Original line number Diff line number Diff line
@@ -691,10 +691,12 @@ int pci_request_region(struct pci_dev *pdev, int bar, const char *res_name)
	return 0;

err_out:
	printk (KERN_WARNING "PCI: Unable to reserve %s region #%d:%lx@%lx for device %s\n",
	printk (KERN_WARNING "PCI: Unable to reserve %s region #%d:%llx@%llx "
		"for device %s\n",
		pci_resource_flags(pdev, bar) & IORESOURCE_IO ? "I/O" : "mem",
		bar + 1, /* PCI BAR # */
		pci_resource_len(pdev, bar), pci_resource_start(pdev, bar),
		(unsigned long long)pci_resource_len(pdev, bar),
		(unsigned long long)pci_resource_start(pdev, bar),
		pci_name(pdev));
	return -EBUSY;
}
Loading