mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
PCI: Log bridge windows conditionally
Previously pci_read_bridge_io(), pci_read_bridge_mmio(), and pci_read_bridge_mmio_pref() unconditionally logged the bridge window resource. A future change will call these functions earlier and more often. Add a "log" parameter so callers can control whether to generate the log message. No functional change intended. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
This commit is contained in:
parent
281e1f137a
commit
63c6ebb294
@ -344,7 +344,8 @@ static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void pci_read_bridge_io(struct pci_dev *dev, struct resource *res)
|
static void pci_read_bridge_io(struct pci_dev *dev, struct resource *res,
|
||||||
|
bool log)
|
||||||
{
|
{
|
||||||
u8 io_base_lo, io_limit_lo;
|
u8 io_base_lo, io_limit_lo;
|
||||||
unsigned long io_mask, io_granularity, base, limit;
|
unsigned long io_mask, io_granularity, base, limit;
|
||||||
@ -377,11 +378,13 @@ static void pci_read_bridge_io(struct pci_dev *dev, struct resource *res)
|
|||||||
region.start = base;
|
region.start = base;
|
||||||
region.end = limit + io_granularity - 1;
|
region.end = limit + io_granularity - 1;
|
||||||
pcibios_bus_to_resource(dev->bus, res, ®ion);
|
pcibios_bus_to_resource(dev->bus, res, ®ion);
|
||||||
|
if (log)
|
||||||
pci_info(dev, " bridge window %pR\n", res);
|
pci_info(dev, " bridge window %pR\n", res);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void pci_read_bridge_mmio(struct pci_dev *dev, struct resource *res)
|
static void pci_read_bridge_mmio(struct pci_dev *dev, struct resource *res,
|
||||||
|
bool log)
|
||||||
{
|
{
|
||||||
u16 mem_base_lo, mem_limit_lo;
|
u16 mem_base_lo, mem_limit_lo;
|
||||||
unsigned long base, limit;
|
unsigned long base, limit;
|
||||||
@ -396,11 +399,13 @@ static void pci_read_bridge_mmio(struct pci_dev *dev, struct resource *res)
|
|||||||
region.start = base;
|
region.start = base;
|
||||||
region.end = limit + 0xfffff;
|
region.end = limit + 0xfffff;
|
||||||
pcibios_bus_to_resource(dev->bus, res, ®ion);
|
pcibios_bus_to_resource(dev->bus, res, ®ion);
|
||||||
|
if (log)
|
||||||
pci_info(dev, " bridge window %pR\n", res);
|
pci_info(dev, " bridge window %pR\n", res);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void pci_read_bridge_mmio_pref(struct pci_dev *dev, struct resource *res)
|
static void pci_read_bridge_mmio_pref(struct pci_dev *dev, struct resource *res,
|
||||||
|
bool log)
|
||||||
{
|
{
|
||||||
u16 mem_base_lo, mem_limit_lo;
|
u16 mem_base_lo, mem_limit_lo;
|
||||||
u64 base64, limit64;
|
u64 base64, limit64;
|
||||||
@ -446,6 +451,7 @@ static void pci_read_bridge_mmio_pref(struct pci_dev *dev, struct resource *res)
|
|||||||
region.start = base;
|
region.start = base;
|
||||||
region.end = limit + 0xfffff;
|
region.end = limit + 0xfffff;
|
||||||
pcibios_bus_to_resource(dev->bus, res, ®ion);
|
pcibios_bus_to_resource(dev->bus, res, ®ion);
|
||||||
|
if (log)
|
||||||
pci_info(dev, " bridge window %pR\n", res);
|
pci_info(dev, " bridge window %pR\n", res);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -518,9 +524,9 @@ void pci_read_bridge_bases(struct pci_bus *child)
|
|||||||
for (i = 0; i < PCI_BRIDGE_RESOURCE_NUM; i++)
|
for (i = 0; i < PCI_BRIDGE_RESOURCE_NUM; i++)
|
||||||
child->resource[i] = &dev->resource[PCI_BRIDGE_RESOURCES+i];
|
child->resource[i] = &dev->resource[PCI_BRIDGE_RESOURCES+i];
|
||||||
|
|
||||||
pci_read_bridge_io(child->self, child->resource[0]);
|
pci_read_bridge_io(child->self, child->resource[0], true);
|
||||||
pci_read_bridge_mmio(child->self, child->resource[1]);
|
pci_read_bridge_mmio(child->self, child->resource[1], true);
|
||||||
pci_read_bridge_mmio_pref(child->self, child->resource[2]);
|
pci_read_bridge_mmio_pref(child->self, child->resource[2], true);
|
||||||
|
|
||||||
if (dev->transparent) {
|
if (dev->transparent) {
|
||||||
pci_bus_for_each_resource(child->parent, res) {
|
pci_bus_for_each_resource(child->parent, res) {
|
||||||
|
Loading…
Reference in New Issue
Block a user