aboutsummaryrefslogtreecommitdiff
path: root/drivers/pci/setup-res.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-07-16 17:25:46 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-16 17:25:46 -0700
commitdc7c65db2845a8d17432d89252c4227a9a7cb15f (patch)
tree79030b0aaaafc04bc4303c21495134e744afc058 /drivers/pci/setup-res.c
parent8a0ca91e1db5de5eb5b18cfa919d52ff8be375af (diff)
parent58b6e5538460be358fdf1286d9a2fbcfcc2cfaba (diff)
Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6
* 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6: (72 commits) Revert "x86/PCI: ACPI based PCI gap calculation" PCI: remove unnecessary volatile in PCIe hotplug struct controller x86/PCI: ACPI based PCI gap calculation PCI: include linux/pm_wakeup.h for device_set_wakeup_capable PCI PM: Fix pci_prepare_to_sleep x86/PCI: Fix PCI config space for domains > 0 Fix acpi_pm_device_sleep_wake() by providing a stub for CONFIG_PM_SLEEP=n PCI: Simplify PCI device PM code PCI PM: Introduce pci_prepare_to_sleep and pci_back_from_sleep PCI ACPI: Rework PCI handling of wake-up ACPI: Introduce new device wakeup flag 'prepared' ACPI: Introduce acpi_device_sleep_wake function PCI: rework pci_set_power_state function to call platform first PCI: Introduce platform_pci_power_manageable function ACPI: Introduce acpi_bus_power_manageable function PCI: make pci_name use dev_name PCI: handle pci_name() being const PCI: add stub for pci_set_consistent_dma_mask() PCI: remove unused arch pcibios_update_resource() functions PCI: fix pci_setup_device()'s sprinting into a const buffer ... Fixed up conflicts in various files (arch/x86/kernel/setup_64.c, arch/x86/pci/irq.c, arch/x86/pci/pci.h, drivers/acpi/sleep/main.c, drivers/pci/pci.c, drivers/pci/pci.h, include/acpi/acpi_bus.h) from x86 and ACPI updates manually.
Diffstat (limited to 'drivers/pci/setup-res.c')
-rw-r--r--drivers/pci/setup-res.c70
1 files changed, 33 insertions, 37 deletions
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
index 7d35cdf4579..1a5fc83c71b 100644
--- a/drivers/pci/setup-res.c
+++ b/drivers/pci/setup-res.c
@@ -26,8 +26,7 @@
#include "pci.h"
-void
-pci_update_resource(struct pci_dev *dev, struct resource *res, int resno)
+void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno)
{
struct pci_bus_region region;
u32 new, check, mask;
@@ -43,20 +42,20 @@ pci_update_resource(struct pci_dev *dev, struct resource *res, int resno)
/*
* Ignore non-moveable resources. This might be legacy resources for
* which no functional BAR register exists or another important
- * system resource we should better not move around in system address
- * space.
+ * system resource we shouldn't move around.
*/
if (res->flags & IORESOURCE_PCI_FIXED)
return;
pcibios_resource_to_bus(dev, &region, res);
- pr_debug(" got res [%llx:%llx] bus [%llx:%llx] flags %lx for "
- "BAR %d of %s\n", (unsigned long long)res->start,
+ dev_dbg(&dev->dev, "BAR %d: got res [%#llx-%#llx] bus [%#llx-%#llx] "
+ "flags %#lx\n", resno,
+ (unsigned long long)res->start,
(unsigned long long)res->end,
(unsigned long long)region.start,
(unsigned long long)region.end,
- (unsigned long)res->flags, resno, pci_name(dev));
+ (unsigned long)res->flags);
new = region.start | (res->flags & PCI_REGION_FLAG_MASK);
if (res->flags & IORESOURCE_IO)
@@ -81,9 +80,8 @@ pci_update_resource(struct pci_dev *dev, struct resource *res, int resno)
pci_read_config_dword(dev, reg, &check);
if ((new ^ check) & mask) {
- printk(KERN_ERR "PCI: Error while updating region "
- "%s/%d (%08x != %08x)\n", pci_name(dev), resno,
- new, check);
+ dev_err(&dev->dev, "BAR %d: error updating (%#08x != %#08x)\n",
+ resno, new, check);
}
if ((new & (PCI_BASE_ADDRESS_SPACE|PCI_BASE_ADDRESS_MEM_TYPE_MASK)) ==
@@ -92,15 +90,14 @@ pci_update_resource(struct pci_dev *dev, struct resource *res, int resno)
pci_write_config_dword(dev, reg + 4, new);
pci_read_config_dword(dev, reg + 4, &check);
if (check != new) {
- printk(KERN_ERR "PCI: Error updating region "
- "%s/%d (high %08x != %08x)\n",
- pci_name(dev), resno, new, check);
+ dev_err(&dev->dev, "BAR %d: error updating "
+ "(high %#08x != %#08x)\n", resno, new, check);
}
}
res->flags &= ~IORESOURCE_UNSET;
- pr_debug("PCI: moved device %s resource %d (%lx) to %x\n",
- pci_name(dev), resno, res->flags,
- new & ~PCI_REGION_FLAG_MASK);
+ dev_dbg(&dev->dev, "BAR %d: moved to bus [%#llx-%#llx] flags %#lx\n",
+ resno, (unsigned long long)region.start,
+ (unsigned long long)region.end, res->flags);
}
int pci_claim_resource(struct pci_dev *dev, int resource)
@@ -117,10 +114,11 @@ int pci_claim_resource(struct pci_dev *dev, int resource)
err = insert_resource(root, res);
if (err) {
- 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),
+ dev_err(&dev->dev, "BAR %d: %s of %s [%#llx-%#llx]\n",
+ resource,
+ root ? "address space collision on" :
+ "no parent found for",
+ dtype,
(unsigned long long)res->start,
(unsigned long long)res->end);
}
@@ -140,11 +138,10 @@ int pci_assign_resource(struct pci_dev *dev, int resno)
align = resource_alignment(res);
if (!align) {
- printk(KERN_ERR "PCI: Cannot allocate resource (bogus "
- "alignment) %d [%llx:%llx] (flags %lx) of %s\n",
+ dev_err(&dev->dev, "BAR %d: can't allocate resource (bogus "
+ "alignment) [%#llx-%#llx] flags %#lx\n",
resno, (unsigned long long)res->start,
- (unsigned long long)res->end, res->flags,
- pci_name(dev));
+ (unsigned long long)res->end, res->flags);
return -EINVAL;
}
@@ -165,11 +162,11 @@ int pci_assign_resource(struct pci_dev *dev, int resno)
}
if (ret) {
- printk(KERN_ERR "PCI: Failed to allocate %s resource "
- "#%d:%llx@%llx for %s\n",
+ dev_err(&dev->dev, "BAR %d: can't allocate %s resource "
+ "[%#llx-%#llx]\n", resno,
res->flags & IORESOURCE_IO ? "I/O" : "mem",
- resno, (unsigned long long)size,
- (unsigned long long)res->start, pci_name(dev));
+ (unsigned long long)res->start,
+ (unsigned long long)res->end);
} else {
res->flags &= ~IORESOURCE_STARTALIGN;
if (resno < PCI_BRIDGE_RESOURCES)
@@ -205,11 +202,11 @@ int pci_assign_resource_fixed(struct pci_dev *dev, int resno)
}
if (ret) {
- printk(KERN_ERR "PCI: Failed to allocate %s resource "
- "#%d:%llx@%llx for %s\n",
+ dev_err(&dev->dev, "BAR %d: can't allocate %s resource "
+ "[%#llx-%#llx\n]", resno,
res->flags & IORESOURCE_IO ? "I/O" : "mem",
- resno, (unsigned long long)(res->end - res->start + 1),
- (unsigned long long)res->start, pci_name(dev));
+ (unsigned long long)res->start,
+ (unsigned long long)res->end);
} else if (resno < PCI_BRIDGE_RESOURCES) {
pci_update_resource(dev, res, resno);
}
@@ -239,11 +236,10 @@ void pdev_sort_resources(struct pci_dev *dev, struct resource_list *head)
r_align = resource_alignment(r);
if (!r_align) {
- printk(KERN_WARNING "PCI: bogus alignment of resource "
- "%d [%llx:%llx] (flags %lx) of %s\n",
+ dev_warn(&dev->dev, "BAR %d: bogus alignment "
+ "[%#llx-%#llx] flags %#lx\n",
i, (unsigned long long)r->start,
- (unsigned long long)r->end, r->flags,
- pci_name(dev));
+ (unsigned long long)r->end, r->flags);
continue;
}
for (list = head; ; list = list->next) {
@@ -291,7 +287,7 @@ int pci_enable_resources(struct pci_dev *dev, int mask)
if (!r->parent) {
dev_err(&dev->dev, "device not available because of "
- "BAR %d [%llx:%llx] collisions\n", i,
+ "BAR %d [%#llx-%#llx] collisions\n", i,
(unsigned long long) r->start,
(unsigned long long) r->end);
return -EINVAL;