aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/probe.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2018-08-15 14:59:01 -0500
committerBjorn Helgaas <bhelgaas@google.com>2018-08-15 14:59:01 -0500
commit5fc054a54476f9e2b3d6cc3eeb1537aa549d0ba3 (patch)
tree6a0592aa4088435230163ada694c68b839674d60 /drivers/pci/probe.c
parentc689209be23166b340c224df8ecd5deea163da56 (diff)
parent783e84961b1d7a75045383586b8c49e02b7704cd (diff)
downloadlinux-5fc054a54476f9e2b3d6cc3eeb1537aa549d0ba3.tar.gz
Merge branch 'pci/resource'
- Clean up devm_of_pci_get_host_bridge_resources() resource allocation (Jan Kiszka) - Fixup resizable BARs after suspend/resume (Christian König) - Make "pci=earlydump" generic (Sinan Kaya) - Fix ROM BAR access routines to stay in bounds and check for signature correctly (Rex Zhu) * pci/resource: PCI: Make pci_get_rom_size() static PCI: Add check code for last image indicator not set PCI: Avoid accessing memory outside the ROM BAR PCI: Make early dump functionality generic PCI: Cleanup PCI_REBAR_CTRL_BAR_SHIFT handling PCI: Restore resized BAR state on resume PCI: Clean up resource allocation in devm_of_pci_get_host_bridge_resources() # Conflicts: # Documentation/admin-guide/kernel-parameters.txt
Diffstat (limited to 'drivers/pci/probe.c')
-rw-r--r--drivers/pci/probe.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index f3d2fcc05cda5..8fa78f0ae4d9f 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -1548,6 +1548,20 @@ static int pci_intx_mask_broken(struct pci_dev *dev)
return 0;
}
+static void early_dump_pci_device(struct pci_dev *pdev)
+{
+ u32 value[256 / 4];
+ int i;
+
+ pci_info(pdev, "config space:\n");
+
+ for (i = 0; i < 256; i += 4)
+ pci_read_config_dword(pdev, i, &value[i / 4]);
+
+ print_hex_dump(KERN_INFO, "", DUMP_PREFIX_OFFSET, 16, 1,
+ value, 256, false);
+}
+
/**
* pci_setup_device - Fill in class and map information of a device
* @dev: the device structure to fill
@@ -1597,6 +1611,9 @@ int pci_setup_device(struct pci_dev *dev)
pci_printk(KERN_DEBUG, dev, "[%04x:%04x] type %02x class %#08x\n",
dev->vendor, dev->device, dev->hdr_type, dev->class);
+ if (pci_early_dump)
+ early_dump_pci_device(dev);
+
/* Need to have dev->class ready */
dev->cfg_size = pci_cfg_space_size(dev);