Skip to content

Commit 63c6ebb

Browse files
committed
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 <[email protected]>
1 parent 281e1f1 commit 63c6ebb

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

drivers/pci/probe.c

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,8 @@ static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom)
344344
}
345345
}
346346

347-
static void pci_read_bridge_io(struct pci_dev *dev, struct resource *res)
347+
static void pci_read_bridge_io(struct pci_dev *dev, struct resource *res,
348+
bool log)
348349
{
349350
u8 io_base_lo, io_limit_lo;
350351
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)
377378
region.start = base;
378379
region.end = limit + io_granularity - 1;
379380
pcibios_bus_to_resource(dev->bus, res, &region);
380-
pci_info(dev, " bridge window %pR\n", res);
381+
if (log)
382+
pci_info(dev, " bridge window %pR\n", res);
381383
}
382384
}
383385

384-
static void pci_read_bridge_mmio(struct pci_dev *dev, struct resource *res)
386+
static void pci_read_bridge_mmio(struct pci_dev *dev, struct resource *res,
387+
bool log)
385388
{
386389
u16 mem_base_lo, mem_limit_lo;
387390
unsigned long base, limit;
@@ -396,11 +399,13 @@ static void pci_read_bridge_mmio(struct pci_dev *dev, struct resource *res)
396399
region.start = base;
397400
region.end = limit + 0xfffff;
398401
pcibios_bus_to_resource(dev->bus, res, &region);
399-
pci_info(dev, " bridge window %pR\n", res);
402+
if (log)
403+
pci_info(dev, " bridge window %pR\n", res);
400404
}
401405
}
402406

403-
static void pci_read_bridge_mmio_pref(struct pci_dev *dev, struct resource *res)
407+
static void pci_read_bridge_mmio_pref(struct pci_dev *dev, struct resource *res,
408+
bool log)
404409
{
405410
u16 mem_base_lo, mem_limit_lo;
406411
u64 base64, limit64;
@@ -446,7 +451,8 @@ static void pci_read_bridge_mmio_pref(struct pci_dev *dev, struct resource *res)
446451
region.start = base;
447452
region.end = limit + 0xfffff;
448453
pcibios_bus_to_resource(dev->bus, res, &region);
449-
pci_info(dev, " bridge window %pR\n", res);
454+
if (log)
455+
pci_info(dev, " bridge window %pR\n", res);
450456
}
451457
}
452458

@@ -518,9 +524,9 @@ void pci_read_bridge_bases(struct pci_bus *child)
518524
for (i = 0; i < PCI_BRIDGE_RESOURCE_NUM; i++)
519525
child->resource[i] = &dev->resource[PCI_BRIDGE_RESOURCES+i];
520526

521-
pci_read_bridge_io(child->self, child->resource[0]);
522-
pci_read_bridge_mmio(child->self, child->resource[1]);
523-
pci_read_bridge_mmio_pref(child->self, child->resource[2]);
527+
pci_read_bridge_io(child->self, child->resource[0], true);
528+
pci_read_bridge_mmio(child->self, child->resource[1], true);
529+
pci_read_bridge_mmio_pref(child->self, child->resource[2], true);
524530

525531
if (dev->transparent) {
526532
pci_bus_for_each_resource(child->parent, res) {

0 commit comments

Comments
 (0)