提交 97277981 编写于 作者: M Mohan Kumar 提交者: Caspar Zhang

PCI: Replace dev_printk(KERN_DEBUG) with dev_info(), etc

task #29600094

commit 34c6b7105e5a11174f856483cde8ad6e61b7236a upstream.
Backport summary: for 4.19 kernel ICX PCIe Gen4 support.

Replace dev_printk(KERN_DEBUG) with dev_info(), etc to be more consistent
with other logging and avoid checkpatch warnings.

The KERN_DEBUG messages could be converted to dev_dbg(), but that depends
on CONFIG_DYNAMIC_DEBUG and DEBUG, and we want most of these messages to
*always* be in the dmesg log.

Link: https://lore.kernel.org/lkml/1555733240-19875-1-git-send-email-mohankumar718@gmail.comSigned-off-by: NMohan Kumar <mohankumar718@gmail.com>
[bhelgaas: commit log]
Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>

(cherry picked from commit 34c6b7105e5a11174f856483cde8ad6e61b7236a)
Signed-off-by: NEthan Zhao <haifeng.zhao@intel.com>
Signed-off-by: NArtie Ding <artie.ding@linux.alibaba.com>
Acked-by: NCaspar Zhang <caspar@linux.alibaba.com>
上级 6ee2b977
...@@ -288,8 +288,7 @@ bool pci_bus_clip_resource(struct pci_dev *dev, int idx) ...@@ -288,8 +288,7 @@ bool pci_bus_clip_resource(struct pci_dev *dev, int idx)
res->end = end; res->end = end;
res->flags &= ~IORESOURCE_UNSET; res->flags &= ~IORESOURCE_UNSET;
orig_res.flags &= ~IORESOURCE_UNSET; orig_res.flags &= ~IORESOURCE_UNSET;
pci_printk(KERN_DEBUG, dev, "%pR clipped to %pR\n", pci_info(dev, "%pR clipped to %pR\n", &orig_res, res);
&orig_res, res);
return true; return true;
} }
......
...@@ -2770,14 +2770,14 @@ void pci_pm_init(struct pci_dev *dev) ...@@ -2770,14 +2770,14 @@ void pci_pm_init(struct pci_dev *dev)
dev->d2_support = true; dev->d2_support = true;
if (dev->d1_support || dev->d2_support) if (dev->d1_support || dev->d2_support)
pci_printk(KERN_DEBUG, dev, "supports%s%s\n", pci_info(dev, "supports%s%s\n",
dev->d1_support ? " D1" : "", dev->d1_support ? " D1" : "",
dev->d2_support ? " D2" : ""); dev->d2_support ? " D2" : "");
} }
pmc &= PCI_PM_CAP_PME_MASK; pmc &= PCI_PM_CAP_PME_MASK;
if (pmc) { if (pmc) {
pci_printk(KERN_DEBUG, dev, "PME# supported from%s%s%s%s%s\n", pci_info(dev, "PME# supported from%s%s%s%s%s\n",
(pmc & PCI_PM_CAP_PME_D0) ? " D0" : "", (pmc & PCI_PM_CAP_PME_D0) ? " D0" : "",
(pmc & PCI_PM_CAP_PME_D1) ? " D1" : "", (pmc & PCI_PM_CAP_PME_D1) ? " D1" : "",
(pmc & PCI_PM_CAP_PME_D2) ? " D2" : "", (pmc & PCI_PM_CAP_PME_D2) ? " D2" : "",
...@@ -2945,16 +2945,16 @@ static int pci_ea_read(struct pci_dev *dev, int offset) ...@@ -2945,16 +2945,16 @@ static int pci_ea_read(struct pci_dev *dev, int offset)
res->flags = flags; res->flags = flags;
if (bei <= PCI_EA_BEI_BAR5) if (bei <= PCI_EA_BEI_BAR5)
pci_printk(KERN_DEBUG, dev, "BAR %d: %pR (from Enhanced Allocation, properties %#02x)\n", pci_info(dev, "BAR %d: %pR (from Enhanced Allocation, properties %#02x)\n",
bei, res, prop); bei, res, prop);
else if (bei == PCI_EA_BEI_ROM) else if (bei == PCI_EA_BEI_ROM)
pci_printk(KERN_DEBUG, dev, "ROM: %pR (from Enhanced Allocation, properties %#02x)\n", pci_info(dev, "ROM: %pR (from Enhanced Allocation, properties %#02x)\n",
res, prop); res, prop);
else if (bei >= PCI_EA_BEI_VF_BAR0 && bei <= PCI_EA_BEI_VF_BAR5) else if (bei >= PCI_EA_BEI_VF_BAR0 && bei <= PCI_EA_BEI_VF_BAR5)
pci_printk(KERN_DEBUG, dev, "VF BAR %d: %pR (from Enhanced Allocation, properties %#02x)\n", pci_info(dev, "VF BAR %d: %pR (from Enhanced Allocation, properties %#02x)\n",
bei - PCI_EA_BEI_VF_BAR0, res, prop); bei - PCI_EA_BEI_VF_BAR0, res, prop);
else else
pci_printk(KERN_DEBUG, dev, "BEI %d res: %pR (from Enhanced Allocation, properties %#02x)\n", pci_info(dev, "BEI %d res: %pR (from Enhanced Allocation, properties %#02x)\n",
bei, res, prop); bei, res, prop);
out: out:
...@@ -4178,7 +4178,7 @@ int pci_set_cacheline_size(struct pci_dev *dev) ...@@ -4178,7 +4178,7 @@ int pci_set_cacheline_size(struct pci_dev *dev)
if (cacheline_size == pci_cache_line_size) if (cacheline_size == pci_cache_line_size)
return 0; return 0;
pci_printk(KERN_DEBUG, dev, "cache line size of %d is not supported\n", pci_info(dev, "cache line size of %d is not supported\n",
pci_cache_line_size << 2); pci_cache_line_size << 2);
return -EINVAL; return -EINVAL;
......
...@@ -317,7 +317,7 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type, ...@@ -317,7 +317,7 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
res->flags = 0; res->flags = 0;
out: out:
if (res->flags) if (res->flags)
pci_printk(KERN_DEBUG, dev, "reg 0x%x: %pR\n", pos, res); pci_info(dev, "reg 0x%x: %pR\n", pos, res);
return (res->flags & IORESOURCE_MEM_64) ? 1 : 0; return (res->flags & IORESOURCE_MEM_64) ? 1 : 0;
} }
...@@ -384,7 +384,7 @@ static void pci_read_bridge_io(struct pci_bus *child) ...@@ -384,7 +384,7 @@ static void pci_read_bridge_io(struct pci_bus *child)
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, &region); pcibios_bus_to_resource(dev->bus, res, &region);
pci_printk(KERN_DEBUG, dev, " bridge window %pR\n", res); pci_info(dev, " bridge window %pR\n", res);
} }
} }
...@@ -406,7 +406,7 @@ static void pci_read_bridge_mmio(struct pci_bus *child) ...@@ -406,7 +406,7 @@ static void pci_read_bridge_mmio(struct pci_bus *child)
region.start = base; region.start = base;
region.end = limit + 0xfffff; region.end = limit + 0xfffff;
pcibios_bus_to_resource(dev->bus, res, &region); pcibios_bus_to_resource(dev->bus, res, &region);
pci_printk(KERN_DEBUG, dev, " bridge window %pR\n", res); pci_info(dev, " bridge window %pR\n", res);
} }
} }
...@@ -459,7 +459,7 @@ static void pci_read_bridge_mmio_pref(struct pci_bus *child) ...@@ -459,7 +459,7 @@ static void pci_read_bridge_mmio_pref(struct pci_bus *child)
region.start = base; region.start = base;
region.end = limit + 0xfffff; region.end = limit + 0xfffff;
pcibios_bus_to_resource(dev->bus, res, &region); pcibios_bus_to_resource(dev->bus, res, &region);
pci_printk(KERN_DEBUG, dev, " bridge window %pR\n", res); pci_info(dev, " bridge window %pR\n", res);
} }
} }
...@@ -489,8 +489,7 @@ void pci_read_bridge_bases(struct pci_bus *child) ...@@ -489,8 +489,7 @@ void pci_read_bridge_bases(struct pci_bus *child)
if (res && res->flags) { if (res && res->flags) {
pci_bus_add_resource(child, res, pci_bus_add_resource(child, res,
PCI_SUBTRACTIVE_DECODE); PCI_SUBTRACTIVE_DECODE);
pci_printk(KERN_DEBUG, dev, pci_info(dev, " bridge window %pR (subtractive decode)\n",
" bridge window %pR (subtractive decode)\n",
res); res);
} }
} }
...@@ -1614,7 +1613,7 @@ int pci_setup_device(struct pci_dev *dev) ...@@ -1614,7 +1613,7 @@ int pci_setup_device(struct pci_dev *dev)
dev->revision = class & 0xff; dev->revision = class & 0xff;
dev->class = class >> 8; /* upper 3 bytes */ dev->class = class >> 8; /* upper 3 bytes */
pci_printk(KERN_DEBUG, dev, "[%04x:%04x] type %02x class %#08x\n", pci_info(dev, "[%04x:%04x] type %02x class %#08x\n",
dev->vendor, dev->device, dev->hdr_type, dev->class); dev->vendor, dev->device, dev->hdr_type, dev->class);
if (pci_early_dump) if (pci_early_dump)
...@@ -3010,7 +3009,7 @@ int pci_bus_insert_busn_res(struct pci_bus *b, int bus, int bus_max) ...@@ -3010,7 +3009,7 @@ int pci_bus_insert_busn_res(struct pci_bus *b, int bus, int bus_max)
conflict = request_resource_conflict(parent_res, res); conflict = request_resource_conflict(parent_res, res);
if (conflict) if (conflict)
dev_printk(KERN_DEBUG, &b->dev, dev_info(&b->dev,
"busn_res: can not insert %pR under %s%pR (conflicts with %s %pR)\n", "busn_res: can not insert %pR under %s%pR (conflicts with %s %pR)\n",
res, pci_is_root_bus(b) ? "domain " : "", res, pci_is_root_bus(b) ? "domain " : "",
parent_res, conflict->name, conflict); parent_res, conflict->name, conflict);
...@@ -3030,8 +3029,7 @@ int pci_bus_update_busn_res_end(struct pci_bus *b, int bus_max) ...@@ -3030,8 +3029,7 @@ int pci_bus_update_busn_res_end(struct pci_bus *b, int bus_max)
size = bus_max - res->start + 1; size = bus_max - res->start + 1;
ret = adjust_resource(res, res->start, size); ret = adjust_resource(res, res->start, size);
dev_printk(KERN_DEBUG, &b->dev, dev_info(&b->dev, "busn_res: %pR end %s updated to %02x\n",
"busn_res: %pR end %s updated to %02x\n",
&old_res, ret ? "can not be" : "is", bus_max); &old_res, ret ? "can not be" : "is", bus_max);
if (!ret && !res->parent) if (!ret && !res->parent)
...@@ -3049,8 +3047,7 @@ void pci_bus_release_busn_res(struct pci_bus *b) ...@@ -3049,8 +3047,7 @@ void pci_bus_release_busn_res(struct pci_bus *b)
return; return;
ret = release_resource(res); ret = release_resource(res);
dev_printk(KERN_DEBUG, &b->dev, dev_info(&b->dev, "busn_res: %pR %s released\n",
"busn_res: %pR %s released\n",
res, ret ? "can not be" : "is"); res, ret ? "can not be" : "is");
} }
......
...@@ -159,8 +159,7 @@ static int __init pci_apply_final_quirks(void) ...@@ -159,8 +159,7 @@ static int __init pci_apply_final_quirks(void)
u8 tmp; u8 tmp;
if (pci_cache_line_size) if (pci_cache_line_size)
printk(KERN_DEBUG "PCI: CLS %u bytes\n", pr_info("PCI: CLS %u bytes\n", pci_cache_line_size << 2);
pci_cache_line_size << 2);
pci_apply_fixup_final_quirks = true; pci_apply_fixup_final_quirks = true;
for_each_pci_dev(dev) { for_each_pci_dev(dev) {
...@@ -177,16 +176,16 @@ static int __init pci_apply_final_quirks(void) ...@@ -177,16 +176,16 @@ static int __init pci_apply_final_quirks(void)
if (!tmp || cls == tmp) if (!tmp || cls == tmp)
continue; continue;
pci_printk(KERN_DEBUG, dev, "CLS mismatch (%u != %u), using %u bytes\n", pci_info(dev, "CLS mismatch (%u != %u), using %u bytes\n",
cls << 2, tmp << 2, cls << 2, tmp << 2,
pci_dfl_cache_line_size << 2); pci_dfl_cache_line_size << 2);
pci_cache_line_size = pci_dfl_cache_line_size; pci_cache_line_size = pci_dfl_cache_line_size;
} }
} }
if (!pci_cache_line_size) { if (!pci_cache_line_size) {
printk(KERN_DEBUG "PCI: CLS %u bytes, default %u\n", pr_info("PCI: CLS %u bytes, default %u\n", cls << 2,
cls << 2, pci_dfl_cache_line_size << 2); pci_dfl_cache_line_size << 2);
pci_cache_line_size = cls ? cls : pci_dfl_cache_line_size; pci_cache_line_size = cls ? cls : pci_dfl_cache_line_size;
} }
......
...@@ -255,10 +255,9 @@ static void reassign_resources_sorted(struct list_head *realloc_head, ...@@ -255,10 +255,9 @@ static void reassign_resources_sorted(struct list_head *realloc_head,
(IORESOURCE_STARTALIGN|IORESOURCE_SIZEALIGN); (IORESOURCE_STARTALIGN|IORESOURCE_SIZEALIGN);
if (pci_reassign_resource(add_res->dev, idx, if (pci_reassign_resource(add_res->dev, idx,
add_size, align)) add_size, align))
pci_printk(KERN_DEBUG, add_res->dev, pci_info(add_res->dev, "failed to add %llx res[%d]=%pR\n",
"failed to add %llx res[%d]=%pR\n", (unsigned long long) add_size, idx,
(unsigned long long)add_size, res);
idx, res);
} }
out: out:
list_del(&add_res->list); list_del(&add_res->list);
...@@ -951,9 +950,9 @@ static void pbus_size_io(struct pci_bus *bus, resource_size_t min_size, ...@@ -951,9 +950,9 @@ static void pbus_size_io(struct pci_bus *bus, resource_size_t min_size,
if (size1 > size0 && realloc_head) { if (size1 > size0 && realloc_head) {
add_to_list(realloc_head, bus->self, b_res, size1-size0, add_to_list(realloc_head, bus->self, b_res, size1-size0,
min_align); min_align);
pci_printk(KERN_DEBUG, bus->self, "bridge window %pR to %pR add_size %llx\n", pci_info(bus->self, "bridge window %pR to %pR add_size %llx\n",
b_res, &bus->busn_res, b_res, &bus->busn_res,
(unsigned long long)size1-size0); (unsigned long long) size1 - size0);
} }
} }
...@@ -1098,7 +1097,7 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask, ...@@ -1098,7 +1097,7 @@ static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
b_res->flags |= IORESOURCE_STARTALIGN; b_res->flags |= IORESOURCE_STARTALIGN;
if (size1 > size0 && realloc_head) { if (size1 > size0 && realloc_head) {
add_to_list(realloc_head, bus->self, b_res, size1-size0, add_align); add_to_list(realloc_head, bus->self, b_res, size1-size0, add_align);
pci_printk(KERN_DEBUG, bus->self, "bridge window %pR to %pR add_size %llx add_align %llx\n", pci_info(bus->self, "bridge window %pR to %pR add_size %llx add_align %llx\n",
b_res, &bus->busn_res, b_res, &bus->busn_res,
(unsigned long long) (size1 - size0), (unsigned long long) (size1 - size0),
(unsigned long long) add_align); (unsigned long long) add_align);
...@@ -1566,8 +1565,8 @@ static void pci_bridge_release_resources(struct pci_bus *bus, ...@@ -1566,8 +1565,8 @@ static void pci_bridge_release_resources(struct pci_bus *bus,
release_child_resources(r); release_child_resources(r);
if (!release_resource(r)) { if (!release_resource(r)) {
type = old_flags = r->flags & PCI_RES_TYPE_MASK; type = old_flags = r->flags & PCI_RES_TYPE_MASK;
pci_printk(KERN_DEBUG, dev, "resource %d %pR released\n", pci_info(dev, "resource %d %pR released\n",
PCI_BRIDGE_RESOURCES + idx, r); PCI_BRIDGE_RESOURCES + idx, r);
/* keep the old size */ /* keep the old size */
r->end = resource_size(r) - 1; r->end = resource_size(r) - 1;
r->start = 0; r->start = 0;
...@@ -1631,7 +1630,7 @@ static void pci_bus_dump_res(struct pci_bus *bus) ...@@ -1631,7 +1630,7 @@ static void pci_bus_dump_res(struct pci_bus *bus)
if (!res || !res->end || !res->flags) if (!res || !res->end || !res->flags)
continue; continue;
dev_printk(KERN_DEBUG, &bus->dev, "resource %d %pR\n", i, res); dev_info(&bus->dev, "resource %d %pR\n", i, res);
} }
} }
...@@ -1765,9 +1764,8 @@ void pci_assign_unassigned_root_bus_resources(struct pci_bus *bus) ...@@ -1765,9 +1764,8 @@ void pci_assign_unassigned_root_bus_resources(struct pci_bus *bus)
int max_depth = pci_bus_get_depth(bus); int max_depth = pci_bus_get_depth(bus);
pci_try_num = max_depth + 1; pci_try_num = max_depth + 1;
dev_printk(KERN_DEBUG, &bus->dev, dev_info(&bus->dev, "max bus depth: %d pci_try_num: %d\n",
"max bus depth: %d pci_try_num: %d\n", max_depth, pci_try_num);
max_depth, pci_try_num);
} }
again: again:
...@@ -1801,8 +1799,8 @@ void pci_assign_unassigned_root_bus_resources(struct pci_bus *bus) ...@@ -1801,8 +1799,8 @@ void pci_assign_unassigned_root_bus_resources(struct pci_bus *bus)
goto dump; goto dump;
} }
dev_printk(KERN_DEBUG, &bus->dev, dev_info(&bus->dev, "No. %d try to assign unassigned res\n",
"No. %d try to assign unassigned res\n", tried_times + 1); tried_times + 1);
/* third times and later will not check if it is leaf */ /* third times and later will not check if it is leaf */
if ((tried_times + 1) > 2) if ((tried_times + 1) > 2)
......
...@@ -291,8 +291,7 @@ static int pci_frontend_enable_msix(struct pci_dev *dev, ...@@ -291,8 +291,7 @@ static int pci_frontend_enable_msix(struct pci_dev *dev,
vector[i] = op.msix_entries[i].vector; vector[i] = op.msix_entries[i].vector;
} }
} else { } else {
printk(KERN_DEBUG "enable msix get value %x\n", pr_info("enable msix get value %x\n", op.value);
op.value);
err = op.value; err = op.value;
} }
} else { } else {
...@@ -364,12 +363,12 @@ static void pci_frontend_disable_msi(struct pci_dev *dev) ...@@ -364,12 +363,12 @@ static void pci_frontend_disable_msi(struct pci_dev *dev)
err = do_pci_op(pdev, &op); err = do_pci_op(pdev, &op);
if (err == XEN_PCI_ERR_dev_not_found) { if (err == XEN_PCI_ERR_dev_not_found) {
/* XXX No response from backend, what shall we do? */ /* XXX No response from backend, what shall we do? */
printk(KERN_DEBUG "get no response from backend for disable MSI\n"); pr_info("get no response from backend for disable MSI\n");
return; return;
} }
if (err) if (err)
/* how can pciback notify us fail? */ /* how can pciback notify us fail? */
printk(KERN_DEBUG "get fake response frombackend\n"); pr_info("get fake response from backend\n");
} }
static struct xen_pci_frontend_ops pci_frontend_ops = { static struct xen_pci_frontend_ops pci_frontend_ops = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册